ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Good way to detect joystick failure?

asked 2016-07-16 15:43:37 -0500

kylerlaird gravatar image

updated 2016-07-19 08:49:21 -0500

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.

edit retag flag offensive close merge delete


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.

ahendrix gravatar image ahendrix  ( 2016-07-19 13:00:41 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-07-17 01:12:47 -0500

ahendrix gravatar image

The joy node has an autorepeat_rate parameter that does this. It seems like the documentation for it wasn't being formatted properly, so I fixed the wiki page:

If you're using the joy node, try setting the parameter:

rosrun joy _autorepeat_rate:=10
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-07-16 15:43:37 -0500

Seen: 675 times

Last updated: Jul 19 '16