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

I found my own solution.

When defining a publisher, if you're trying to publish to the top level you must add a '/' to the front of the path. For example;

nh.advertise<diagnostic_msgs::DiagnosticArray>("/diagnostics", 10);

publishes to the topic;

/diagnostics

While

nh.advertise<diagnostic_msgs::DiagnosticArray>("diagnostics", 10);

publishes to the

node_name/diagnostics