!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! McGill's Scorpion Robot Model ! ! ADAMS 12.0.0 code compatible. ! ! Written by James Andrew Smith (jasmith@cim.mcgill.ca) ! April, 2002 ! ! Original Code by Ralf and Company. ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! "dyn_scorp_old.adm" is being rewritten to make it more macro-like. ! This will make it a whole lot easier to modify parameters as part of ! the design study. ! ! ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! ------------------------------------------------------- ! New Session - Set units, ! create a model, ! setup ground, ! setup material, ! and set gravity ! -------------------------------------------------------- ! undo begin ! default units len=mm mass=kg force=newton model create model="scorpion_mcgill" fit_to_view=yes part attrib part_name=ground name_vis=off part modify rigid_body mass_properties part_name=ground & material=.materials.steel force create body gravitational gravity=gravity & x_comp=0 y_comp=-9806.65 z_comp=0 ! ! Set some other options ! defaults command_file echo_commands=off update_screen=off defaults attributes icon_visibility="on" ! ! ! ! ------------------------------------------ ! ! Load the ADAMS/Control Plugin / Toolbox ! ! ----------------------------------------- plugin load plugin_name=.mdi.plugins.controls ! ! !------------------------------------------- ! ! Variables ! !------------------------------------------- ! var set var=number_of_hip_pairs inte=3 ! ! hip_block: the lateral bars connecting hip pairs var set var=hip_block_x units=length real=109 range=0,200 var set var=hip_block_y units=length real=120 range=0,200 var set var=hip_block_z units=length real=20 range=0,100 ! ! body_block: the boxes connecting hip_blocks together. var set var=body_block_x units=length real=60 range=0,200 var set var=body_block_y units=length real=120 range=0,200 var set var=body_block_z units=length real=190 range=0,300 ! ! L1: spacing between hips var set var=L1 units=length real=210 range=0,400 ! ! H1: the initial robot height. var set var=H1 units=length real=200 range=0,500 !! Was 325 ! ! ! link_length: Link Length (leg) !! was 153 var set var = link_length units=length real=76.5 range=0,300 ! ! link_radius: Link radius (leg) var set var = link_radius units=length real=12.5 range=0,40 ! ! slide_link_length: Link Length (leg) var set var = slide_link_length units=length real=125 range=0,600 ! ! slide_link_radius: Link radius (leg) var set var = slide_link_radius units=length real=5 range=0,40 ! ! actuator_length: Actuator Length (leg) var set var = actuator_length units=length real=104 range=0,200 ! ! actuator_radius: Actuator Radius (leg) var set var = actuator_radius units=length real=17 range=0, 50 ! ! toe_radius: Toe Radius (Toe) var set var = toe_radius units=length real=5 range=0, 50 ! ! leg_spring_constant: Spring constant in the basalar slider !! Units: [N/mm] var set var = leg_spring_constant units=length real=75 range=0, 50000 !! 100 is good ! ! leg_damper_constant: Spring constant in the basalar slider !! Units: [N*sec/mm] var set var = leg_damper_constant units=length real=0.5 range=0, 50000 !! 1 is good, too ! ! body_height_extrude: the vertical height of the robot body var set var=body_height_extrude units=length real=110 range=0,500 ! ! body mass and inertia !! These are total guesses... var set var=body_mass real=40 range=0,500 !! compared to a similar block of steel. var set var=body_inertia_ixx real=1000000 !! compared to a similar block of steel. var set var=body_inertia_iyy real=1000000 !! compared to a similar block of steel. var set var=body_inertia_izz real=60000 !! compared to a similar block of steel. ! ! ! ! !! Thoracic Motion Splines data_element create spline spline_name = thoracic_position_spline_phase1 & !! x=0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6 & x=0,0.15,0.3,0.45,0.6,0.75,0.9,1.05,1.2,1.35,1.5,1.65,1.8 & !! y=0,1.57,1.57,1.57,3.14,4.71,4.71,4.71,6.28,7.85,7.85,7.85,9.42 & !! y=0,0,0,0,0,0,0,0,0,0,0,0,0 & !! linear_extrapolate = yes data_element create spline spline_name = thoracic_position_spline_phase2 & x=0,0.15,0.3,0.45,0.6,0.75,0.9,1.05,1.2,1.35,1.5,1.65,1.8 & !! x=0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6 & !! y=0,0,0,1.57,1.57,1.57,3.14,4.71,4.71,4.71,6.28,7.85,7.85 & !! ,7.85,9.42 & !! y=0,0,0,0,0,0,0,0,0,0,0,0,0 & !! ,7.85,9.42 & !! linear_extrapolate = yes ! !! Basalar Motion Splines data_element create spline spline_name = basalar_position_spline_phase1 & !! x=0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6 & !! x=0,0.2,0.4,0.6,0.8,1,1.2,1.4,1.6,1.8,2,2.2,2.4 & x=0,0.15,0.3,0.45,0.6,0.75,0.9,1.05,1.2,1.35,1.5,1.65,1.8 & y=0,0.26,-0.52,0.26,0.52,0.26,-0.52,0.26,0.52,0.26,-0.52,0.26,0.52 & !! 13 !! y=0,-0.26,0,0.26,0.52,0.26,0,-0.26,-0.52,-0.26,0,0.26,0.52 & !! 13 !! original linear_extrapolate = yes data_element create spline spline_name = basalar_position_spline_phase2 & !! x=0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6 & !! x=0,0.2,0.4,0.6,0.8,1,1.2,1.4,1.6,1.8,2,2.2,2.4 & x=0,0.15,0.3,0.45,0.6,0.75,0.9,1.05,1.2,1.35,1.5,1.65,1.8 & !!y=0,0,0,-0.26,0,0.26,0.52,0.26,0,-0.26,-0.52,-0.26,0 & !! ,0.26,0.52 & !! 13 !! original y=0,0,0,0.26,-0.52,0.26,0.52,0.26,-0.52,0.26,0.52,0.26,-0.52 & !! ,0.26,0.52 & !! 13 linear_extrapolate = yes !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! Trileg hop/jump: (spline definitions) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! Thoracic Motion Splines !data_element create spline spline_name = thoracic_position_spline_phase1 & ! x=0,0.15,0.3,0.45,0.6,0.75,0.9,1.05,1.2,1.35,1.5,1.65,1.8 & ! y=0,0,0,0,0,0,0,0,0,0,0,0,0 & !! ! linear_extrapolate = yes !data_element create spline spline_name = thoracic_position_spline_phase2 & ! x=0,0.15,0.3,0.45,0.6,0.75,0.9,1.05,1.2,1.35,1.5,1.65,1.8 & ! y=0,0,0,0,0,0,0,0,0,0,0,0,0 & !! ,7.85,9.42 & !! ! linear_extrapolate = yes ! !! Basalar Motion Splines !data_element create spline spline_name = basalar_position_spline_phase1 & ! x=0,0.15,0.3,0.45,0.6,0.75,0.9,1.05,1.2,1.35,1.5,1.65,1.8 & ! y=0,0.26,-0.52,0.26,0.52,0.26,-0.52,0.26,0.52,0.26,-0.52,0.26,0.52 & !! 13 ! linear_extrapolate = yes !data_element create spline spline_name = basalar_position_spline_phase2 & ! x=0,0.15,0.3,0.45,0.6,0.75,0.9,1.05,1.2,1.35,1.5,1.65,1.8 & ! y=0,0,0,0.26,-0.52,0.26,0.52,0.26,-0.52,0.26,0.52,0.26,-0.52 & !! ,0.26,0.52 & !! 13 ! linear_extrapolate = yes ! ! ! ! ! ! !! undo end !------------------------------------------- ! ! ------------------------------------------------------------------- ! CREATE Coordinate System ! ------------------------------------------------------------------- marker create marker=.scorpion_mcgill.ground.MAR_1 & location = 0.0, 0.0, 0.0 & orientation= 0d, 0d, 0d group modify group=SELECT_LIST object=.scorpion_mcgill.ground.MAR_1 ! marker attributes marker_name=.scorpion_mcgill.ground.MAR_1 & size_of_icons=200 color=.colors.BLUE ! ------------------------------------------------------------------- ! ! ! !! undo end ! ! ! ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! CREATE PLANE !! undo begin marker create marker=.scorpion_mcgill.ground.MARKER_2 & location=(-3*(eval(hip_block_x))), 0.0, (-3*(eval(hip_block_x))) & orientation=180.0, 90.0, 180.0 geometry create shape plane & plane_name=.scorpion_mcgill.ground.PLANE_1 & x_minimum= (0.0mm) y_minimum = (-10*(eval(hip_block_x))) & x_maximum= (5*(eval(hip_block_x))) y_maximum = (0.0mm) & ref_marker_name=.scorpion_mcgill.ground.MARKER_2 group modify group=SELECT_LIST object=.scorpion_mcgill.ground !! undo end !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! ! ! !! undo begin ! -------------------------------------------------------------------- ! Create Body ! -------------------------------------------------------------------- ! ! Create the three arrays (X,Y,Z) that will contain the ! points about which the extrusion will be made var set var=Xvalues real=({}) var set var=Yvalues real=({}) var set var=Zvalues real=({}) ! ! ! ---------------------------------------------------------- ! ! -------------------------------------------- ! Create extrusion outline points for the body ! -------------------------------------------- ! ! Set up the first point for the extrusion var modify var=Xvalues real=({0}) var modify var=Yvalues real=({ (eval(H1))+(eval(hip_block_y)) }) var modify var=Zvalues real=({0}) ! ! if condition=((eval(number_of_hip_pairs)) <= 1) !! i.e. a biped ! ! ! ...nothing in here yet... ! ! ! else !! i.e a quadruped, etc. ! ! ! ----------------------------------------------- ! Begin the FOR Loop (PORT SIDE: Most points, starting from the front) ! ----------------------------------------------- ! ! variable create variable_name=ajsint integer_value=0 ! for variable_name=loop_cntr start_value=1 end_value=(eval(number_of_hip_pairs)-1) variable modify variable_name=ajsint integer_value=(eval(loop_cntr)) ! ! var modify var=Xvalues real=( Xvalues // {-(eval(hip_block_x))/2,-(eval(hip_block_x))/2,-(eval(body_block_x))/2,-(eval(body_block_x))/2 }) var modify var=Yvalues real=( Yvalues // {(eval(H1))+(eval(hip_block_y)),(eval(H1))+(eval(hip_block_y)),(eval(H1))+(eval(hip_block_y)),(eval(H1))+(eval(hip_block_y)) }) var modify var=Zvalues real=( Zvalues // {(eval(L1)*((eval(ajsint))-1)),(eval(L1)*((eval(ajsint))-1)+(eval(hip_block_z))),(eval(L1)*((eval(ajsint))-1)+(eval(hip_block_z))),(eval(L1)*((eval(ajsint))-1)+(eval(hip_block_z))+(eval(body_block_z)))}) ! end !! end the for loop ! ! ! ----------------------------------------------- ! Add two points on the rear hip (PORT SIDE) ! ----------------------------------------------- ! ! var modify var=Xvalues real=( Xvalues // {-(eval(hip_block_x))/2,-(eval(hip_block_x))/2 }) var modify var=Yvalues real=( Yvalues // {(eval(H1))+(eval(hip_block_y)),(eval(H1))+(eval(hip_block_y)) }) var modify var=Zvalues real=( Zvalues // {(eval(L1)*((eval(number_of_hip_pairs))-1)),(eval(L1)*((eval(number_of_hip_pairs))-1)+(eval(hip_block_z))) }) ! ! ! ! ----------------------------------------------- ! Begin the FOR Loop (STARBOARD SIDE: Most points, starting from the rear) ! ----------------------------------------------- ! ! for variable_name=loop_cntr & start_value=(eval(number_of_hip_pairs)-1) & increment_value=-1 & end_value=1 variable modify variable_name=ajsint integer_value=(eval(loop_cntr)) ! ! var modify var=Xvalues real=( Xvalues // {(eval(hip_block_x))/2,(eval(hip_block_x))/2,(eval(body_block_x))/2,(eval(body_block_x))/2 }) var modify var=Yvalues real=( Yvalues // {(eval(H1))+(eval(hip_block_y)),(eval(H1))+(eval(hip_block_y)),(eval(H1))+(eval(hip_block_y)),(eval(H1))+(eval(hip_block_y)) }) var modify var=Zvalues real=( Zvalues // {(eval(ajsint))*(eval(hip_block_z)) + (eval(L1)) + ((eval(ajsint))-1)*(eval(body_block_z)),(eval(ajsint))*(eval(hip_block_z)) + (eval(L1)) + ((eval(ajsint))-1)*(eval(body_block_z))-(eval(hip_block_z)),(eval(ajsint))*(eval(hip_block_z)) + (eval(L1)) + ((eval(ajsint))-1)*(eval(body_block_z))-(eval(hip_block_z)),(eval(L1)*((eval(ajsint))-1)+(eval(hip_block_z))) }) ! end !! end the for loop ! ! ! ! ! ! ----------------------------------------------- ! Add two points on the front hip (STARBOARD SIDE) ! ----------------------------------------------- ! ! var modify var=Xvalues real=( Xvalues // {(eval(hip_block_x))/2,(eval(hip_block_x))/2}) var modify var=Yvalues real=( Yvalues // {(eval(H1))+(eval(hip_block_y)),(eval(H1))+(eval(hip_block_y))}) var modify var=Zvalues real=( Zvalues // {(eval(hip_block_z)),(eval(0))}) ! ! end !! end the if statement ! var del var=ajsint ! ----------------------------------------- ! Create the body part ! ----------------------------------------- part create rigid_body name_and_position & part_name = .scorpion_mcgill.BODY & ground_part = no & orientation = 0.0, 0.0, 0.0 ! ----------------------------------------- ! Create the polyline describing the top surface of the body ! ----------------------------------------- geometry create curve polyline & polyline_name = .scorpion_mcgill.BODY.POL2 & location = ({.scorpion_mcgill.Xvalues, .scorpion_mcgill.Yvalues, .scorpion_mcgill.Zvalues}) & relative_to = .scorpion_mcgill & close = yes marker create & marker_name = .scorpion_mcgill.BODY.MAR & orientation = 0.0, 90.0d, 0.0 ! ----------------------------------------- ! Extrude the polyline into the body ! ----------------------------------------- geometry create shape extrusion & extrusion_name = .scorpion_mcgill.BODY.EXT & reference_marker = .scorpion_mcgill.BODY.MAR & profile_curve = .scorpion_mcgill.BODY.POL2 & length_along_z_axis = (eval(body_height_extrude)) ! ----------------------------------------- ! Add Center of Mass marker, Mass and Inertia ! ----------------------------------------- marker create & marker_name = .scorpion_mcgill.BODY.cm & location = ({0,(eval(H1))+(eval(hip_block_y))/2,((eval(number_of_hip_pairs))*(hip_block_z)+((eval(number_of_hip_pairs))-1)*(body_block_z))/2}) & orientation = 0.0, 0.0, 0.0 part modify rigid mass_properties & part_name = .scorpion_mcgill.BODY & mass = (eval(body_mass)) & center_of_mass_marker = .scorpion_mcgill.BODY.cm & ixx = (eval(body_inertia_ixx)) & iyy = (eval(body_inertia_iyy)) & izz = (eval(body_inertia_izz)) & ! ! ! ! -------------------------------------------------------------------- ! ! Create Thoracic (hip) actuator housings ! ! ------------------------------------------------------------------- ! ! ---------------------- ! CREATE four Thoracic (hip) actuators (Port side) ! ---------------------- ! variable create variable_name=ajsint10 integer_value=0 ! ! Begin the FOR Loop ! for variable_name=tempreal start_value=1 end_value=(eval(number_of_hip_pairs)) variable modify variable_name=ajsint10 integer_value=(eval(tempreal)) ! !---create temporary name string variable var set var=tmpnam string=(eval("thoracic_actuator_housing_"//ajsint10)) ! ! ! ! Part pose (location and orientation); relative to ground marker. ! part create rigid_body name_and_position part_name=(eval(tmpnam)) & location=(LOC_RELATIVE_TO({-(eval(hip_block_x))/2-(eval(actuator_radius)),H1,(L1*((eval(ajsint10))-1))}, .scorpion_mcgill.ground.MAR_1)) & orientation=(ORI_RELATIVE_TO({0d,0d,0d}, .scorpion_mcgill.ground.MAR_1)) part modify rigid_body mass_properties part_name=(eval(tmpnam)) & material=.materials.steel part attributes part_name=(eval(tmpnam)) color=RED name_vis=off defaults model part_name=(eval(tmpnam)) ! ! Marker definition (for defining pose of the object) ! marker create marker=thoracic_actuator_marker & location = 0,(eval(hip_block_y)/2-eval(actuator_length)/2),(eval(hip_block_z)/2) & orientation = 0d,-90d,0d & relative_to= (eval(tmpnam)) marker attributes marker_name=thoracic_actuator_marker & size_of_icons=80 color=BLUE & visibility=no_opinion name_visibility=no_opinion ! ! Marker definition (for calculation of rotation wrt body) ! marker create marker=thoracic_actuator_angle_marker & location = 0,(eval(hip_block_y)/2-eval(actuator_length)/2),(eval(hip_block_z)/2) & orientation = 0d,0d,0d & relative_to= .scorpion_mcgill.ground.mar_1 marker attributes marker_name=thoracic_actuator_angle_marker & size_of_icons=80 color=GREEN & visibility=no_opinion name_visibility=no_opinion ! ! Insert object (cylinder) ! geometry create shape cylinder & cylinder_name=thoracic_actuator_cylinder & radius= (eval(actuator_radius)) & center_marker=thoracic_actuator_marker & length= (eval(actuator_length)) ! end ! end of the FOR loop !---delete temporary name string variable var del var=tmpnam ! ! !! ---------------------- ! CREATE four hip actuators (Starboard side) ! ---------------------- ! variable create variable_name=ajsint11 integer_value=0 ! ! Begin the FOR Loop ! for variable_name=tempreal start_value=1 end_value=(eval(number_of_hip_pairs)) variable modify variable_name=ajsint11 integer_value=((eval(tempreal))+(eval(number_of_hip_pairs))) ! !---create temporary name string variable var set var=tmpnam string=(eval("thoracic_actuator_housing_"//ajsint11)) ! ! ! ! Part pose (location and orientation); relative to ground marker. ! part create rigid_body name_and_position part_name=(eval(tmpnam)) & location=(LOC_RELATIVE_TO({(eval(hip_block_x))/2+(eval(actuator_radius)), H1,(L1*((eval(ajsint11))-1-eval(number_of_hip_pairs)))},.scorpion_mcgill.ground.MAR_1)) & orientation=(ORI_RELATIVE_TO({0d,0d,0d}, .scorpion_mcgill.ground.MAR_1)) part modify rigid_body mass_properties part_name=(eval(tmpnam)) & material=.materials.steel part attributes part_name=(eval(tmpnam)) color=RED name_vis=off defaults model part_name=(eval(tmpnam)) ! ! Marker definition (for defining pose of the cylinder) ! marker create marker=thoracic_actuator_marker & location = 0,(eval(hip_block_y)/2-eval(actuator_length)/2),(eval(hip_block_z)/2) & orientation = 0d,-90d,0d & relative_to= (eval(tmpnam)) marker attributes marker_name=thoracic_actuator_marker & size_of_icons=80 color=BLUE & visibility=no_opinion name_visibility=no_opinion ! ! Marker definition (for determining angle wrt thoracic cylinder) ! marker create marker=thoracic_actuator_angle_marker & location = 0,(eval(hip_block_y)/2-eval(actuator_length)/2),(eval(hip_block_z)/2) & orientation = 0d,0d,0d & relative_to= .scorpion_mcgill.ground.mar_1 marker attributes marker_name=thoracic_actuator_angle_marker & size_of_icons=80 color=BLUE & visibility=no_opinion name_visibility=no_opinion ! ! Insert object (cylinder) ! geometry create shape cylinder & cylinder_name=thoracic_actuator_cylinder & radius= (eval(actuator_radius)) & center_marker=thoracic_actuator_marker & length= (eval(actuator_length)) ! end ! end of the FOR loop !---delete temporary name string variable var del var=tmpnam ! ! ! ! ! -------------------------------------------------------------------- ! ! Create Basalar (knee) actuator housings ! ! ------------------------------------------------------------------- ! ! ---------------------- ! CREATE Basalar (knee) actuators (Port side) ! ---------------------- ! variable create variable_name=ajsint12 integer_value=0 ! ! Begin the FOR Loop ! for variable_name=tempreal start_value=1 end_value=(eval(number_of_hip_pairs)) variable modify variable_name=ajsint12 integer_value=(eval(tempreal)) ! !---create temporary name string variable var set var=tmpnam string=(eval("basalar_actuator_housing_"//ajsint12)) ! ! ! ! Part pose (location and orientation); relative to ground marker. ! part create rigid_body name_and_position part_name=(eval(tmpnam)) & location=(LOC_RELATIVE_TO({(-(eval(hip_block_x))/2-(eval(actuator_radius))*1),H1-(eval(actuator_radius)),(L1*((eval(ajsint12))-1)-(eval(actuator_length))/2)}, .scorpion_mcgill.ground.MAR_1)) & orientation=(ORI_RELATIVE_TO({0d,0d,0d}, .scorpion_mcgill.ground.MAR_1)) part modify rigid_body mass_properties part_name=(eval(tmpnam)) & material=.materials.steel part attributes part_name=(eval(tmpnam)) color=RED name_vis=off defaults model part_name=(eval(tmpnam)) ! ! Marker definition (for definition of the cylinder) ! marker create marker=basalar_actuator_marker & location = 0,(eval(hip_block_y)/2-eval(actuator_length)/2),(eval(hip_block_z)/2) & orientation = 0d,0d,0d & relative_to= (eval(tmpnam)) marker attributes marker_name=basalar_actuator_marker & size_of_icons=80 color=BLUE & visibility=no_opinion name_visibility=no_opinion ! ! ! Marker definition (for defining angle of the actuator) ! marker create marker=basalar_actuator_angle_marker & location = 0,(eval(hip_block_y)/2-eval(actuator_length)/2),(eval(hip_block_z)/2) & orientation = 0d,0d,0d & relative_to= .scorpion_mcgill.ground.mar_1 marker attributes marker_name=basalar_actuator_angle_marker & size_of_icons=80 color=WHITE & visibility=no_opinion name_visibility=no_opinion ! ! Insert object (cylinder) ! geometry create shape cylinder & cylinder_name=basalar_actuator_cylinder & radius= (eval(actuator_radius)) & center_marker=basalar_actuator_marker & length= (eval(actuator_length)) ! end ! end of the FOR loop !---delete temporary name string variable var del var=tmpnam ! ! !! ---------------------- ! CREATE Basalar (knee) actuators (Starboard side) ! ---------------------- ! variable create variable_name=ajsint13 integer_value=0 ! ! Begin the FOR Loop ! for variable_name=tempreal start_value=1 end_value=(eval(number_of_hip_pairs)) variable modify variable_name=ajsint13 integer_value=((eval(tempreal))+(eval(number_of_hip_pairs))) ! !---create temporary name string variable var set var=tmpnam string=(eval("basalar_actuator_housing_"//ajsint13)) ! ! ! ! Part pose (location and orientation); relative to ground marker. ! part create rigid_body name_and_position part_name=(eval(tmpnam)) & location=(LOC_RELATIVE_TO({((eval(hip_block_x))/2+(eval(actuator_radius))*1), H1-(eval(actuator_radius)),(L1*((eval(ajsint13))-1-eval(number_of_hip_pairs))-(eval(actuator_length))/2)},.scorpion_mcgill.ground.MAR_1)) & orientation=(ORI_RELATIVE_TO({0d,0d,0d}, .scorpion_mcgill.ground.MAR_1)) part modify rigid_body mass_properties part_name=(eval(tmpnam)) & material=.materials.steel part attributes part_name=(eval(tmpnam)) color=RED name_vis=off defaults model part_name=(eval(tmpnam)) ! ! Marker definition (for definition of the cylinder) ! marker create marker=basalar_actuator_marker & location = 0,(eval(hip_block_y)/2-eval(actuator_length)/2),(eval(hip_block_z)/2) & orientation = 0d,0d,0d & relative_to= (eval(tmpnam)) marker attributes marker_name=basalar_actuator_marker & size_of_icons=80 color=BLUE & visibility=no_opinion name_visibility=no_opinion ! ! ! Marker definition (for calculation of the angle) ! marker create marker=basalar_actuator_angle_marker & location = 0,(eval(hip_block_y)/2-eval(actuator_length)/2),(eval(hip_block_z)/2) & orientation = 0d,0d,0d & relative_to= .scorpion_mcgill.ground.mar_1 marker attributes marker_name=basalar_actuator_angle_marker & size_of_icons=80 color=WHITE & visibility=no_opinion name_visibility=no_opinion ! ! Insert object (cylinder) ! geometry create shape cylinder & cylinder_name=basalar_actuator_cylinder & radius= (eval(actuator_radius)) & center_marker=basalar_actuator_marker & length= (eval(actuator_length)) ! end ! end of the FOR loop !---delete temporary name string variable var del var=tmpnam var del var=ajsint13 ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ---------------------- ! CREATE Revolute Joints between Thoracic Actuator and Torso (BODY) Parts ! ---------------------- ! variable create variable_name=temp_int integer_value=0 ! ! Begin the FOR Loop ! for variable_name=tempreal start_value=1 end_value=(eval(number_of_hip_pairs)) variable modify variable_name=temp_int integer_value=(eval(tempreal)) ! !---create three temporary name string variables ! (Body, thoracic cylinder, and thoracic joint name) var set var=tmp1 string=(eval("BODY")) var set var=tmp2 string=(eval("thoracic_actuator_housing_"// (eval(temp_int)))) !! Port Side var set var=tmp3 string=(eval("thoracic_joint_"// (eval(temp_int)))) !! Port Side var set var=tmp4 string=(eval("thoracic_actuator_housing_"//(eval(eval(temp_int) +(eval(number_of_hip_pairs))))))!! Starboard Side var set var=tmp5 string=(eval("thoracic_joint_"//(eval(eval(temp_int)+(eval(number_of_hip_pairs)))))) !! Starboard Side var set var=tmp7 string=(eval("thoracic_rev_motion_"//(eval(temp_int)))) !! Port Side var set var=tmp8 string=(eval("thoracic_rev_motion_"//(eval(temp_int)+eval(number_of_hip_pairs)))) !! Starboard Side ! ! ! ! -------------------------------- PORT SIDE Revolute Joint ----------------------------------------------------- ! ! ! Create first marker. Make it a child of the body component @ the CoM of the Thoracic Joint. ! marker create marker=(eval(".scorpion_mcgill." // (eval(tmp1)) // ".THORACIC_JOINT_MARKER_BODYPART_" // (eval(temp_int)))) & location=(LOC_RELATIVE_TO({0,0,0},(eval(".scorpion_mcgill."// (eval(tmp2)) //".cm")))) & orientation=(ORI_RELATIVE_TO({0d,90d,0d}, (eval(".scorpion_mcgill."// (eval(tmp2)) //".cm")))) marker attributes marker_name=(eval(".scorpion_mcgill." // (eval(tmp1)) // ".THORACIC_JOINT_MARKER_BODYPART_" // (eval(temp_int)))) & size_of_icons=80 color=BLUE & visibility=on name_visibility=off ! ! Create Second marker. Make it a child of the thoracic actuator component and locate it at the ! Center of Mass of the Thoracic Joint. ! marker create marker=(eval(".scorpion_mcgill." // (eval(tmp2)) // ".THORACIC_JOINT_MARKER_THORACICPART_"//(eval(temp_int)) )) & location=(LOC_RELATIVE_TO({0,0,0},(eval(".scorpion_mcgill."// (eval(tmp2)) //".cm")))) & orientation=(ORI_RELATIVE_TO({0d,90d,0d}, (eval(".scorpion_mcgill."// (eval(tmp2)) //".cm")))) marker attributes marker_name=(eval(".scorpion_mcgill." // (eval(tmp2)) // ".THORACIC_JOINT_MARKER_THORACICPART_"//(eval(temp_int)) )) & size_of_icons=80 color=BLUE & visibility=on name_visibility=off ! ! Describe the constraint ! constraint create joint Revolute & joint_name=(eval(".scorpion_mcgill." // (eval(tmp3)))) & i_marker_name= (eval(".scorpion_mcgill." // (eval(tmp1)) // ".THORACIC_JOINT_MARKER_BODYPART_" // (eval(temp_int)))) & j_marker_name=(eval(".scorpion_mcgill." // (eval(tmp2)) // ".THORACIC_JOINT_MARKER_THORACICPART_"// (eval(temp_int)))) constraint attribute constraint_name=(eval(".scorpion_mcgill." // (eval(tmp3)))) name_vis=off scale_of_icons=0.5 ! ! Group Modify ! group modify group=SELECT_LIST object=(eval(".scorpion_mcgill." // (eval(tmp3)))) ! ! ! CREATE Thoracic ROTATIONAL MOTION ! ! Alternate between even and odd pairs, so that legs are out of phase. ! if condition=(eval((mod(eval(temp_int),2)))==1) !! Leg is on an odd hip pair, (test using Modulo) constraint create motion motion_name=(eval(".scorpion_mcgill." // (eval(tmp7)))) & joint=(eval(".scorpion_mcgill." // (eval(tmp3)))) & type=rotational & time_derivative=displacement & function="akispl(time,0,thoracic_position_spline_phase1,0)" !! Phase 1 constraint attributes constraint_name=(eval(".scorpion_mcgill." // (eval(tmp7)))) name_vis=off group modify group=SELECT_LIST object=(eval(".scorpion_mcgill." // (eval(tmp7)))) else !! Leg is on an even hip pair constraint create motion motion_name=(eval(".scorpion_mcgill." // (eval(tmp7)))) & joint=(eval(".scorpion_mcgill." // (eval(tmp3)))) & type=rotational & time_derivative=displacement & function="akispl(time,0,thoracic_position_spline_phase2,0)" !! Phase 2 constraint attributes constraint_name=(eval(".scorpion_mcgill." // (eval(tmp7)))) name_vis=off group modify group=SELECT_LIST object=(eval(".scorpion_mcgill." // (eval(tmp7)))) end ! ! ! ! ! -------------------------------- STARBOARD SIDE Revolute Joint ----------------------------------------------------- ! ! ! Create first marker. Make it a child of the body component @ the CoM of the Thoracic Joint. ! marker create marker=(eval(".scorpion_mcgill." // (eval(tmp1)) // ".THORACIC_JOINT_MARKER_BODYPART_" // (eval(temp_int)) +(eval(number_of_hip_pairs)))) & location=(LOC_RELATIVE_TO({0,0,0},(eval(".scorpion_mcgill."// (eval(tmp4)) //".cm")))) & orientation=(ORI_RELATIVE_TO({0d,90d,0d}, (eval(".scorpion_mcgill."// (eval(tmp4)) //".cm")))) marker attributes marker_name=(eval(".scorpion_mcgill." // (eval(tmp1)) // ".THORACIC_JOINT_MARKER_BODYPART_" // (eval(temp_int)) +(eval(number_of_hip_pairs)))) & size_of_icons=80 color=BLUE & visibility=on name_visibility=off ! ! Create Second marker. Make it a child of the thoracic actuator component and locate it at the ! Center of Mass of the Thoracic Joint. ! marker create marker=(eval(".scorpion_mcgill." // (eval(tmp4)) // ".THORACIC_JOINT_MARKER_THORACICPART_" // (eval(temp_int)) +(eval(number_of_hip_pairs)) )) & location=(LOC_RELATIVE_TO({0,0,0},(eval(".scorpion_mcgill."// (eval(tmp4)) //".cm")))) & orientation=(ORI_RELATIVE_TO({0d,90d,0d}, (eval(".scorpion_mcgill."// (eval(tmp4)) //".cm")))) marker attributes marker_name=(eval(".scorpion_mcgill." // (eval(tmp4)) // ".THORACIC_JOINT_MARKER_THORACICPART_" // (eval(temp_int)) +(eval(number_of_hip_pairs)) )) & size_of_icons=80 color=BLUE & visibility=on name_visibility=off ! ! Describe the constraint ! constraint create joint Revolute & joint_name=(eval(".scorpion_mcgill." // (eval(tmp5)) )) & i_marker_name= (eval(".scorpion_mcgill." // (eval(tmp1)) // ".THORACIC_JOINT_MARKER_BODYPART_" // (eval(temp_int)) +(eval(number_of_hip_pairs)) )) & j_marker_name=(eval(".scorpion_mcgill." // (eval(tmp4)) // ".THORACIC_JOINT_MARKER_THORACICPART_" // (eval(temp_int)) +(eval(number_of_hip_pairs)) )) constraint attribute constraint_name=(eval(".scorpion_mcgill." // (eval(tmp5)))) name_vis=off scale_of_icons=0.5 ! ! Group Modify ! group modify group=SELECT_LIST object=(eval(".scorpion_mcgill." // (eval(tmp5)))) ! ! ! CREATE Thoracic ROTATIONAL MOTION ! ! Alternate between even and odd pairs, so that legs are out of phase. ! if condition=(eval((mod(eval(temp_int),2)))==1) !! Leg is on an odd hip pair, (test using Modulo) constraint create motion motion_name=(eval(".scorpion_mcgill." // (eval(tmp8)))) & joint=(eval(".scorpion_mcgill." // (eval(tmp5)))) & type=rotational & time_derivative=displacement & function="-1*akispl(time,0,thoracic_position_spline_phase2,0)" !! Phase 2 constraint attributes constraint_name=(eval(".scorpion_mcgill." // (eval(tmp8)))) name_vis=off group modify group=SELECT_LIST object=(eval(".scorpion_mcgill." // (eval(tmp8)))) else !! Leg is on an even hip pair constraint create motion motion_name=(eval(".scorpion_mcgill." // (eval(tmp8)))) & joint=(eval(".scorpion_mcgill." // (eval(tmp5)))) & type=rotational & time_derivative=displacement & function="-1*akispl(time,0,thoracic_position_spline_phase1,0)" !! Phase 1 constraint attributes constraint_name=(eval(".scorpion_mcgill." // (eval(tmp8)))) name_vis=off group modify group=SELECT_LIST object=(eval(".scorpion_mcgill." // (eval(tmp8)))) end ! ! ! ! ! ! end ! end of the FOR loop !---delete temporary name string variables var del var=tmp1 var del var=tmp2 var del var=tmp3 var del var=tmp4 var del var=tmp5 var del var=tmp7 var del var=tmp8 var del var=temp_int ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ---------------------- ! CREATE Revolute Joints between Basalar Actuator and Thoracic Acutator ! ---------------------- ! variable create variable_name=temp_int integer_value=0 ! ! Begin the FOR Loop ! for variable_name=tempreal start_value=1 end_value=(eval(number_of_hip_pairs)) variable modify variable_name=temp_int integer_value=(eval(tempreal)) ! !---create three temporary name string variables ! (thoracic and basalar actuator housings and basalar joint name) var set var=tmp1 string=(eval("thoracic_actuator_housing_"//temp_int)) !! Port Side var set var=tmp2 string=(eval("basalar_actuator_housing_"//temp_int)) !! Port Side var set var=tmp3 string=(eval("basalar_joint_"//temp_int)) !! Port Side var set var=tmp4 string=(eval("thoracic_actuator_housing_"//(eval(temp_int)+eval(number_of_hip_pairs)) )) !! Starboard Side var set var=tmp5 string=(eval("basalar_actuator_housing_"//(eval(temp_int)+eval(number_of_hip_pairs)) )) !! Starboard Side var set var=tmp6 string=(eval("basalar_joint_"// (eval(temp_int)+eval(number_of_hip_pairs)) )) !! Starboard Side var set var=tmp7 string=(eval("basalar_rev_motion_"//(eval(temp_int)))) !! Port Side var set var=tmp8 string=(eval("basalar_rev_motion_"//(eval(temp_int)+eval(number_of_hip_pairs)))) !! Starboard Side ! ! ! ! -------------------------------- PORT SIDE Revolute Joint ----------------------------------------------------- ! ! Create first marker. Make it a child of the THORACIC actuator cylinder component. ! marker create marker=(eval(".scorpion_mcgill." // (eval(tmp1)) //".BASALAR_JOINT_MARKER_1")) & location=(LOC_RELATIVE_TO({0,0,-(eval(actuator_radius))},(eval(tmp1 // ".thoracic_actuator_marker")) )) & !! rel. to Thor. marker. orientation=(ORI_RELATIVE_TO({0d,90d,0d},(eval(tmp1 // ".thoracic_actuator_marker")) )) !! rel. to Thor. marker. ! ! Create Second marker. Make it a child of the BASALAR actuator cylinder component. ! marker create marker=(eval(".scorpion_mcgill." // (eval(tmp2)) // ".BASALAR_JOINT_MARKER_2")) & location=(LOC_RELATIVE_TO({0,0,-(eval(actuator_radius))},(eval(tmp1 // ".thoracic_actuator_marker")) )) & !! rel. to Thor. marker. orientation=(ORI_RELATIVE_TO({0d,90d,0d},(eval(tmp1 // ".thoracic_actuator_marker")) )) !! rel. to Thor. marker. ! ! Describe the constraint ! constraint create joint Revolute & joint_name=(eval(".scorpion_mcgill." // (eval(tmp3)))) & i_marker_name=(eval(".scorpion_mcgill." // (eval(tmp1)) // ".BASALAR_JOINT_MARKER_1")) & j_marker_name=(eval(".scorpion_mcgill." // (eval(tmp2)) // ".BASALAR_JOINT_MARKER_2")) constraint attribute constraint_name=(eval(".scorpion_mcgill." // (eval(tmp3)))) name_vis=off scale_of_icons=0.5 ! ! Group Modify ! group modify group=SELECT_LIST object=(eval(".scorpion_mcgill." // (eval(tmp3)))) ! ! ! ! ! ! CREATE Basalar ROTATIONAL MOTION ! ! Alternate between even and odd pairs, so that legs are out of phase. ! if condition=(eval((mod(eval(temp_int),2)))==1) !! Leg is on an odd hip pair, (test using Modulo) constraint create motion motion_name=(eval(".scorpion_mcgill." // (eval(tmp7)))) & joint=(eval(".scorpion_mcgill." // (eval(tmp3)))) & type=rotational & time_derivative=displacement & function="akispl(time,0,basalar_position_spline_phase1,0)" !! Phase 1 constraint attributes constraint_name=(eval(".scorpion_mcgill." // (eval(tmp7)))) name_vis=off group modify group=SELECT_LIST object=(eval(".scorpion_mcgill." // (eval(tmp7)))) else !! Leg is on an even hip pair constraint create motion motion_name=(eval(".scorpion_mcgill." // (eval(tmp7)))) & joint=(eval(".scorpion_mcgill." // (eval(tmp3)))) & type=rotational & time_derivative=displacement & function="akispl(time,0,basalar_position_spline_phase2,0)" !! Phase 2 constraint attributes constraint_name=(eval(".scorpion_mcgill." // (eval(tmp7)))) name_vis=off group modify group=SELECT_LIST object=(eval(".scorpion_mcgill." // (eval(tmp7)))) end ! ! ! ! ! ! ! -------------------------------- STARBOARD SIDE Revolute Joint ----------------------------------------------------- ! ! Create first marker. Make it a child of the THORACIC actuator cylinder component. ! marker create marker=(eval(".scorpion_mcgill." // (eval(tmp4)) //".BASALAR_JOINT_MARKER_1")) & location=(LOC_RELATIVE_TO({0,0,-(eval(actuator_radius))},(eval(tmp4 // ".thoracic_actuator_marker")) )) & !! rel. to Thor. marker. orientation=(ORI_RELATIVE_TO({0d,90d,0d},(eval(tmp4 // ".thoracic_actuator_marker")) )) !! rel. to Thor. marker. ! ! Create Second marker. Make it a child of the BASALAR actuator cylinder component. ! marker create marker=(eval(".scorpion_mcgill." // (eval(tmp5)) // ".BASALAR_JOINT_MARKER_2")) & location=(LOC_RELATIVE_TO({0,0,-(eval(actuator_radius))},(eval(tmp4 // ".thoracic_actuator_marker")) )) & !! rel. to Thor. marker. orientation=(ORI_RELATIVE_TO({0d,90d,0d},(eval(tmp4 // ".thoracic_actuator_marker")))) !! rel. to Thor. marker. ! ! Describe the constraint ! constraint create joint Revolute & joint_name=(eval(".scorpion_mcgill." // (eval(tmp6)))) & i_marker_name=(eval(".scorpion_mcgill." // (eval(tmp4)) // ".BASALAR_JOINT_MARKER_1")) & j_marker_name=(eval(".scorpion_mcgill." // (eval(tmp5)) // ".BASALAR_JOINT_MARKER_2")) constraint attribute constraint_name=(eval(".scorpion_mcgill." // (eval(tmp6)))) name_vis=off scale_of_icons=0.5 ! ! Group Modify ! group modify group=SELECT_LIST object=(eval(".scorpion_mcgill." // (eval(tmp6)))) ! ! ! ! CREATE Basalar ROTATIONAL MOTION ! !! constraint create motion motion_name=(eval(".scorpion_mcgill." // (eval(tmp8)))) & !! joint=(eval(".scorpion_mcgill." // (eval(tmp6)))) & !! type=rotational & !! time_derivative=displacement & !! function="akispl(time,0,basalar_position_spline_phase1,0)" !! constraint attributes constraint_name=(eval(".scorpion_mcgill." // (eval(tmp8)))) name_vis=off !! group modify group=SELECT_LIST object=(eval(".scorpion_mcgill." // (eval(tmp8)))) ! ! ! ! CREATE Basalar ROTATIONAL MOTION ! ! Alternate between even and odd pairs, so that legs are out of phase. ! if condition=(eval((mod(eval(temp_int),2)))==1) !! Leg is on an odd hip pair, (test using Modulo) constraint create motion motion_name=(eval(".scorpion_mcgill." // (eval(tmp8)))) & joint=(eval(".scorpion_mcgill." // (eval(tmp6)))) & type=rotational & time_derivative=displacement & function="-1*akispl(time,0,basalar_position_spline_phase2,0)" !! Phase 2 (Opposite of Port leg) constraint attributes constraint_name=(eval(".scorpion_mcgill." // (eval(tmp8)))) name_vis=off group modify group=SELECT_LIST object=(eval(".scorpion_mcgill." // (eval(tmp8)))) else !! Leg is on an even hip pair constraint create motion motion_name=(eval(".scorpion_mcgill." // (eval(tmp8)))) & joint=(eval(".scorpion_mcgill." // (eval(tmp6)))) & type=rotational & time_derivative=displacement & function="-1*akispl(time,0,basalar_position_spline_phase1,0)" !! Phase 1 (Opposite of Starboard Leg) constraint attributes constraint_name=(eval(".scorpion_mcgill." // (eval(tmp8)))) name_vis=off group modify group=SELECT_LIST object=(eval(".scorpion_mcgill." // (eval(tmp8)))) end ! ! ! end ! end of the FOR loop !---delete temporary name string variables var del var=tmp1 var del var=tmp2 var del var=tmp3 var del var=tmp4 var del var=tmp5 var del var=tmp6 var del var=tmp7 var del var=tmp8 var del var=temp_int ! ! ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! -------------------------------------------------------------------- ! ! Create Basalar (knee) links ! ! ------------------------------------------------------------------- ! ! ---------------------- ! CREATE Basalar (knee) links ! ---------------------- ! variable create variable_name=temp_int integer_value=0 ! ! Begin the FOR Loop ! for variable_name=tempreal start_value=1 end_value=(eval(number_of_hip_pairs)) variable modify variable_name=temp_int integer_value=(eval(tempreal)) ! !---create temporary name string variable var set var=tmp string=(eval("basalar_link_"//temp_int)) !! Port Side var set var=tmp2 string=(eval("basalar_slide_link_"//temp_int)) !! Port Side var set var=tmp3 string=(eval("basalar_toe_"//temp_int)) !! Port Side var set var=tmp4 string=(eval("contact_"//temp_int)) !! Port Side var set var=tmp5 string=(eval("GCONTACT_"//temp_int)) !! Port Side var set var=tmp6 string=(eval("basalar_actuator_housing_"//temp_int)) !! Port Side var set var=tmp7 string=(eval("basalar_link_"// (eval(temp_int))+(eval(number_of_hip_pairs)))) !! Starboard Side var set var=tmp8 string=(eval("basalar_slide_link_"//(eval(temp_int))+(eval(number_of_hip_pairs)))) !! Starboard Side var set var=tmp9 string=(eval("basalar_toe_"//(eval(temp_int))+(eval(number_of_hip_pairs)))) !! Starboard Side var set var=tmp10 string=(eval("contact_"//(eval(temp_int))+(eval(number_of_hip_pairs)))) !! Starboard Side var set var=tmp11 string=(eval("GCONTACT_"//(eval(temp_int))+(eval(number_of_hip_pairs)))) !! Starboard Side var set var=tmp12 string=(eval("basalar_actuator_housing_"//(eval(temp_int))+(eval(number_of_hip_pairs)))) !! Starboard Side ! ! ! ! ! -------------------------------- PORT SIDE Basalar Cylindrical Link, Slider and Toe --------------------------------- ! ! ! Part pose (location and orientation); relative to ground marker. ! ! Create the first part, the leg link part create rigid_body name_and_position part_name=(eval(tmp)) & location=(LOC_RELATIVE_TO({0,0,0},(eval(tmp6 // ".cm")))) & !! Relative to Basalar Actuator Housing CoM. orientation=(ORI_RELATIVE_TO({-90d,0d,0d}, (eval(tmp6 // ".cm")))) !! Relative to Basalar Actuator Housing CoM. [July 5, 2002] part modify rigid_body mass_properties part_name=(eval(tmp)) & material=.materials.steel part attributes part_name=(eval(tmp)) color=GREEN name_vis=off defaults model part_name=(eval(tmp)) ! ! ! Marker definition (for definition of the cylinder) ! marker create marker=basalar_link_marker & location = 0,0,0 & orientation = 0d,90d,0d & relative_to= (eval(tmp)) marker attributes marker_name=basalar_link_marker & size_of_icons=80 color=GREEN & visibility=no_opinion name_visibility=no_opinion ! ! Insert object (main cylinder) ! geometry create shape cylinder & cylinder_name=basalar_link_cylinder & radius= (eval(link_radius)) & center_marker=basalar_link_marker & length= (eval(link_length)) ! ! ------------ ! ! Insert object (thinner sliding cylinder) ! ! ------------ ! ! Create the second part, the sliding leg end. part create rigid_body name_and_position part_name=(eval(tmp2)) & location=(LOC_RELATIVE_TO({0,-(eval(link_length))/2,0},(eval((eval(tmp) // ".cm"))))) & !! relative to the larger cylinder's CoM. [July 5, 2002] orientation=(ORI_RELATIVE_TO({90d,0d,0d}, (eval((eval(tmp) // ".cm"))))) !! relative to the larger cylinder's CoM. [July 5, 2002] part modify rigid_body mass_properties part_name=(eval(tmp2)) & material=.materials.steel part attributes part_name=(eval(tmp2)) color=BLUE name_vis=off defaults model part_name=(eval(tmp2)) ! ! ! Marker definition (for def'n of the sliding cylinder) ! marker create marker=basalar_slide_link_marker & location = 0,0,0 & orientation = 0d,90d,0d & relative_to= (eval(tmp2)) marker attributes marker_name=basalar_slide_link_marker & size_of_icons=80 color=BLUE & visibility=no_opinion name_visibility=no_opinion ! ! geometry create shape cylinder & cylinder_name=basalar_slide_link_cylinder & radius= (eval(slide_link_radius)) & center_marker=basalar_slide_link_marker & length= (eval(slide_link_length)) ! ! ! ------------ ! ! Insert object (Toe at end of the basalar link: basalar_toe) ! ! ------------ ! ! Create the toe at the end of the basalar link part create rigid_body name_and_position part_name=(eval(tmp3)) & location=(LOC_RELATIVE_TO({0,-(eval(slide_link_length)),0}, (eval(tmp2)))) & orientation=(ORI_RELATIVE_TO({0d,0d,0d}, (eval(tmp2)) )) part modify rigid_body mass_properties part_name=(eval(tmp3)) & material=.materials.steel part attributes part_name=(eval(tmp3)) color=BLUE name_vis=off defaults model part_name=(eval(tmp3)) ! ! ! Marker definition (for def'n of the toe ellipsoid) ! marker create marker=(eval(".scorpion_mcgill." // (eval(tmp3)) // ".center_marker")) & location= (LOC_RELATIVE_TO({0,-(eval(slide_link_length)),0}, (eval(tmp2)))) & orientation= 0d,0d,0d geometry create shape ellipsoid & ellipsoid_name=(eval(".scorpion_mcgill." // (eval(tmp3)) // ".ellipsoid")) & x_scale_factor=(2*eval(toe_radius)) & y_scale_factor=(2*eval(toe_radius)) & z_scale_factor=(2*eval(toe_radius)) & center_marker=(eval(".scorpion_mcgill." // (eval(tmp3)) // ".center_marker")) group modify group=SELECT_LIST object=(eval(tmp3)) ! ! ! ! ! MERGE the larger link and the basalar actuator. ! part merge rigid_body part_name=(eval(tmp)) into_part=(eval(tmp6)) ! ! ! ------------ ! ! Create fixed (locked) joint between the basalar slider and the toe ! ! I would like to use a MERGE between these parts due to the large forces that ! will occur at the fixed joint except that I need the ellipsoid for the contact forces. ! ------------ ! ! Marker on 1st object: slider ! marker create marker=(eval(".scorpion_mcgill."//(eval("basalar_slide_link_"//temp_int))//".MARKER_2")) & location=(LOC_RELATIVE_TO({0,-(eval(slide_link_length)),0}, (eval(tmp2)))) & orientation=(ORI_RELATIVE_TO({0d,0d,0d}, (eval(tmp2)) )) ! ! Marker on the 2nd object: ! marker create marker=(eval(".scorpion_mcgill."//(eval(tmp3))//".MARKER_2")) & location=(LOC_RELATIVE_TO({0,-(eval(slide_link_length)),0}, (eval(tmp2)))) & orientation=(ORI_RELATIVE_TO({0d,0d,0d}, (eval(tmp2)) )) ! ! Describe the resulting constraint (Fixed) ! constraint create joint Fixed & joint_name=(eval(".scorpion_mcgill."//(eval("basalar_toe_FIXED_JOINT_"//temp_int)))) & i_marker_name= (eval(".scorpion_mcgill."//(eval("basalar_slide_link_"//temp_int))//".MARKER_2")) & !! first marker j_marker_name= (eval(".scorpion_mcgill."//(eval(tmp3))//".MARKER_2")) !! second marker ! constraint attribute constraint_name=(eval(".scorpion_mcgill."//(eval("basalar_toe_FIXED_JOINT_"//temp_int)))) name_vis=off scale_of_icons=0.1 ! group modify group=SELECT_LIST object=(eval(".scorpion_mcgill."//(eval("basalar_toe_FIXED_JOINT_"//temp_int)))) ! ! ! ----------------------- ! ! Create contact force between the toe and the ground plane. ! ! ----------------------- ! contact create contact_name = (eval(".scorpion_mcgill."//(eval(tmp4)))) & i_geometry_name = (eval(".scorpion_mcgill."//(eval(tmp3))//".ellipsoid")) & j_geometry_name = .scorpion_mcgill.ground.PLANE_1 & i_flip_normal = "no" & & stiffness = 1.0E+005 & damping = 10.0 & exponent = 2.2 & dmax = 0.1 & & coulomb_friction = on & mu_static = 0.3 & mu_dynamic = 0.1 & stiction_transition_velocity = 0.1 & friction_transition_velocity = 1.0 geometry create shape gcontact & contact_force_name = (eval(".scorpion_mcgill."//(eval(tmp5)))) & contact_element_name = (eval(".scorpion_mcgill."//(eval(tmp4)))) & force_display = components ! ! ! ------------ ! ! Create translational joint between the two basalar cylinders ! ! ------------ ! ! Marker on 1st object: slider ! marker create marker=(eval(".scorpion_mcgill."//(eval("basalar_slide_link_"//temp_int))//".MARKER_1")) & location=(LOC_RELATIVE_TO({0,0,0}, (eval(tmp2)))) & orientation=(ORI_RELATIVE_TO({0d,90d,0d}, (eval(tmp2)) )) ! ! Marker on the 2nd object: larger cylinder ! marker create marker=(eval(".scorpion_mcgill."//(eval("basalar_actuator_housing_"//temp_int))//".MARKER_2")) & location=(LOC_RELATIVE_TO({0,0,0}, (eval(tmp2)))) & orientation=(ORI_RELATIVE_TO({0d,90d,0d}, (eval(tmp2)) )) ! ! Describe the resulting constraint (translational) ! constraint create joint Translational & joint_name=(eval(".scorpion_mcgill."//(eval("basalar_TRANS_JOINT_"//temp_int)))) & i_marker_name= (eval(".scorpion_mcgill."//(eval("basalar_slide_link_"//temp_int))//".MARKER_1")) & !! first marker j_marker_name= (eval(".scorpion_mcgill."//(eval("basalar_actuator_housing_"//temp_int))//".MARKER_2")) !! second marker ! constraint attribute constraint_name=(eval(".scorpion_mcgill."//(eval("basalar_TRANS_JOINT_"//temp_int)))) name_vis=off ! group modify group=SELECT_LIST object=(eval(".scorpion_mcgill."//(eval("basalar_TRANS_JOINT_"//temp_int)))) ! ! ------------ ! ! Create translational spring between the two cylinders ! ! ------------ ! default coordinate_system default_coordinate_system=.scorpion_mcgill marker create marker=(eval(".scorpion_mcgill."//(eval("basalar_actuator_housing_"//temp_int))//".spring_MARKER_1")) & location=(LOC_RELATIVE_TO({0,0,0}, (eval(tmp2)))) & orientation=(ORI_RELATIVE_TO({0d,0d,0d}, (eval(tmp2)) )) marker create marker=(eval(".scorpion_mcgill."//(eval("basalar_slide_link_"//temp_int))//".spring_MARKER_2")) & location=(LOC_RELATIVE_TO({0,-(eval(slide_link_length))/2,0}, (eval(tmp2)))) & orientation=(ORI_RELATIVE_TO({0d,0d,0d}, (eval(tmp2)) )) undo begin suppress=yes assembly create instance instance=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//temp_int)) & definition=.mdi.forces.spring variable modify variable=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//temp_int//".i_marker")) obj=(eval(".scorpion_mcgill."//(eval("basalar_actuator_housing_"//temp_int))//".spring_MARKER_1")) variable modify variable=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//temp_int//".j_marker")) obj=(eval(".scorpion_mcgill."//(eval("basalar_slide_link_"//temp_int))//".spring_MARKER_2")) variable modify variable=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//temp_int//".stiffness_mode")) str="linear" variable modify variable=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//temp_int//".stiffness_coefficient")) real=(eval(leg_spring_constant)) variable modify variable=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//temp_int//".stiffness_spline")) obj=(none) variable modify variable=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//temp_int//".damping_mode")) str="linear" variable modify variable=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//temp_int//".damping_coefficient")) real=(eval(leg_damper_constant)) variable modify variable=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//temp_int//".damping_spline")) obj=(none) variable modify variable=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//temp_int//".free_length_mode")) str="design_length" variable modify variable=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//temp_int//".i_dynamic_visibility")) str="on" variable modify variable=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//temp_int//".j_dynamic_visibility")) str="off" entity attributes entity_name=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//temp_int//".i_marker")) color=red undo end group modify group=SELECT_LIST object=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//temp_int//".i_marker")) ! ! ! ! ! ! -------------------------------- STARBOARD SIDE Basalar Cylindrical Link ---------------------------------------- ! ! ! ! ! Part pose (location and orientation); relative to ground marker. ! ! Create the first part, the leg link part create rigid_body name_and_position part_name=(eval(tmp7)) & location=(LOC_RELATIVE_TO({0,0,0},(eval(tmp12 // ".cm")))) & !! Relative to Basalar Actuator Housing CoM. orientation=(ORI_RELATIVE_TO({90d,0d,0d}, (eval(tmp12 // ".cm")))) !! Relative to Basalar Actuator Housing CoM. [July 5, 2002] part modify rigid_body mass_properties part_name=(eval(tmp7)) & material=.materials.steel part attributes part_name=(eval(tmp7)) color=GREEN name_vis=off defaults model part_name=(eval(tmp7)) ! ! ! Marker definition (for definition of the cylinder) ! marker create marker=basalar_link_marker & location = 0,0,0 & orientation = 0d,90d,0d & relative_to= (eval(tmp7)) marker attributes marker_name=basalar_link_marker & size_of_icons=80 color=GREEN & visibility=no_opinion name_visibility=no_opinion ! ! Insert object (main cylinder) ! geometry create shape cylinder & cylinder_name=basalar_link_cylinder & radius= (eval(link_radius)) & center_marker=basalar_link_marker & length= (eval(link_length)) ! ! ! ------------ ! ! Insert object (thinner sliding cylinder) ! ! ------------ ! ! Create the second part, the sliding leg end. part create rigid_body name_and_position part_name=(eval(tmp8)) & location=(LOC_RELATIVE_TO({0,-(eval(link_length))/2,0},(eval((eval(tmp7) // ".cm"))))) & !! relative to the larger cylinder's CoM. [July 5, 2002] orientation=(ORI_RELATIVE_TO({-90d,0d,0d}, (eval((eval(tmp7) // ".cm"))))) !! relative to the larger cylinder's CoM. [July 5, 2002] part modify rigid_body mass_properties part_name=(eval(tmp8)) & material=.materials.steel part attributes part_name=(eval(tmp8)) color=BLUE name_vis=off defaults model part_name=(eval(tmp8)) ! ! ! Marker definition (for def'n of the sliding cylinder) ! marker create marker=basalar_slide_link_marker & location = 0,0,0 & orientation = 0d,90d,0d & relative_to= (eval(tmp8)) marker attributes marker_name=basalar_slide_link_marker & size_of_icons=80 color=BLUE & visibility=no_opinion name_visibility=no_opinion ! ! geometry create shape cylinder & cylinder_name=basalar_slide_link_cylinder & radius= (eval(slide_link_radius)) & center_marker=basalar_slide_link_marker & length= (eval(slide_link_length)) ! ! ! ------------ ! ! Insert object (Toe at end of the basalar link: basalar_toe) ! ! ------------ ! ! Create the toe at the end of the basalar link part create rigid_body name_and_position part_name=(eval(tmp9)) & location=(LOC_RELATIVE_TO({0,-(eval(slide_link_length)),0}, (eval(tmp8)))) & orientation=(ORI_RELATIVE_TO({0d,0d,0d}, (eval(tmp8)) )) part modify rigid_body mass_properties part_name=(eval(tmp9)) & material=.materials.steel part attributes part_name=(eval(tmp9)) color=BLUE name_vis=off defaults model part_name=(eval(tmp9)) ! ! ! Marker definition (for def'n of the toe ellipsoid) ! marker create marker=(eval(".scorpion_mcgill." // (eval(tmp9)) // ".center_marker")) & location= (LOC_RELATIVE_TO({0,-(eval(slide_link_length)),0}, (eval(tmp8)))) & orientation= 0d,0d,0d geometry create shape ellipsoid & ellipsoid_name=(eval(".scorpion_mcgill." // (eval(tmp9)) // ".ellipsoid")) & x_scale_factor=(2*eval(toe_radius)) & y_scale_factor=(2*eval(toe_radius)) & z_scale_factor=(2*eval(toe_radius)) & center_marker=(eval(".scorpion_mcgill." // (eval(tmp9)) // ".center_marker")) group modify group=SELECT_LIST object=(eval(tmp9)) ! ! ! MERGE the larger link and the basalar actuator. ! part merge rigid_body part_name=(eval(tmp7)) into_part=(eval(tmp12)) ! ! ------------ ! ! Create fixed (locked) joint between the basalar slider and the toe ! ! I would like to use a MERGE between these parts due to the large forces that ! will occur at the fixed joint except that I need the ellipsoid for the contact forces. ! ------------ ! ! Marker on 1st object: slider ! marker create marker=(eval(".scorpion_mcgill."//(eval("basalar_slide_link_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))))//".MARKER_2")) & location=(LOC_RELATIVE_TO({0,-(eval(slide_link_length)),0}, (eval(tmp8)))) & orientation=(ORI_RELATIVE_TO({0d,0d,0d}, (eval(tmp8)) )) ! ! Marker on the 2nd object: ! marker create marker=(eval(".scorpion_mcgill."//(eval(tmp9))//".MARKER_2")) & location=(LOC_RELATIVE_TO({0,-(eval(slide_link_length)),0}, (eval(tmp8)))) & orientation=(ORI_RELATIVE_TO({0d,0d,0d}, (eval(tmp8)) )) ! ! Describe the resulting constraint (Fixed) ! constraint create joint Fixed & joint_name=(eval(".scorpion_mcgill."//(eval("basalar_toe_FIXED_JOINT_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs)))))))) & i_marker_name= (eval(".scorpion_mcgill."//(eval("basalar_slide_link_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))))//".MARKER_2")) & !! first marker j_marker_name= (eval(".scorpion_mcgill."//(eval(tmp9))//".MARKER_2")) !! second marker ! constraint attribute constraint_name=(eval(".scorpion_mcgill."//(eval("basalar_toe_FIXED_JOINT_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs)))))))) name_vis=off scale_of_icons=0.1 ! group modify group=SELECT_LIST object=(eval(".scorpion_mcgill."//(eval("basalar_toe_FIXED_JOINT_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs)))))))) ! ! ! ----------------------- ! ! Create contact force between the toe and the ground plane. ! ! ----------------------- ! contact create contact_name = (eval(".scorpion_mcgill."//(eval(tmp10)))) & i_geometry_name = (eval(".scorpion_mcgill."//(eval(tmp9))//".ellipsoid")) & j_geometry_name = .scorpion_mcgill.ground.PLANE_1 & i_flip_normal = "no" & & stiffness = 1.0E+005 & damping = 10.0 & exponent = 2.2 & dmax = 0.1 & & coulomb_friction = on & mu_static = 0.3 & mu_dynamic = 0.1 & stiction_transition_velocity = 0.1 & friction_transition_velocity = 1.0 geometry create shape gcontact & contact_force_name = (eval(".scorpion_mcgill."//(eval(tmp11)))) & contact_element_name = (eval(".scorpion_mcgill."//(eval(tmp10)))) & force_display = components ! ! ! ! ! ! ------------ ! ! Create translational joint between the two basalar cylinders ! ! ------------ ! ! Marker on 1st object: slider ! marker create marker=(eval(".scorpion_mcgill."//(eval("basalar_slide_link_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))))//".MARKER_1")) & location=(LOC_RELATIVE_TO({0,0,0}, (eval(tmp8)))) & orientation=(ORI_RELATIVE_TO({0d,90d,0d}, (eval(tmp8)) )) ! ! Marker on the 2nd object: larger cylinder ! marker create marker=(eval(".scorpion_mcgill."//(eval("basalar_actuator_housing_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))))//".MARKER_2")) & location=(LOC_RELATIVE_TO({0,0,0}, (eval(tmp8)))) & orientation=(ORI_RELATIVE_TO({0d,90d,0d}, (eval(tmp8)) )) ! ! Describe the resulting constraint (translational) ! constraint create joint Translational & joint_name=(eval(".scorpion_mcgill."//(eval("basalar_TRANS_JOINT_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs)))))))) & i_marker_name= (eval(".scorpion_mcgill."//(eval("basalar_slide_link_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))))//".MARKER_1")) & !! first marker j_marker_name= (eval(".scorpion_mcgill."//(eval("basalar_actuator_housing_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))))//".MARKER_2")) !! second marker ! constraint attribute constraint_name=(eval(".scorpion_mcgill."//(eval("basalar_TRANS_JOINT_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs)))))))) name_vis=off ! group modify group=SELECT_LIST object=(eval(".scorpion_mcgill."//(eval("basalar_TRANS_JOINT_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs)))))))) ! ! ------------ ! ! Create translational spring between the two cylinders ! ! ------------ ! default coordinate_system default_coordinate_system=.scorpion_mcgill marker create marker=(eval(".scorpion_mcgill."//(eval("basalar_actuator_housing_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))))//".spring_MARKER_1")) & location=(LOC_RELATIVE_TO({0,0,0}, (eval(tmp8)))) & orientation=(ORI_RELATIVE_TO({0d,0d,0d}, (eval(tmp8)) )) marker create marker=(eval(".scorpion_mcgill."//(eval("basalar_slide_link_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))))//".spring_MARKER_2")) & location=(LOC_RELATIVE_TO({0,-(eval(slide_link_length))/2,0}, (eval(tmp8)))) & orientation=(ORI_RELATIVE_TO({0d,0d,0d}, (eval(tmp8)) )) undo begin suppress=yes assembly create instance instance=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs)))))) & definition=.mdi.forces.spring variable modify variable=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))//".i_marker")) obj=(eval(".scorpion_mcgill."//(eval("basalar_actuator_housing_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))))//".spring_MARKER_1")) variable modify variable=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))//".j_marker")) obj=(eval(".scorpion_mcgill."//(eval("basalar_slide_link_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))))//".spring_MARKER_2")) variable modify variable=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))//".stiffness_mode")) str="linear" variable modify variable=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))//".stiffness_coefficient")) real=(eval(leg_spring_constant)) variable modify variable=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))//".stiffness_spline")) obj=(none) variable modify variable=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))//".damping_mode")) str="linear" variable modify variable=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))//".damping_coefficient")) real=(eval(leg_damper_constant)) variable modify variable=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))//".damping_spline")) obj=(none) variable modify variable=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))//".free_length_mode")) str="design_length" variable modify variable=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))//".i_dynamic_visibility")) str="on" variable modify variable=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))//".j_dynamic_visibility")) str="off" entity attributes entity_name=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))//".i_marker")) color=red undo end group modify group=SELECT_LIST object=(eval(".scorpion_mcgill.basalar_TRANS_SPRING_"//(eval((eval(temp_int))+(eval(number_of_hip_pairs))))//".i_marker")) ! ! ! end !! END the FOR Loop. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! Set Simulation parameters !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! simulation single set update = none simulation single_run set update = none !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! Create variables, measures and functions for ! measuring and defining angles, angular velocity, ! torque, etc. ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!! ------------------------------------------------------------------------------- undo end