How to set up 2D pose with IMU and odometry using robot localization ekf?

56 Views Asked by At

I have a differential drive robot, it is a 4wd robot, 2 motors, 2 encoders,s it behaves like a differential robot actually. Odometry from encoders is working well. I'm using ROS2 Humble on ubuntu 22.04.

I want to fuse odom, with an IMU to get a nice 2d pose (lokalisation)

So, I have done all the transform and got the odom and IMU topics. Which are the followings ODOM topic:

header: stamp: sec: 1708934625 nanosec: 68893329 frame_id: odom child_frame_id: laser_link pose: pose: position: x: 0.9908038973808289 y: -3.18342661857605 z: 0.0 orientation: x: 0.0 y: 0.0 z: 0.808424464005272 w: 0.5885999371370919 covariance:

  • 8.632683822477702e-05
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 8.632683822477702e-05
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 8.632683822477702e-05
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 8.632683822477702e-06
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 8.632683822477702e-06
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 8.632683822477702e-06 twist: twist: linear: x: 0.05744318664073944 y: -0.010725230909883976 z: 0.0 angular: x: 0.0 y: -0.0 z: 0.046282440423965454 covariance:
  • 4.316341911238851e-05
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 4.316341911238851e-05
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 4.316341911238851e-05
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 4.316341911238851e-06
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 4.316341911238851e-06
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 0.0
  • 4.316341911238851e-06

AND IMU topic

header: stamp: sec: 1708934700 nanosec: 58079488 frame_id: camera_imu_optical_frame orientation: x: -0.564959732796857 y: -0.32758730601200314 z: 0.3634408670297931 w: 0.664392800555917 orientation_covariance:

  • 0.0004
  • 0.0
  • 0.0
  • 0.0
  • 0.0004
  • 0.0
  • 0.0
  • 0.0
  • 0.0004 angular_velocity: x: 0.0 y: -0.006981316953897476 z: 0.0 angular_velocity_covariance:
  • 0.01
  • 0.0
  • 0.0
  • 0.0
  • 0.01
  • 0.0
  • 0.0
  • 0.0
  • 0.01 linear_acceleration: x: 0.22555294632911682 y: -9.728196144104004 z: 1.4808040857315063 linear_acceleration_covariance:
  • 1.0
  • 0.0
  • 0.0
  • 0.0
  • 1.0
  • 0.0
  • 0.0
  • 0.0
  • 1.0

So Im not sure about the correct EKF yamil config file.

My suggestion was this config

    odom0: /odom/icp
    odom0_config: [true, true, true,  # pose position (x, y, z)
           true, true, true, true,  # pose orientation (quaternion x, y, z, w)
           false, false, false, false, false, false,  # pose covariance
           true, true, false]

    imu0: /imu/data
    imu0_config: [false, false, false,
                  true,  true,  false,
                  false, false, false,
                  false, true, false,
                  true, true, false]

But not sure if the correct one. Any help?

0

There are 0 best solutions below