how to add a timeout for a teleop node
I have a teleop node that connects with my ps3 controller wirelessly to run my robot.
I want to add a timeout feature to set all of the parameters to zero in case the joy commands stop being sent to the teleop node. I have had my robot run away on me already and don't want that to happen again.
Can someone help and provide sudo code? And would this timeout be in the main function or in the ps3 button handler?
Thanks.
The general approach is to not add the timeout in the teleop node but in your robot's base node (examples: PR2, Turtlebot). The reason is that it also can happen that your network connection drops. In that case, the robot would still run away.