ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Base link oscillating between Encoder odom and filtered odom from robot localization package

asked 2023-05-15 00:01:55 -0500

gowtham128 gravatar image

Hello,

I made a differential drive mobile robot using move base and it used encoder ticks from wheel encoder to calculate odometry and i used this package link text

The robot faced localization problem due to wheel slippage so, To improve localization i fused odom from wheel encoder and imu data from realsense L515 USing ROBOT_-LOCALIZATION PACKAGE. after fusing it the filtured odom is not accurate and the tf of base_link is keep oscillating between encoder /diif/odom and the /odom from robot localization. Also i rotated the robot wheel by keeping the robot stationary as a result both the odom is rotating.

BELOW IS MY EKF YAML FILE

After going through the robot localization documentation completly, I tried every example in the configuring robot localization docs page link text no improvement.

frequency: 30
two_d_mode: true
publish_tf: true
map_frame: map
odom_frame: odom
base_link_frame: base_link
world_frame: odom

# odom from the wheel encoders
odom0: /diff/odom
odom0_config: [false, false, false,
               false, false, true,
               true,  true,  false,
               false, false, false,
               false, false, false]

odom0_differential: true
#odom0_relative: true

imu0_remove_gravitational_acceleration: true
## IMU 0 data from the intel L515
imu0: /imu/dataa
imu0_config: [false, false, false,
              false, false, true,
              false, false, false,
              false, false, false,
              true,  false, false]
#imu_linear_acceleration_rejection_threshold: 0.5
#imu_angular_velocity_rejection_threshold: 0.5

#imu0_relative: false
imu0_differential: false

MY SAMPLE ODOM DATA (/diff/odom) generated from wheel encoders. which works pretty good, static output when the robot is not moving and tested it with BOX TEST

header: 
  seq: 1991
  stamp: 
    secs: 1683974534
    nsecs: 421610116
  frame_id: "odom"
child_frame_id: "base_link"
pose: 
  pose: 
    position: 
      x: -0.045909170121061965
      y: 0.0009563543501025512
      z: 0.0
    orientation: 
      x: 0.0
      y: 0.0
      z: -0.009476805004755682
      w: 0.9999550940751799
  covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
twist: 
  twist: 
    linear: 
      x: 0.0
      y: 0.0
      z: 0.0
    angular: 
      x: 0.0
      y: 0.0
      z: 0.0
  covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

For the imu data i using a l515 realsense camera's imu. i ran the following cmd

roslaunch realsense2_camera rs_camera.launch enable_gyro:=true enable_accel:=true

which publishes accleration and gyro in two topic below is accleration data

header: 
  seq: 38099
  stamp: 
    secs: 1683970284
    nsecs: 140621662
  frame_id: "camera_accel_optical_frame"
orientation: 
  x: 0.0
  y: 0.0
  z ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-05-26 14:05:27 -0500

chased11 gravatar image

Your sample odometry message has no covariance given to it. Therefore, the EKF will give it a very low covariance value, which is probably not accurate. You will have to go into the source code of your odom and IMU drivers and manually chanhge the covariance values so that they're accurate. If they aren't, it can cause the filter to oscillate. Also, since you're fusing the yaw value from both odom and IMU, you will want to have one of them set to relative or differential. Maybe try the latter first and see if it helps.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-05-14 14:25:08 -0500

Seen: 72 times

Last updated: May 26 '23