ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

What is the measurement unit for cmd_vel in android_teleop?

asked 2015-12-20 05:33:49 -0500

Myzhar gravatar image

updated 2015-12-22 12:56:04 -0500

Hi all,

as far as I know the "twist" topics should use S.I. measurements units, but looking at android_teleop for Indigo I noticed that both Forward speed and Rotation speed are in the range [0,1] as if they are normalized values.

What is the right way to use those messages? How can I modify that values such that they match the velocity range of my robot?

Thank you in advance Walter

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-12-22 14:23:37 -0500

2ROS0 gravatar image

updated 2015-12-22 14:27:16 -0500

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. The reason the values are normalized are probably so you can have the same display view for all robots instead of having to set min and max limits each time.

In your case, the easiest thing is to multiply the output you are getting by scale factors - one for linear velocity and one for angular velocity based on the corresponding max values for your robot.

Hope this helps.

edit flag offensive delete link more

Comments

Thank you for the confirmation. So I will write a "scaling node" that gets cmd_vel message and re-publish the rescaled value. Good :-)

Myzhar gravatar image Myzhar  ( 2015-12-22 15:48:59 -0500 )edit

Yeah, or you can modify their source code, whatever you prefer

2ROS0 gravatar image 2ROS0  ( 2015-12-22 16:07:34 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-12-20 05:33:49 -0500

Seen: 662 times

Last updated: Dec 22 '15