Good way to detect joystick failure?
It's important to stop my robot if there's ever a break in communication. I've accomplished this by using a 1.5 second timeout and requiring that a joystick event be received before the timeout elapses. It would be ideal if joy_node could publish an update on its own every 0.X seconds so that the operator would not have to keep pressing buttons.
Is there an existing way to do this well? (Is "bond" what I should use?)
update: autorepeat_rate is exactly what I needed, of course. I'm embarrassed that I didn't find it on my own. Thank you!
Note that autorepeat_rate "repeats last known state" with an incremented sequence number but it uses the last time stamp. Thus, if you're filtering based on the age of the time stamp, you might miss the updates.
Repeating the last known timestamp might be a bug or it might be intended behavior, indicating that the node is still alive but hasn't received any data from the joystick. You can file an issue on the joy package's bug tracker if you think this is a bug.