Skip to content

ROS 2 Migration: P3D

chapulina edited this page Dec 27, 2018 · 1 revision

Overview

This pages describes the changes in the P3D plugin in gazebo_plugins for ROS 2 and instructions for migration.

Summary

  • All SDF parameters are now snake_cased.
  • If the topic name is not defined, default to odom instead of failing.
  • tf_prefix is no longer supported.

SDF parameters

ROS 1 ROS 2
robotNamespace <ros><namespace>
bodyName body_name
topicName <ros><argument>odom:=custom_odom</argument></ros>
frameName frame_name
xyzOffset xyz_offset
rpyOffset rpy_offset
gaussianNoise gaussian_noise
updateRate update_rate

Example Migration

ROS1

    <model name='the_model'>
      ...

      <link name='box_link'>
        ...
      </link>

      <link name='sphere_link'>
        ...
      </link>

      <plugin name="gazebo_ros_force" filename="libgazebo_ros_force.so">

        <robotNamespace>demo</robotNamespace>
        <topicName>p3d_demo</topicName>
        <bodyName>box_link</bodyName>
        <frameName>sphere_link</frameName>
        <updateRate>1</updateRate>
        <xyzOffsets>10 10 10</xyzOffsets>
        <rpyOffsets>0.1 0.1 0.1</rpyOffsets>
        <gaussianNoise>0.01</gaussianNoise>

      </plugin>

    </model>

ROS2

    <model name='the_model'>
      ...

      <link name='box_link'>
        ...
      </link>

      <link name='sphere_link'>
        ...
      </link>

      <plugin name="gazebo_ros_force" filename="libgazebo_ros_force.so">

        <ros>
          <!-- Add namespace and remap the default topic -->
          <namespace>/demo</namespace>
          <argument>odom:=p3d_demo</argument>
        </ros>

        <!-- Replace camelCase elements with camel_case ones -->
        <body_name>box_link</body_name>
        <frame_name>sphere_link</frame_name>
        <update_rate>1</update_rate>
        <xyz_offsets>10 10 10</xyz_offsets>
        <rpy_offsets>0.1 0.1 0.1</rpy_offsets>
        <gaussian_noise>0.01</gaussian_noise>

      </plugin>


    </model>
You can’t perform that action at this time.