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

How to make sure the published commands are executed?

asked 2014-04-18 09:39:44 -0500

Warrior gravatar image

updated 2016-10-24 08:36:52 -0500

ngrennan gravatar image

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-04-18 09:58:25 -0500

dornhege gravatar image

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.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2014-04-18 09:39:44 -0500

Seen: 155 times

Last updated: Apr 18 '14