-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add inactivity timer: if no activity after timeout, zero twist #25
base: indigo-devel
Are you sure you want to change the base?
Add inactivity timer: if no activity after timeout, zero twist #25
Conversation
This is an interesting feature but I think it should go in the joystick_drivers. The joy node could publish a Joy msg with every field at zero when the connection is lost. This will benefit every node that use the Joy msg and not only the teleop. |
While it may be good to have the joystick driver do something when it does not receive packets, it is not clear to me that publishing all zeroes is the correct thing to do, as what the buttons mean and do depends on the application and how it uses the joystick. I strongly favor having a layer of protection in the ros-teleop node as it can behave intelligently for joysticks which do send packets regularly. The ros-teleop node can then correctly interpret this at the application level to stop motion of the robot base with a zero twist message. We have been using this change on our robot base with much success to safely teleop the robot in a noisy RF environment. |
Add an inactivity timer. Some wireless joysticks constantly transmit data (such as the Play Station Dualshock4). In such cases, it is possible to determine that the joystick is out of range and stop motion by the fact that activity slows down or ceases. This is useful for teleop in the case that the robot leaves range and a twist gets stuck commanding the robot to move without stopping. In this case, the inactivity timeout would detect no more messages after the threshold and send a zero twist (just as if the enable button were released). The default is for the inactivity timeout to be disabled. It can be enabled by setting the inactivity_timeout parameter.
449c1ff
to
a858462
Compare
I have rebased this PR onto 0.1.3 |
This is related to #27 |
May I put a +1 in this one request? The battery on my joystick just dies and it was a good thing that the robot was the the wheels up! 👍 @c-andy-martin , can you help me a little bit with your implementation? |
@Ktysai exactly what do you want help with? You need to be using a joystick that sends packets periodically for my changes to be useful, not sure what kind of joystick you are using. The PS4 joysticks we use constantly transmit as they have IMUs in them, so this change works well for us. |
In my case is an old joystick, a clone for PS3. Do I have to copy all the content available here into the original *.cpp? The launch file will have a new argument, what will be the name of it. As I've said, noob questions. In case my joystick does not send periodically signals, what solution you think will be proper? All the best! |
@Ktysai, IIRC the PS3 remote does not send periodic packets. My change won't help you much in that case, unless you are constantly jiggling the stick to keep it sending data rapidly, or constantly push/release a button while driving. To build the change, checkout the git branch for this pull request into a catkin_ws. I use catkin_tools and do a |
@c-andy-martin, thanks for sharing! There is a how to regarding this catkin_tools and catkin build? I'm on ubuntu 18 & ROS Melodic |
Add an inactivity timer. Some wireless joysticks constantly transmit
data (such as the Play Station Dualshock4). In such cases, it is
possible to determine that the joystick is out of range and stop
motion by the fact that activity slows down or ceases. This is useful
for teleop in the case that the robot leaves range and a twist gets
stuck commanding the robot to move without stopping. In this case, the
inactivity timeout would detect no more messages after the threshold
and send a zero twist (just as if the enable button were released).
The default is for the inactivity timeout to be disabled. It can be
enabled by setting the inactivity_timeout parameter.