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

Revision history [back]

click to hide/show revision 1
initial version

I went with the manual solution.

This problem is also described in the last comment on the accepted answer here, which also suggests it must be done manually.

To do this, I post-multiply the odom message's pose by the sensor-to-base_link transform. Then, in order to make the base_link appear to start at 0 instead of the sensor, I pre-multiply this by the base_link-to-sensor transform. Thus if your base_link-to-sensor (or sensor mounted pose) transform is S, I compute

odom_msg.pose.pose = S * odom_msg.pose.pose * S.inverse()

This assumes your twists (linear and angular) are already rotated by the pose's rotation after this calculation. Also note it's more performant to precompute S.inverse() rather than recalculating this every frame.

I went with the manual solution.solution, manually calculating where the odom message should be for the robot frame instead of the sensor frame.

This problem is also described in the last comment on the accepted answer here, which also suggests it must be done manually.

To do this, I post-multiply the odom message's pose by the sensor-to-base_link transform. Then, in order to make the base_link appear to start at 0 instead of the sensor, I pre-multiply this by the base_link-to-sensor transform. Thus if your base_link-to-sensor (or sensor mounted pose) transform is S, I compute

odom_msg.pose.pose = S * odom_msg.pose.pose * S.inverse()

This assumes your twists (linear and angular) are already rotated by the pose's rotation after this calculation. Also note it's more performant to precompute S.inverse() rather than recalculating this every frame.

I went with the manual solution, manually calculating where the odom message should be for the robot frame instead of the sensor frame.

This problem is also described in the last comment on the accepted answer here, which also suggests it must be done manually.

To do this, I post-multiply the odom message's pose by the sensor-to-base_link transform. Then, in order to make the base_link appear to start at 0 instead of the sensor, I pre-multiply this by the base_link-to-sensor transform. Thus if your base_link-to-sensor base_link-to-sensor (or sensor mounted mount pose) transform is S, I compute

odom_msg.pose.pose = S * odom_msg.pose.pose * S.inverse()

This assumes your twists (linear and angular) are already rotated by the pose's rotation after this calculation. Also note it's more performant to precompute S.inverse() rather than recalculating this every frame.