ROS 2 Migration: Video - ros-simulation/gazebo_ros_pkgs GitHub Wiki

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><remapping>image_raw:=custom_image_raw</remapping></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 -->
              <remapping>~/image_raw:=/camera1/image_raw</remapping>
            </ros>
            <height>120</height>
            <width>160</width>
          </plugin>

        </visual>
        ...

      </link>

    </model>
⚠️ **GitHub.com Fallback** ⚠️