Tutorials/intermediate/make simple arm

This tutorial describes how to make a simple 4-DOF robot arm.


 * 1) Setup ###

1. Layout the basic structure of our robotic arm, consisting of 5 links (base, shoulder_pan, elbow_pan, wrist_lift and wrist_roll), and connect the links with joints specifying parent child relationships. Save the following XML block as `simple_arm.model`:

                <joint name='arm_wrist_lift_joint' type='prismatic'> <parent link='arm_elbow_pan'/> <child link='arm_wrist_lift'/> <joint name='arm_wrist_roll_joint' type='revolute'> <parent link='arm_wrist_lift'/> <child link='arm_wrist_roll'/>

1. Now edit `simple_arm.model` with your favorite text editor. Update the ` `s with the correct inertia, collision and visual geometries:

<link name='arm_base'> <inertial mass='101.000000'> <origin pose='0.000000 0.000000 0.000990 0.000000 -0.000000 0.000000'/> <inertia ixx='1.110000' ixy='0.000000' ixz='0.000000' iyy='100.110000' iyz='0.000000' izz='1.010000'/> <collision name='arm_base_geom'> <origin pose='0.000000 0.000000 0.050000 0.000000 -0.000000 0.000000'/> <box size='1.000000 1.000000 0.100000'/> <visual name='arm_base_geom_visual' cast_shadows='1'> <origin pose='0.000000 0.000000 0.050000 0.000000 -0.000000 0.000000'/> <box size='1.000000 1.000000 0.100000'/> <material script='Gazebo/Blue'/> <collision name='arm_base_geom_arm_trunk'> <origin pose='0.000000 0.000000 0.600000 0.000000 -0.000000 0.000000'/> <cylinder radius='0.050000' length='1.000000'/> <visual name='arm_base_geom_arm_trunk_visual' cast_shadows='1'> <origin pose='0.000000 0.000000 0.600000 0.000000 -0.000000 0.000000'/> <cylinder radius='0.050000' length='1.000000'/> <material script='Gazebo/Red'/> <link name='arm_shoulder_pan'> <origin pose='0.000000 0.000000 1.100000 0.000000 -0.000000 0.000000'/> <inertial mass='1.100000'> <origin pose='0.045455 0.000000 0.000000 0.000000 -0.000000 0.000000'/> <inertia ixx='0.011000' ixy='0.000000' ixz='0.000000' iyy='0.022500' iyz='0.000000' izz='0.013500'/> <collision name='arm_shoulder_pan_geom'> <origin pose='0.000000 0.000000 0.050000 0.000000 -0.000000 0.000000'/> <cylinder radius='0.050000' length='0.100000'/> <visual name='arm_shoulder_pan_geom_visual' cast_shadows='1'> <origin pose='0.000000 0.000000 0.050000 0.000000 -0.000000 0.000000'/> <cylinder radius='0.050000' length='0.100000'/> <material script='Gazebo/Yellow'/> <collision name='arm_shoulder_pan_geom_arm_shoulder'> <origin pose='0.550000 0.000000 0.050000 0.000000 -0.000000 0.000000'/> <box size='1.000000 0.050000 0.100000'/> <visual name='arm_shoulder_pan_geom_arm_shoulder_visual' cast_shadows='1'> <origin pose='0.550000 0.000000 0.050000 0.000000 -0.000000 0.000000'/> <box size='1.000000 0.050000 0.100000'/> <material script='Gazebo/Yellow'/> <link name='arm_elbow_pan'> <origin pose='1.050000 0.000000 1.100000 0.000000 -0.000000 0.000000'/> <inertial mass='1.200000'> <origin pose='0.087500 0.000000 0.083333 0.000000 -0.000000 0.000000'/> <inertia ixx='0.031000' ixy='0.000000' ixz='-0.005000' iyy='0.072750' iyz='0.000000' izz='0.044750'/> <collision name='arm_elbow_pan_geom'> <origin pose='0.000000 0.000000 0.100000 0.000000 -0.000000 0.000000'/> <cylinder radius='0.050000' length='0.200000'/> <visual name='arm_elbow_pan_geom_visual' cast_shadows='1'> <origin pose='0.000000 0.000000 0.100000 0.000000 -0.000000 0.000000'/> <cylinder radius='0.050000' length='0.200000'/> <material script='Gazebo/Red'/> <collision name='arm_elbow_pan_geom_arm_elbow'> <origin pose='0.300000 0.000000 0.150000 0.000000 -0.000000 0.000000'/> <box size='0.500000 0.030000 0.100000'/> <visual name='arm_elbow_pan_geom_arm_elbow_visual' cast_shadows='1'> <origin pose='0.300000 0.000000 0.150000 0.000000 -0.000000 0.000000'/> <box size='0.500000 0.030000 0.100000'/> <material script='Gazebo/Yellow'/> <collision name='arm_elbow_pan_geom_arm_wrist'> <origin pose='0.550000 0.000000 0.150000 0.000000 -0.000000 0.000000'/> <cylinder radius='0.050000' length='0.300000'/> <visual name='arm_elbow_pan_geom_arm_wrist_visual' cast_shadows='1'> <origin pose='0.550000 0.000000 0.150000 0.000000 -0.000000 0.000000'/> <cylinder radius='0.050000' length='0.300000'/> <material script='Gazebo/Red'/> <link name='arm_wrist_lift'> <origin pose='1.600000 0.000000 1.050000 0.000000 -0.000000 0.000000'/> <inertial mass='0.100000'> <origin pose='0.000000 0.000000 0.000000 0.000000 -0.000000 0.000000'/> <inertia ixx='0.010000' ixy='0.000000' ixz='0.000000' iyy='0.010000' iyz='0.000000' izz='0.001000'/> <collision name='arm_wrist_lift_geom'> <origin pose='0.000000 0.000000 0.500000 0.000000 -0.000000 0.000000'/> <cylinder radius='0.030000' length='1.000000'/> <visual name='arm_wrist_lift_geom_visual' cast_shadows='1'> <origin pose='0.000000 0.000000 0.500000 0.000000 -0.000000 0.000000'/> <cylinder radius='0.030000' length='1.000000'/> <material script='Gazebo/Yellow'/> <link name='arm_wrist_roll'> <origin pose='1.600000 0.000000 1.000000 0.000000 -0.000000 0.000000'/> <inertial mass='0.100000'> <inertia ixx='0.010000' ixy='0.000000' ixz='0.000000' iyy='0.010000' iyz='0.000000' izz='0.001000'/> <collision name='arm_wrist_roll_geom'> <origin pose='0.000000 0.000000 0.025000 0.000000 -0.000000 0.000000'/> <cylinder radius='0.050000' length='0.050000'/> <visual name='arm_wrist_roll_geom_visual' cast_shadows='1' transparency='0.000000'> <origin pose='0.000000 0.000000 0.025000 0.000000 -0.000000 0.000000'/> <cylinder radius='0.050000' length='0.050000'/> <material script='Gazebo/Red'/>

1. Next, fill out the ` ` blocks with desired joint ` ` and corresponding ` ` definitions:

<joint name='arm_base_joint' type='revolute'> <parent link='world'/> <child link='arm_base'/> <axis xyz='0.000000 0.000000 1.000000'> <limit lower='0.000000' upper='0.000000'/> <joint name='arm_shoulder_pan_joint' type='revolute'> <parent link='world'/> <child link='arm_shoulder_pan'/> <axis xyz='0.000000 0.000000 1.000000'/> <joint name='arm_elbow_pan_joint' type='revolute'> <parent link='arm_shoulder_pan'/> <child link='arm_elbow_pan'/> <axis xyz='0.000000 0.000000 1.000000'/> <joint name='arm_wrist_lift_joint' type='prismatic'> <parent link='arm_elbow_pan'/> <child link='arm_wrist_lift'/> <axis xyz='0.000000 0.000000 1.000000'> <limit lower='-0.800000' upper='0.100000'/> <joint name='arm_wrist_roll_joint' type='revolute'> <parent link='arm_wrist_lift'/> <child link='arm_wrist_roll'/> <axis xyz='0.000000 0.000000 1.000000'> <limit lower='-2.999994' upper='2.999994'/>


 * 1) Run Simulation ###

1. Put the complete `simple_arm.model` into the `gazebo/share/gazebo-version/models/` directory as specified under the `GAZEBO_RESOURCE_PATH` environment variable. (p.s. there is a copy of simple_arm.model in the gazebo repository already). 1. Start up gazebo executables, select the `Insert Moddel` tab inside the gui, then select `simple_arm` from the list of models displayed. Position mouse in the world and left click to spawn the model. 1. To visualize joints in the simple arm model, right click on the model and select "Joints". The newly created joints will be displayed. 1. You can also control the forces on each joint using the Joint Control widget. Right click on the model again, and select "Joint Control". This widget displays a list of sliders, one for each joint. Use the sliders to apply forces to each joint, and you should see the arm move.