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

Moving Base set distance without Navigation stack

asked 2016-04-21 12:34:56 -0500

luketheduke gravatar image

updated 2016-04-21 14:14:11 -0500

I am using a Beaglebone Black on a iRobot Create 2 for some experimenting. I want to be able to move the base a set amount without using the navigation stack, as the Beaglebone would be overwhelmed. I am using the new Create driver that came out and it publishes /odom and subscribes to /cmd_vel. Is there a way to accomplish this? I only need to move about 12 inches but I need to move as precisely as possible. Thanks, luketheduke

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-04-21 13:37:38 -0500

jacobperron gravatar image

updated 2016-04-21 13:51:35 -0500

The wheel odometry from the Create is not the greatest. I would expect it to be able to travel 12 inches (+- 0.5inch) on wheel encoders alone, but you can let me know.

I would record a reference odometry message before you command the robot to move. Then continually compute the distanced travelled by taking the difference between the current odometry message and the reference. When the robot has travelled the desired distance, send a zero command to /cmd_vel. Don't forget the units reported on /odom are in meters. I'd expect the slower you command the robot to move, the closer you'll be able to stop at the desired mark. Also note that when rotation is involved, the odometry estimate becomes worse.

EDIT: To clarify, I am suggesting writing your own controller node that subscribes to /odom and publishes to /cmd_vel.

edit flag offensive delete link more


How would I listen to /odom and derive the distance moved?

luketheduke gravatar image luketheduke  ( 2016-04-21 14:13:56 -0500 )edit

I would follow the tutorial) on how to write a ROS publisher and subscriber.

In the subscriber callback for /odom, you can implement the logic I described.

jacobperron gravatar image jacobperron  ( 2016-04-21 14:34:00 -0500 )edit

Specifically, in the odom message, which part should I record? The robot moves in 2D so the Z location should be ignored, correct?

luketheduke gravatar image luketheduke  ( 2016-04-21 19:38:30 -0500 )edit

Right, it should be following REP 103.

Positive X is forward
Positive Y is to the left
Positive Z is up

You'll probably want to compute the Euclidean distance in XY plane.

jacobperron gravatar image jacobperron  ( 2016-04-21 21:54:42 -0500 )edit

Question Tools

1 follower


Asked: 2016-04-21 12:34:56 -0500

Seen: 697 times

Last updated: Apr 21 '16