Clarification on imu_fusion and ekf fusion

I am building 2d robot using RTABMap for slam, and robot_localization for fusing wheel odometry and and ZEDx odometry. Can someone confirm that if I set imu_fusion: true in positional tracking config, then there is no need to fuse IMU data through the robot_localization EKF and that IMU data is already accounted for in ~/odom? Secondarily, does it make sense to set pos_tracking_enabled: true in this setup?

Hi @harborhoffer,

I can confirm that when enabling the imu_fusion: true, this enables the VIO algorithms of the ZED SDK to fuse visual and inertial data, which will be available over ~/odom. You can then use the odometry from the ZED SDK and fuse it with any other sensors with robot_localization EKF.

Setting pos_tracking_enabled: true is also important to start the positional tracking module which computes the transforms in odom and map frames.

Thanks for the response @mattrouss. Indeed I am able to get localized on my map with RATBMap. However, it is only my base_link that is localized. The zed_camera_link remains connected to to the odom frame as it’s parent even though I have publish_tf to false. This results in odometry jumping all around. My URDF uses your example for mounting a zed camera to an existing robot and has the use_zed_localization set to false. Whatever I do I cannot get a TF tree of odom -> base_link -> zed_camera_link. What am I missing?

<xacro:arg name="use_zed_localization" default="false" />

<!-- Add a joint to connect the ZED Camera to the robot -->
  <xacro:if value="$(arg use_zed_localization)">
    <joint name="$(arg camera_name)_joint" type="fixed">
      <parent link="$(arg camera_name)_camera_link"/>
      <child link="base_link"/>
      <origin
        xyz="-0.12 0.0 -0.25"
        rpy="0 0 0"
      />
    </joint>
  </xacro:if>
  <xacro:unless value="$(arg use_zed_localization)">
    <joint name="$(arg camera_name)_joint" type="fixed">
      <parent link="base_link"/>
      <child link="$(arg camera_name)_camera_link"/>
      <origin
        xyz="0.12 0.0 0.25"
        rpy="0 0 0"
      />
    </joint>
  </xacro:unless>

@Myzhar, @mattrouss. I am a bit stuck here and I really need to know if there is wrapper bug or I have a bug. To summarize again, even though publish_tf is set to false, and my URDF defines a base_link -> camera_link" static connection , I still end up with an odom → camera_link` transform. Do you agree that this should not be possible?

Are you using ROS or ROS 2?

This is ROS2 with the ROS2 Wrapper.

In this case, you must force the publish_tf parameter to false by using the launch command because the launch file overrides the value in the yaml file:
ros2 launch zed_wrapper zed_camera.launch.py camera_model:=<your_camera_model> publish_tf:=false

To get a list of all the launch parameters you can use the command
ros2 launch zed_wrapper zed_camera.launch.py -s

Ugh. I misunderstood the launch file though I think it’s a bit confusing. I am passing in a custom config_path which I assumed would override any defaults params in the launch file, but it is actually the opposite. Now, for the config tuning I need, I have to manage some params with launch arguments and others in the config file. Thanks for the help.

You can disable the launch file override by commenting this line.