Ask Your Question

XBox Joystick - detecting signal loss

asked 2015-11-04 10:44:09 -0500

Karsten gravatar image

I ran into a weird behavior (i.e. crashing my robot uncontrollable into a wall) because while operating the robot, the battery shutdown. Due to the autorepeat function inside the joy_node, the last command was infinitely repeated until crash.

The question here is, if there is any option for the xbox controller to find out if signal is lost or still available.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2015-12-29 13:00:45 -0500

tbh gravatar image

updated 2015-12-30 11:16:16 -0500

I had a similar problem with the xbox controller publishing garbage messages on startup and messing things up. I switched to the xboxdrv driver and have no more problems. It looks like it also publishes a no-buttons-pushed joy message when I take the battery out.

Here's how to set it up.

NOTE: It switches the pad buttons to be axes, so you'll have to change up your nodes using the joy message. EDIT: I hadn't read far enough in the man page, but it's highly configurable.

edit flag offensive delete link more

answered 2015-11-04 19:03:59 -0500

nyquist09 gravatar image

There is no such option as far as I know. If the connection is lost, the last valid command just keeps being sent.

A workaround would be a deadman switch that needs to be toggled. So basically before processing a joystick command, you check if the deadman switch has been toggled during a certain interval (maybe 0.2 secs). If it has not been toggled you dont send the joystick command to the robot. In that case if you lose connection it is the same as if you don't toggle the deadman. The side-effect is that you always have to toggle the deadman switch while driving the robot with your joystick.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2015-11-04 10:44:09 -0500

Seen: 371 times

Last updated: Dec 30 '15