ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Following up on my comment above: The gazebo_ros_state plugin is registered as a WORLD_PLUGIN type here. The error in the OP is coming from model.cc which is looking for MODEL_PLUGIN type here.

So, it seems the problem here is, the addition of the plugin in the sdf file is not having the desired effect of specifying a WORLD_PLUGIN. Adding the <plugin> under the <world> tag directly like below works without issues:

<world name="default">
        <plugin name="gazebo_ros_state" filename="libgazebo_ros_state.so">
          <ros>
            <namespace>/demo</namespace>
            <argument>model_states:=model_states_demo</argument>
          </ros>
          <update_rate>1.0</update_rate>
        </plugin>
</world>

Starting this world with gazebo my_world_file.world --verbose and then doing a ros2 service list | grep entity gives:

/demo/get_entity_state
/demo/set_entity_state

Following up on my comment above: The gazebo_ros_state plugin is registered as a WORLD_PLUGIN type here. The error in the OP is coming from model.cc which is looking for MODEL_PLUGIN type here.

So, it seems the problem here is, the addition of the plugin in the sdf file is not having the desired effect of specifying a WORLD_PLUGIN. Adding the <plugin> under the <world> tag directly like below works without issues:

<world name="default">
        <plugin name="gazebo_ros_state" filename="libgazebo_ros_state.so">
          <ros>
            <namespace>/demo</namespace>
            <argument>model_states:=model_states_demo</argument>
          </ros>
          <update_rate>1.0</update_rate>
        </plugin>
</world>

Starting this world with gazebo my_world_file.world --verbose and then doing a ros2 service list | grep entity gives:

/demo/get_entity_state
/demo/set_entity_state