Skip to content

ROS 2 Migration: Entity states

Shivesh Khaitan edited this page Aug 8, 2019 · 9 revisions

Overview

In ROS 1, services for querying and setting the state (position and velocity) of entities in the world were provided by the gazebo_ros_api_plugin. In ROS 2, this feature is provided by the gazebo_ros_state plugin.

Read more about the migration of gazebo_ros_api_plugin at ROS 2 Migration: gazebo_ros_api_plugin.

TODO: The following still haven't been migrated:

  • WorldState message (the message type exists but doesn't seem to be used anywhere)

Summary

  • Services have been renamed to better reflect the functionality, by including the word "entity", which encompasses models, links and lights in Gazebo.

  • There are no longer separate services to get / set link and model states. Both are handled by the same service, which now also handles lights, collisions, etc.

  • There used to be a duplicate topic and service for each entity type to set state, for example set_model_state was both a topic and a service. Now there are only services.

  • Note that the header sequence field (header.seq) has been deprecated in ROS 1 for a while and is not present in ROS 2, so it's not being populated anymore.

  • The Get and Set services had inconsistent fields for the name of the relative entity (relative_entity_name / reference_frame). This has been standardized to reference_frame.

  • The Get services' responses had duplicate information from Set. To reduce duplication, the same message is now used on both services. This means that now some fields of the Get response are one level deeper, that is, what used to be res.pose is now res.state.pose.

  • On ROS 1 the plugins used to accept the string map to refer to the world inertial frame. On ROS 2, this has been removed since map doesn't have a special meaning in Gazebo.

ROS 1 ROS 2
Service names get_model_state get_entity_state
get_link_state get_entity_state
set_model_state set_entity_state
set_link_state set_entity_state
Service types gazebo_msgs/GetModelState gazebo_msgs/GetEntityState
gazebo_msgs/GetLinkState gazebo_msgs/GetEntityState
gazebo_msgs/SetModelState gazebo_msgs/SetEntityState
gazebo_msgs/SetLinkState gazebo_msgs/SetEntityState
Topic names model_states model_states
link_states link_states
Message types gazebo_msgs/ModelState gazebo_msgs/EntityState
gazebo_msgs/LinkState gazebo_msgs/EntityState
gazebo_msgs/ModelStates gazebo_msgs/ModelStates
gazebo_msgs/LinkStates gazebo_msgs/LinkStates
Fields model_name name
link_name name
relative_entity_name reference_frame