Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

If you are launching from ROS,

<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model"
  args="-param robot_description -urdf -model robot
        -J ARM/Shoulder/X5_9 1.1" />

spawns my *.urdf into Gazebo with the ARM/Shoulder/X5_9 joint set to an initial position of 1.1 radians.

...
<joint name="ARM/Shoulder/X5_9" type="revolute">
  <parent link="hebi_x5_9_16Z"/>
  <child link="a_2038_02_6Z"/>
  <axis xyz="-2.77554010017e-17 -1.66533454e-16 1.0"/>
  <dynamics damping="0.5" friction="0.06"/>
  <limit effort="100" lower="0" upper="+1.1" velocity="100"/>
  <origin rpy="0.0 -2.77555756e-17 0.0" xyz="-5.63687556453e-17 2.34257058104e-17 0.03"/>
</joint>
...

If you are launching from ROS,

<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model"
  args="-param robot_description -urdf -model robot
        -J ARM/Shoulder/X5_9 1.1" />

spawns my this *.urdf into Gazebo with the ARM/Shoulder/X5_9 joint set to an initial position of 1.1 radians.


*.urdf (fragment):

...
<joint name="ARM/Shoulder/X5_9" type="revolute">
  <parent link="hebi_x5_9_16Z"/>
  <child link="a_2038_02_6Z"/>
  <axis xyz="-2.77554010017e-17 -1.66533454e-16 1.0"/>
  <dynamics damping="0.5" friction="0.06"/>
  <limit effort="100" lower="0" upper="+1.1" velocity="100"/>
  <origin rpy="0.0 -2.77555756e-17 0.0" xyz="-5.63687556453e-17 2.34257058104e-17 0.03"/>
</joint>
...

If you are launching from ROS,

<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model"
  args="-param robot_description -urdf -model robot
        -J ARM/Shoulder/X5_9 1.1" />

spawns this *.urdf into Gazebo with the ARM/Shoulder/X5_9 joint set to an initial position of 1.1 radians.


*.urdf (fragment):

...
<joint name="ARM/Shoulder/X5_9" type="revolute">
  <parent link="hebi_x5_9_16Z"/>
  <child link="a_2038_02_6Z"/>
  <axis xyz="-2.77554010017e-17 -1.66533454e-16 1.0"/>
  <dynamics damping="0.5" friction="0.06"/>
  <limit effort="100" lower="0" upper="+1.1" velocity="100"/>
  <origin rpy="0.0 -2.77555756e-17 0.0" xyz="-5.63687556453e-17 2.34257058104e-17 0.03"/>
</joint>
...

Note: If you want to dig deeper, check out these lines in ~/gazebo_ros/gazebo_interface.py: https://github.com/ros-simulation/gazebo_ros_pkgs/blob/kinetic-devel/gazebo_ros/src/gazebo_ros/gazebo_interface.py#L38-L51