Skip to content

ROS 2 Migration: Video

Shivesh Khaitan edited this page May 22, 2019 · 2 revisions

Overview

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

Summary

  • Use remapping argument to change default topic (image_raw)

SDF parameters

ROS 1 ROS 2
width width
height height
topicName <ros><argument>image_raw:=custom_image_raw</argument></ros>

Example Migration

ROS1

    <model name="box_display">

      <link name="base_link">
        ...

        <visual name="visual">
          ...

          <plugin name="display_video_controller" filename="libgazebo_ros_video.so">
            <topicName>image</topicName>
            <height>120</height>
            <width>160</width>
          </plugin>

        </visual>
        ...

      </link>

    </model>

ROS2

    <model name="box_display">

      <link name="base_link">
        ...

        <visual name="visual">
          ...

          <plugin name="display_video_controller" filename="libgazebo_ros_video.so">
            <ros>
              <!-- Remap for image topic to be subscribed -->
              <argument>~/image_raw:=/camera1/image_raw</argument>
            </ros>
            <height>120</height>
            <width>160</width>
          </plugin>

        </visual>
        ...

      </link>

    </model>