ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Yes, the twist topics generally use SI units. And also yes, for android_teleop, the linear and angular velocities are normalized.
The piece of code you are looking for that does the math is in the JoystickView class of android_app_manager
motionX = (motionEvent.getX() - (arg0.getWidth() / 2)) / (arg0.getWidth());
motionY = (motionEvent.getY() - (arg0.getHeight() / 2)) / (arg0.getHeight());
The motion event is what you perform on your touchscreen and the arg0 here is the display view. This is performed so you can run the same view for all robots instead of having to set min and max limits each time.
In your case, you can multiply the output by a scale factor - one for linear velocity and one for angular velocity based on the corresponding max values for your robot.
Hope this helps.
2 | No.2 Revision |
Yes, the twist topics generally use SI units. And also yes, for android_teleop, the linear and angular velocities are normalized.
The piece of code you are looking for that does the math is in the JoystickView class of android_app_manager
motionX = (motionEvent.getX() - (arg0.getWidth() / 2)) / (arg0.getWidth());
motionY = (motionEvent.getY() - (arg0.getHeight() / 2)) / (arg0.getHeight());
The motion event is what you perform on your touchscreen and the arg0 here is the display view. This is performed The reason the values are normalized are probably so you can run have the same display view for all robots instead of having to set min and max limits each time.
In your case, you can the easiest thing is to multiply the output you are getting by a scale factor factors - one for linear velocity and one for angular velocity based on the corresponding max values for your robot.
Hope this helps.