-
Notifications
You must be signed in to change notification settings - Fork 226
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
turtlebot_apps/turtlebot_teleop/joystick_teleop: robot keeps moving even though new joy messages not coming in #55
Comments
yes, it should definitely timeout |
Strange. I used those tools recently (2 weeks ago, testing ps3, xbox360 and What setup are you using? Hydro? Launching minimal + app? 2013/8/20 Tully Foote [email protected]
Marcus Liebhardt |
@bit-pirate Here's the problem I have. I have replicated the output of a PS3 controller for an Android device...specifically the nvidia shield. I have it rounding down to zero values that are close to zero. The controller itself is very precise, just as precise as a PS3 controller if not more so. Here's the difference: A PS3 controller is hooked via bluetooth to the robot. If you let go of the controller it will zero out and the last message the robot receives is a 0. It's unlikely you'll lose connection to the robot while moving it. With my android device, if I loses wifi when switching between access points in an enterprise network while holding the throttle, the robot will keep going forever. This is very obvious from just looking at the code, there's not much going on in the .cpp file. A timer is created here to call Publish() continuously forever: Here is what is going on in Publish(), if deadman is down it will publish. And here is where the current joystick state is set on receiving Joy message No check is done to look for a timeout. |
I bet this could be an issue at a large show/conference/exhibition where there's lots of bluetooth interference. You could be moving around a turtlebot and lose control of it. |
lol, you know i could have patched this in the time it took to write this comment...i'll submit a pull request tomorrow :) |
hehe
+1 |
It seems that the joystick teleop hast the robot keep going even if new joystick messages aren't coming in. This works fine until you lose wifi with your robot and then it keeps going because the last joy message wasn't a full stop. The teleop for pr2 works a little different where the teleop node stops publishing Twist messages if Joy messages stop coming in.
I think for safety's sake, the turtlebot_teleop should try to replicate this.
The code looks pretty simple, there's a timer that constantly publishes the latest twist message. The fix is just to zero out the latest twist message if the last Joy message that came in the callback has a timestamp that is older than X seconds.
https://github.com/turtlebot/turtlebot_apps/blob/hydro-devel/turtlebot_teleop/src/turtlebot_joy.cpp
The text was updated successfully, but these errors were encountered: