ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

How to get Twist from rtabmap rgbd_odometry for use with move_base

asked 2015-12-25 15:26:48 -0600

boost gravatar image


I am using rtabmap rgbd_odometry to get odometry for my robot and now want to make use of move_base to get cmd_vel commands. When I receive the velocity commands though, I'll need to make sure my motor controller follows the command sent by move_base using a control loop which means I need information on the sensed Twist of the robot. But in the odometry message from rgbd_odometry, there is only position data (from what I've gathered, this is so because rtabmap does not require Twist to work).

Is there any option to turn on Twist calculation in rgbd_odometry or should I calculate this myself based on the position data (dx/dt, dy/dt and dtheta/dt)?

Also, doesn't move_base require Twist in the odometry message to properly calculate the cmd_vel ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-12-26 11:21:51 -0600

matlabbe gravatar image


The twist values were added not so long ago (see this commit). If you build the package from source, you should get the twist values in odometry messages. If you don't want to rebuild the package, you can set the twist values like in the referred commit (using the stamps for dt) with a second node.

Yes, move_base uses twist values, though I think it may still work with null twist values (the rtabmap's navigation example worked with stereo_odometry (same as rgbd_odometry) node and null twist values)


edit flag offensive delete link more




It looks like that line is getting just the previous position and angle. Shouldn't the velocity calcualtion be based on the change in position and angle?

boost gravatar image boost  ( 2015-12-26 14:37:55 -0600 )edit

The "previousTransform" is the transformation between the previous pose and the current updated pose (see here).

matlabbe gravatar image matlabbe  ( 2015-12-27 15:33:32 -0600 )edit

Note that it is the change in robot frame, not odometry frame, so that 'x' varies only with forward/backward motions. However, I'm not sure if the changes should be in odometry frame, but it seems to make more sense in robot frame.

matlabbe gravatar image matlabbe  ( 2015-12-27 15:35:19 -0600 )edit

The "frame_id" I give rgbd_odometry is the robot's frame so /odom comes out in the robot's frame. I'll be going with a second node to compute the velocity based on the change in position to avoid recompile. Is it OK for me to copy the pose covariance for twist or better to leave them as 0?

boost gravatar image boost  ( 2015-12-27 18:50:58 -0600 )edit

There is a discussion about the covariance in this post. You may fix the covariance like in the viso2 package.

matlabbe gravatar image matlabbe  ( 2016-01-04 09:02:08 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2015-12-25 15:26:48 -0600

Seen: 499 times

Last updated: Dec 26 '15