Ask Your Question

Revision history [back]

I guess your node exits immediately?

You need to call ros::spin() to enter the loop that checks for new ros messages and calls the callback method. Put it at the end of the main function.

I guess your node exits immediately?

You need to call ros::spin() at the end of the main function to enter the loop that checks for new ros messages and calls the callback method. Put it at See the end of the main function. subscriber tutorial for more information.