0
$\begingroup$

Rosanswers logo

Hi everyone,

I want to turn my robot x degrees to face a desired coordinate(goal). The robot must turn about 100 degrees (1.745 radians), but when I set the angular velocity to 1.745 since the program is running in a loop it doesn't execute the command completely and I don't know how to stop the program at that time to let the turn complete. I thought maybe the robot is not capable of turning at 1.745 radians when received the command, so I thought maybe I should divide 1.745 by, say, 5 and turn the robot 5 times. But I don't know how I can MAKE SURE that the robot has executed the 5 commands I publish.

Thank you


Originally posted by Warrior on ROS Answers with karma: 61 on 2014-04-18

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The angular velocity does NOT set an angle, but a velocity as the name says. So to turn by 1.745 radians you must send the angular velocity of 1.745 rad/s for 1 second. If the robot cannot turn that fast, and you would send 1/5 of that, you therefore must send that for 5 seconds.

The number of times that you send the command has nothing to do with the actual angles reached as the time that the velocity is applied is relevant.

Note 1: Usually real robots should have a safety timeout that will require the velocity to be send continuously. If the timeout of e.g. 0.1s is reached turning stops.

Note 2: Sending 1.745 rad/s for one second will apply motor commands that should do that for about 1s. Wheel slip, etc. might give you different results in reality. For turning to a goal, you should put that into a closed-loop controller.


Originally posted by dornhege with karma: 31395 on 2014-04-18

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.