Fusing two odoms (VO) using robot_localization
Hi,
I am fairly new to using robot_localization
. I am trying to fuse odometry from two visual odometry sources (i.e. stereo cameras) in my robot’s reference frame. The setup is drawn here
I have drawn the tf tree here
I am not sure as to how I should proceed to fuse the two odometry sources as there is no tf base_link-->odom1
and base_link-->odom2
I can work out the static tf between base_link-->base1
and base_link-->base2
, but then base_link becomes the parent to base1 and base2 and I lose the base_link-->odom1
and base_link-->odom2
tf
I have searched for an answer among similar posts, but haven’t been able to get a solution. I am pretty sure I am missing something very basic, but I can't point it out. Kindly advise.
Your tree should look like map->odom_filtered->base_link->... not base_link->odomX. Take the odometry message of source1 (I asume its camera centered, so frame_ID would be "camera1_base") fuse it in robot_localization ekf (link text with odom2 and output the fused data (ekf output) in odom_filtered frame.
@Dragonslayer Hi. I fell asleep before I could tag you and you beat me to it. So welcome to the post. I am starting from the basics. My config file for robot_localization is below. But I am still confused what needs to go in for
odom_frame, base_link_frame, map_frame, world_frame
?For the sake of simplicity, the frame names for camera1 are
cam1_odom->cam1_base->cam1_optical...
and the frame names for camera2 arecam2_odom->cam2_base->cam2_optical...
and the PC is thebase_link
@Dragonslayer: I get the following warning messages repeatedly when I run the localization node with the frames set to
Warnings:
In a way I would expect these errors because there are no tf which would establish a relation between cam1 tree, cam2 tree, and base_link. :/
You dont need the cam1 and cam2 tree. just a urdf for the robot model, base_link up to the frame the cams odometries are in reference to (camera_linkX or cam1_base or whatever its called).
@Dragonslayer So, I turned off the tf between the
camX_odom --> camX_base
. I then modified the robot urdf to publishbase_link --> camX_base
urdfs. Now my tf tree looks like this.And now when I try to run robot_localization, I get the following warn message repeatedly:
This I would expect too, since there is no tf to relate cam1_odom to any other frames. Do I need to manually publish the inverse tf from camX_base --> camX_odom?
Are you sure its ekf node that sends the warn? What does your /camera1/odom message look like (frame_ID)? Likely somewhere in your setup some node is looking for cam1_odom but your odom frame now is odom or odom_filtered whatever you put in the ekf parameter odom_frame. You dont get a cam2_odom warning?
@Dragonslayer The warning messages only start when I start the ekf node and in the same window where ekf is running. The
odom_frame
in ekf config is set toodom
. Here is the config-file for ekf node. If I change the order of odom in config i.e. putodom0: /camera2/odom
andodom1: /camera1/odom
, the warning message change to cam2_odom warnings instead of cam1_odom warnings:This is what the /camera1/odom message looks like: