Skip to content

ROS 2 Migration: Elevator

Shivesh Khaitan edited this page Jul 4, 2019 · 1 revision

Overview

This pages describes the changes in the elevator plugin in gazebo_plugins for ROS 2, including a migration guide.

Summary

  • Elevator topic can be changed using remapping arguments.
  • <bottom_floor> and <top_floor> can be set in the plugin to limit the floors reachable by the elevator.

SDF parameters

ROS 1 ROS 2
topic <ros><argument>elevator:=custom_elevator</argument></ros>
robotNamespace :x:

Example Migration

ROS1

      <plugin filename="libgazebo_ros_elevator.so" name="elevator_plugin">
        <!-- Add a namespace -->
        <robotNamespace>demo</robotNamespace>
        <!-- This topic is used to control the elevator -->
        <topic>elevator_demo</topic>

        <lift_joint>elevator::lift</lift_joint>
        <door_joint>elevator::door</door_joint>
        <floor_height>3.075</floor_height>

        <!-- Time the elevator door will stay open in seconds -->
        <door_wait_time>10</door_wait_time>
      </plugin>

ROS2

      <plugin name="elevator" filename="libgazebo_ros_elevator.so">
        <ros>
          <namespace>demo</namespace>
          <argument>elevator:=elevator_demo</argument>
        </ros>
        <!-- floor constraints -->
        <bottom_floor>0</bottom_floor>
        <top_floor>1</top_floor>

        <lift_joint>elevator::lift</lift_joint>
        <door_joint>elevator::door</door_joint>
        <floor_height>3.075</floor_height>

        <!-- Time the elevator door will stay open in seconds -->
        <door_wait_time>10</door_wait_time>
      </plugin>
You can’t perform that action at this time.