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

If the code you posted really is 'all there is', then it seems to at least be missing a ros::spin() or similar statement. If the ros event loop is run somewhere else, the ros::init(..) seems out of place.

What is most likely going on is that the ros logging subsystem has 'enough' time to flush out the ROS_INFO(..) calls in func1(), but not for those in func2(). I've noticed this myself a few times, especially when trying to print some output at node(let) shutdown (to print statistics for instance).

Suggestions I've received included 'sleeping some time' before calling ros::shutdown(..) (if doing so explicitly) or before returning from your main.