欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

robot_pose_ekf tf问题及frame id设置问题

程序员文章站 2022-03-05 16:20:36
...

robot_pose_ekf tf问题及frame id设置问题
Let’s ignore the vision system for a moment, and focus on wheel odometry and robot_pose_ekf. Your TF tree should look like this (also see this ros-users thread):

map --> odom_combined --> base_footprint --> base_link

… where

map --> odom_combined is usually published by amcl (optional)
odom_combined --> base_footprint is published by robot_pose_ekf
base_footprint --> base_link is a fixed link in your URDF.

The reason for this peculiar choice of frames is that in TF, each frame can only have one parent. Intuitively, one would like to have multiple parents of base_footprint:

odom --> base_footprint for pure wheel odometry
odom_combined --> base_footprint for EKF estimation
map --> base_footprint for AMCL localization

Since this is not possible in TF, the frames are published as a chain (see above). The important part for your problem is that when using robot_pose_ekf, tf publishing from the wheel odometry has to be switched off. Instead, you should only publish nav_msgs/Odometry messages (using odom_combined as the header frame id), which form the input for robot_pose_ekf and can also be visualized in RViz.

In short:

use odom_combined instead of odom everywhere (or the other way around, but be consistent about it)
don't publish any TF messages, let robot_pose_ekf do that
publish nav_msgs/Odometry messages for the wheel odometry and the overhead camera on the /odom and /vo topics, in both cases specifying odom_combined as the header frame id and base_footprint as the child_frame_id.