turtlebot3 icon indicating copy to clipboard operation
turtlebot3 copied to clipboard

Odometry always has zero covariance

Open TakShimoda opened this issue 10 months ago • 2 comments

  1. Which TurtleBot3 platform do you use?

    • [x] Burger
    • [ ] Waffle
    • [ ] Waffle Pi
  2. Which ROS is working with TurtleBot3?

    • [ ] ROS 1 Kinetic Kame
    • [ ] ROS 1 Melodic Morenia
    • [ ] ROS 1 Noetic Ninjemys
    • [ ] ROS 2 Dashing Diademata
    • [ ] ROS 2 Eloquent Elusor
    • [x] ROS 2 Foxy Fitzroy
    • [ ] etc (Please specify your ROS Version here)
  3. Which SBC(Single Board Computer) is working on TurtleBot3?

    • [ ] Intel Joule 570x
    • [x] Raspberry Pi 3B+
    • [ ] Raspberry Pi 4
    • [ ] etc (Please specify your SBC here)
  4. Which OS you installed on SBC?

    • [ ] Raspbian distributed by ROBOTIS
    • [ ] Ubuntu MATE (16.04/18.04/20.04)
    • [ ] Ubuntu preinstalled server (18.04/20.04)
    • [x] etc (Please specify your OS here) Ubuntu 20.04.2 LTS
  5. Which OS you installed on Remote PC?

    • [ ] Ubuntu 16.04 LTS (Xenial Xerus)
    • [ ] Ubuntu 18.04 LTS (Bionic Beaver)
    • [x] Ubuntu 20.04 LTS (Focal Fossa)
    • [ ] Windows 10
    • [ ] MAC OS X (Specify version)
    • [ ] etc (Please specify your OS here)
  6. Specify the software and firmware version(Can be found from Bringup messages)

    • Software version: [x.x.x]
    • Firmware version: [x.x.x]
  7. Specify the commands or instructions to reproduce the issue.

I'm trying to collect odometry data as well as measurements (with a camera that's separate from what's provided in the turtlebot). I collect the odometry data by subscribing to the /odom topic which is of type nav_msgs/msg/Odometry, with a geometry_msgs/msg/PoseWithCovariance field that has the 36 entry covariance. However, it's always zero no matter how I move the robot. I also disabled IMU to make it accumulate drift more with ros2 param set /diff_drive_controller odometry.use_imu False, but it still gives 0 covariances.

As an aside, I had an issue of very large odometry values (in the magnitude of 10e204) which is the same as here and confirmed here. Instead of installing the new OpenCR firmware like in this latter issue, I fixed the issue that was recommended by another user by adding these lines and these lines to odometry.cpp and this and this to odometry.hpp, and then use this command ros2 topic pub -1 /pose_relocalization geometry_msgs/Point. Essentially this manually sets all 0's to the robot's initial position and it fixed the issue. I'm certain this shouldn't affect covariance as I don't modify anything other than the initial position with this command.

I was wondering how I could set these covariance values as I want to derive information matrices for consecutive odom poses. Could I make calculations based off the motion model for odometry? And would the off-diagonals be zeros?

Thanks

TakShimoda avatar Mar 05 '25 18:03 TakShimoda

Hi @TakShimoda The odometry initialization issue has been resolved. If you clone the Humble branch again, you should be able to see the initialized odom during bring-up.

The TurtleBot3 only uses wheel encoder-based odometry. In odometry.cpp, the source that provides the covariance values for the odom topic is commented out. If you'd like to customize the covariance, you can modify that part of the code. Thank you.

GyuH13 avatar Mar 11 '25 01:03 GyuH13

Thanks Gyu.

I'm assuming I can just take the constant values from here. There seems to be a to do to make it more accurate and possibly variable.

Do you have any pointers for resources I can try to implement to make it more accurate? I notice the quality in odom can vary at times, where RMSE for absolute pose error (APE) compared to ground-truth for the same movements can vary quite a lot, possibly due to slippage.

Thanks

TakShimoda avatar Mar 12 '25 20:03 TakShimoda