I am following the ROS in 5 days course. I am running a basic node which is publishing movement to the turtlebot. The bot behaves as I expect, however when I kill the instance that is publishing the node (ctrl+C), the robot keeps on spinning. I have no idea why nor how to kill the process... Here is my code:
The only way I've found to stop the robot is by running the code again, but publishing var.angular.z = 0. What am I missing? Thank you |
Hello, Actually the problem is that the robot uses the last message you sent in the I suggest two possibilities: 1: ROS node on_shutdown callback
You can use the The code would be like that:
But ROS does not guarantee the messages are going to be publish (Yes, it is written in their documentation) Python sigint detector You can use python sigint detector. It would be something like: There is a topic discussing about this (https://stackoverflow.com/questions/1112343/how-do-i-capture-sigint-in-python)
|