How to use gazebo plugins found in gazebo_ros [ROS2 Foxy gazebo11]
I am trying to use the gazebo_ros_state plugin found inside the gazebo_ros folder in gazebo_ros_pkgs.
I have included this inside my world file similar to the demo also found in gazebo_ros folder...
<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>
I also tried to see if the migration guide found here (https://github.com/ros-simulation/gaz... and https://github.com/ros-simulation/gaz...) gave any info on it however nothing there seemed to offer any help.
This is the error I am getting when I try and start my world...
[Err] [Model.cc:1097] Model[cartpole] is attempting to load a plugin, but detected an incorrect plugin type. Plugin filename[libgazebo_ros_state.so] name[gazebo_ros_state]
libgazebo_ros_state.so is found inside my lib folder just like my other plugins
One more thing to note is that I have other plugins found in the gazebo_plugin folder that work and do not give an error like this...
I am having the same problem. Any updates here?
I took the gazebo_ros_state_demo.world straight from the repo. Strangely, I get the same error but regardless it seems to work and I get the two service endpoints /demo/get_entity_state and /demo/set_entity_state and they do correctly return model data.
I have one observation. The
gazebo_ros_state
plugin is registered as a WORLD_PLUGIN type here. The error in the OP is coming frommodel.cc
which is looking forMODEL_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. I wonder if the
<plugin>
tag added in the OP is under the<model>
or under<world>
. Not sure if that's a fix to the problem. But sharing a thought as I am trying to fix the same too.