Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I found out the answer now. The problem is in the destrctor. I should shutdown the ROS node before the thread terminates. Otherwise, the message and service threads would never terminate since its termination signal is when ros::ok() fails. Therefore, the solution is quite simple, put rosnode_->shutdown() before threads join() function are called.