Robotics StackExchange | Archived questions

mpu6050+gmapping

Hi, I am trying to do gmapping using motors, encoders and MPU 6050 (I am using this library  https://github.com/fsteinhardt/mpu6050_serial_to_imu), to fusion the values i am using  robot localization package. When I used only  encoders values the map is  good. By using IMU the map overlapping Any idea how to fix this problem? C:\fakepath\IMG٢٠٢٠٠٣٢٠١٠٥٣٠١.jpg

The ekf_template. Yaml:
frequency: 50


sensor_timeout: 0.1

two_d_mode: false


transform_time_offset: 0.0


transform_timeout: 0.0


print_diagnostics: true

debug: false

debug_out_file: /path/to/debug/file.txt


publish_tf: true


publish_acceleration: false


#map_frame: map              # Defaults to "map" if unspecified
odom_frame: odom            # Defaults to "odom" if unspecified
base_link_frame: base_link  # Defaults to "base_link" if unspecified
world_frame: odom           # Defaults to the value of odom_frame if unspecified

odom0: /odom


#x     , y     , z,
#roll  , pitch , yaw,
#vx    , vy    , vz,
#vroll , vpitch, vyaw,
#ax    , ay    , az

odom0_config: [true,  true,  true,
               false, false, false,
               true, true, true,
               true, true, true,
               false, false, false]

odom0_queue_size: 2


odom0_nodelay: false


odom0_differential: false

odom0_relative: false

odom0_pose_rejection_threshold: 5
odom0_twist_rejection_threshold: 1

#x     , y     , z,
#roll  , pitch , yaw,
#vx    , vy    , vz,
#vroll , vpitch, vyaw,
#ax    , ay    , az


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

imu0_nodelay: false
imu0_differential: false
imu0_relative: true
imu0_queue_size: 5
imu0_pose_rejection_threshold: 0.8                 # Note the difference in parameter names
imu0_twist_rejection_threshold: 0.8                #
imu0_linear_acceleration_rejection_threshold: 0.8  #


imu0_remove_gravitational_acceleration: true

use_control: true

stamped_control: false

control_timeout: 0.2

control_config: [true, false, false, false, false, true]

acceleration_limits: [1.3, 0.0, 0.0, 0.0, 0.0, 3.4]

deceleration_limits: [1.3, 0.0, 0.0, 0.0, 0.0, 4.5]

acceleration_gains: [0.8, 0.0, 0.0, 0.0, 0.0, 0.9]

deceleration_gains: [1.0, 0.0, 0.0, 0.0, 0.0, 1.0]


process_noise_covariance: [0.05, 0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0.05, 0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0.06, 0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0.03, 0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0.03, 0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0.06, 0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0,    0.025, 0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0,    0,     0.025, 0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0,    0,     0,     0.04, 0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0,    0,     0,     0,    0.01, 0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0.01, 0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0.02, 0,    0,    0,
                           0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0.01, 0,    0,
                           0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0.01, 0,
                           0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0.015]


initial_estimate_covariance: [1e-9, 0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                              0,    1e-9, 0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                              0,    0,    1e-9, 0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                              0,    0,    0,    1e-9, 0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                              0,    0,    0,    0,    1e-9, 0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                              0,    0,    0,    0,    0,    1e-9, 0,    0,    0,    0,     0,     0,     0,    0,    0,
                              0,    0,    0,    0,    0,    0,    1e-9, 0,    0,    0,     0,     0,     0,    0,    0,
                              0,    0,    0,    0,    0,    0,    0,    1e-9, 0,    0,     0,     0,     0,    0,    0,
                              0,    0,    0,    0,    0,    0,    0,    0,    1e-9, 0,     0,     0,     0,    0,    0,
                              0,    0,    0,    0,    0,    0,    0,    0,    0,    1e-9,  0,     0,     0,    0,    0,
                              0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     1e-9,  0,     0,    0,    0,
                              0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     1e-9,  0,    0,    0,
                              0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     1e-9, 0,    0,
                              0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    1e-9, 0,
                              0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    1e-9]

Asked by dandolain on 2020-03-19 08:16:23 UTC

Comments

It'll be helpful if you can share the config file, also an image explaining the issue you're facing.

Asked by parzival on 2020-03-19 08:21:15 UTC

Try changing your config files. As per the documentation

  • If the odometry provides both position and linear velocity, fuse the linear velocity.
  • If the odometry provides both orientation and angular velocity, fuse the orientation.

Asked by parzival on 2020-03-20 08:31:33 UTC

Consider test "imu0_differential: true". I only get success after setting it to true.

Asked by dpetrini on 2020-03-26 06:29:00 UTC

I tried that but i didn't work.

Asked by dandolain on 2020-03-26 08:39:37 UTC

@dandolain did you try what I suggested?

Asked by parzival on 2020-03-26 08:43:38 UTC

@parzival, the enocders give me the orientation and the angular speed

Asked by dandolain on 2020-03-26 09:02:10 UTC

@dandolain as I said earlier, select linear velocity and orientation from your odometry messages.

Asked by parzival on 2020-03-26 09:13:57 UTC

@parzival, so what's the benefit from the imu if i will use the encider values only?

Asked by dandolain on 2020-03-26 09:42:37 UTC

@dandolain you "fuse" data from IMU. That's the benefit. The final value will be lesser than errors from individual sources. I highly recommend you read the entire documentation before proceeding ahead.

Asked by parzival on 2020-03-26 09:46:00 UTC

Please include a sample sensor message from every sensor input.

Asked by Tom Moore on 2020-05-05 02:52:07 UTC

Answers