How to publish before shutdown
Hi, everyone. I use rosserial_python to connect arduino in my project. I need to publish Twist information to arduino before I shut ros program down. I've already tried two ways to write shutdown function which is refer from http://wiki.ros.org/roscpp/Overview/I...
and here's one of my code:
rospy.loginfo(rospy.get_caller_id() + " shutdown------------------------")
twist.linear.x = forward_init
twist.angular.z = left_init
pub.publish(twist)
rospy.loginfo(rospy.get_caller_id() + " finish shutdown-----------------")
rospy.spin()
However in it shows both of loginfo, but it doesn't publish in this part. Appreciated for any suggestion. thanks a lot.