How to rearrange the Tf Tree for multiple sensor fusion for robot_localization
My goal is to use ekf for odometry estimate.
I have three sources: Visual Odometry, wheel encoders and an IMU.
I have watched the roscon tutorial video. But still confused on how I should design my tf tree.
Currently, I have the following frames:
Visual odometry: t265_odom_frame -> t265_pose_frame
Wheel Odometry: odom_encoders -> base_link
Imu: odom -> d435_imu_optical_frame
Obviously this is wrong. And I cant figure out how should I rearrange everything. My robot works ok without fusion and now I am trying improvements.
Should the parent and child frame IDs of all my sources be the same i.e. multiple odom -> base_link? But that doesnt make sense as well and, documentation says that the transform odom -> base_link should only be produced by the localization package.
**
Edit:
**
After reading from many resources, I have rearranged my tf tree as in the link.
My visual odometry msg is:
rostopic echo -n1 /t265/odom/sample
header:
seq: 143978
stamp:
secs: 1648741517
nsecs: 288775444
frame_id: "t265_odom_frame"
child_frame_id: "t265_pose_frame"
pose:
pose:
position:
x: -0.6457403898239136
y: -0.2904374897480011
z: -0.03084297850728035
orientation:
x: -0.013879550620913506
y: -0.009088587947189808
z: -0.9964107275009155
w: 0.08300896733999252
covariance: [0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0001, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0001, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0001]
twist:
twist:
linear:
x: -0.002801669730148961
y: 0.0014666232674908119
z: -0.0010684610544884003
angular:
x: -6.915069864478318e-05
y: 0.000590384206814675
z: -0.0017910302528019177
covariance: [0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0001, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0001, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0001]
My wheel encoder message is:
rostopic echo -n1 /odom_data_quat
header:
seq: 36090
stamp:
secs: 1648741577
nsecs: 641369521
frame_id: "t265_odom_frame"
child_frame_id: "t265_pose_frame"
pose:
pose:
position:
x: 1.3941340052752529
y: -0.7237769047886113
z: 0.0
orientation:
x: 0.0
y: 0.0
z: -0.9992252356195777
w: 0.039356428966556
covariance: [0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1]
twist:
twist:
linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0 ...