ROS Answers: Open Source Q&A Forum - RSS feedhttps://answers.ros.org/questions/Open source question and answer forum written in Python and DjangoenROS Answers is licensed under Creative Commons Attribution 3.0Mon, 11 Jan 2016 07:47:26 -0600Handle Linear and Angular Velocity on Differential Drive Robothttps://answers.ros.org/question/223755/handle-linear-and-angular-velocity-on-differential-drive-robot/Hi guys ,
I have some question about the cmd_vels ( linear , angular) -> Motor Speed Handling
since i have the differential drive robot which **each wheel** can do the maximum speed at 0.25 m/s
( So, Ideally, MAX Linear Velocity of Robot = 0.25 m/s right ? )
Then ,i've done some calculation on the maximum angular speed = 1.25 rad/s (with my Wheel Separation 40 cm)
and test on joystick teleop
1. Joystick Teleop Scale Parameters
Linear Scaling = 0.25
and Angular Scaling 1.25
**If I push the Joystick in TOP-LEFT Direction, The Result (to command motors) calculated
is more than 0.25 m/s,**
which is beyond the maximum speed of my motor.
How Can i handle this ?
and how to find the range of Linear velocity and Angular velocity that i can access without breaking the condition on maximum speed limit ?
----------
and i wonder that where to put the limitors in order to use with the "Navigation Stack"
( to prevent the navigation node sending command like the example above )
*FYI : motor is commanded by the velocity 0-255 ( 0 - 0.25 m/s ) and Direction Bit (0,1).
so i need to convert them to direction and magnitude before sending. *Sun, 10 Jan 2016 05:56:51 -0600https://answers.ros.org/question/223755/handle-linear-and-angular-velocity-on-differential-drive-robot/Answer by fsteinhardt for <p>Hi guys , </p>
<p>I have some question about the cmd_vels ( linear , angular) -> Motor Speed Handling</p>
<p>since i have the differential drive robot which <strong>each wheel</strong> can do the maximum speed at 0.25 m/s</p>
<p>( So, Ideally, MAX Linear Velocity of Robot = 0.25 m/s right ? ) </p>
<p>Then ,i've done some calculation on the maximum angular speed = 1.25 rad/s (with my Wheel Separation 40 cm) <br/>
and test on joystick teleop </p>
<ol>
<li><p>Joystick Teleop Scale Parameters </p>
<p>Linear Scaling = 0.25 </p>
<p>and Angular Scaling 1.25 </p>
<p><strong>If I push the Joystick in TOP-LEFT Direction, The Result (to command motors) calculated
is more than 0.25 m/s,</strong> </p>
<p>which is beyond the maximum speed of my motor.</p></li>
</ol>
<p>How Can i handle this ?
and how to find the range of Linear velocity and Angular velocity that i can access without breaking the condition on maximum speed limit ?</p>
<hr/>
<p>and i wonder that where to put the limitors in order to use with the "Navigation Stack"
( to prevent the navigation node sending command like the example above )</p>
<p>*FYI : motor is commanded by the velocity 0-255 ( 0 - 0.25 m/s ) and Direction Bit (0,1).
so i need to convert them to direction and magnitude before sending. *</p>
https://answers.ros.org/question/223755/handle-linear-and-angular-velocity-on-differential-drive-robot/?answer=223814#post-id-223814Hi,
I see two possibilities:
- You could divide your possible velocities in two parts, one part for translation, one part for rotation. For example: set max translation velocity 1/2 of total possible veloctiy, the rotation gets the rest of the possible velocity (or choose another ratio). The sum of both velocities for translation and rotation can't be faster than the real wheel maximal velocity.This lowers your maximal speeds, but you can be sure that every possible velocity command in these limits can be carried out.
- Or you could set both the max. rotation and translation velocities to the physical maximum and observe the resulting wheel velocities after you sum these values.
If you max out the possible velocity of a wheel you scale down the velocity of the other wheel so that you keep the ratio of the velocities of both wheels. (Example: your input sets these velocities: left wheel: 100 rpm, right wheel 200 rpm, but your physical max. velocity is 150 rpm, so after scaling: left wheel: 75 rpm, right wheel 150 rpm )
You keep the max. possible velocities if you only translate or rotate, and you keep the shape of the trajectory if a wheel velocity is maxed out. (But the velocity while driving curves can be lower than the velocity that the planner has calculated). Mon, 11 Jan 2016 07:47:26 -0600https://answers.ros.org/question/223755/handle-linear-and-angular-velocity-on-differential-drive-robot/?answer=223814#post-id-223814