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'm pretty sure the issue is with the code in onInit(), you call n.subscribe(..), but you don't actually store the ros::Subscriber that is returned by that anywhere.

As soon as the object returned goes out of scope (at the end of onInit()), the subscription is destroyed, and the ..

I'm pretty sure the issue is with the code in onInit(), you call n.subscribe(..), but you don't actually store the ros::Subscriber that is returned by that anywhere.

As soon as the object returned goes out of scope (at the end of onInit()), the subscription is destroyed, and the ..callback not called any longer.