Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Making a ros-interoperable plugin isn't exactly straightforward. Your chatter topic doesn't show up in rostopic list for a few reasons:

  1. Your nodehandle, n, is going out of scope after the Load method finishes. You need to make the nodehandle a member of the plugin class that load method resides within. This will keep your nodehandle in scope as long as the plugin is alive.

  2. You are creating a subscriber in the example code you posted, which will only read from the "chatter" topic. rostopic list only shows topics that are being advertised, not subscribed to.

A quick way to test if your plugin gets loaded is to use ROS_INFO("insert text here"); in the load method. This will send a message to the terminal that roscore is running in.

Hope this helps!