rosjava / android_apps

Applications built on top of the rosjava android libraries.
132 stars 112 forks source link

teleop: add a way to manage Virtual Joystick ranges #52

Open Myzhar opened 8 years ago

Myzhar commented 8 years ago

It would be very useful if the ranges of the topic "cmd_vel" should be customizable.

As far as I know, the virtual joypad emits normalized values for X and Y axis in the range [-1,+1] It's ok for robots that have maximum forward speed of 1.0 m/sec and maximum rotation speed of 1 rad/sec, but there exists robots faster and robots slower.

What I'm suggesting is to add 2 text fields (or 2 sliders) to adjust the muximum forward and rotation values... the value from the two field (or sliders) must simply be multiplied to the value extracted by the movement of the joypad.

Values are calculated here: https://github.com/ros-android/android_app_manager/blob/master/src/ros/android/views/JoystickView.java#L136 https://github.com/ros-android/android_app_manager/blob/master/src/ros/android/views/JoystickView.java#L137