cartographer-project / cartographer_ros

Provides ROS integration for Cartographer.
Apache License 2.0
1.65k stars 1.2k forks source link

Using TF odometry instead of `/odom` #1817

Open aalbaali opened 6 months ago

aalbaali commented 6 months ago

I am using Cartographer for 2D SLAM using a single lidar and wheel encoders. I have my map frame set to map and tracking frame set to base. The issue I have is that the /tf: map -> odom produced by cartographer is jittery, and I'm not certain what's the cause.

I have two sources of odometry, so that may be the reason why this issue is taking place. Specifically, I have odometry being published on /odom (child frame being base_link and not base), and I have odometry published on tf: odom->base. Furthermore, the odometry on the /odom topic is noisier than the one on the /tf topic. My questions are as follows:

  1. Is it possible to configure Cartographer so that it uses the /tf: odom->base topic instead of using /odom (when setting use_odometry: true?
  2. Given that the odometry on the /odom topic is from the odom frame to the base_link (and not base) frame, does Cartographer take that into account (i.e., does it compute the odom->base transform using the base_link->base from the /tf tree) or does it automatically assume that the /odom messages are to the base frame?

I appreciate your help.