0
$\begingroup$

Rosanswers logo

Hello,

I'm trying to use robot_localization to fuse amcl_pose with encoder odom, and latter GPS. The experiment is basing on Turtlebot3, gazebo and ros2-foxy.

It's working well if the robot is moving. The problem is, amcl will stop sending amcl_pose if there's no movement, and then EKF will start to predict, causing map->odom TF drift to a fixed direction continuously.
If remove the amcl_pose from map ekf, the issue will not happen.

I know set the amcl param "update_min_a" and "update_min_d" will let it send amcl_pose continuously, but I believe it's a bad workaround. So is there a better way to fuse such kind of pose? e.g. amcl pose, or pose calculated by landmark like QR code on the ground.

AMCL config:

 amcl:
  ros__parameters:
    use_sim_time: False
    alpha1: 0.2
    alpha2: 0.2
    alpha3: 0.2
    alpha4: 0.2
    alpha5: 0.2
    base_frame_id: "base_link"
    beam_skip_distance: 0.5
    beam_skip_error_threshold: 0.9
    beam_skip_threshold: 0.3
    do_beamskip: false
    global_frame_id: "map"
    lambda_short: 0.1
    laser_likelihood_max_dist: 2.0
    laser_max_range: 100.0
    laser_min_range: -1.0
    laser_model_type: "likelihood_field"
    max_beams: 60
    max_particles: 2000
    min_particles: 500
    odom_frame_id: "odom"
    pf_err: 0.05
    pf_z: 0.99
    recovery_alpha_fast: 0.0
    recovery_alpha_slow: 0.0
    resample_interval: 1
    robot_model_type: "differential"
    save_pose_rate: 0.5
    sigma_hit: 0.2
    tf_broadcast: false
    transform_tolerance: 1.0
    update_min_a: 0.2
    update_min_d: 0.25
    z_hit: 0.5
    z_max: 0.05
    z_rand: 0.5
    z_short: 0.05

Global EKF config:

global_ekf:
  ros__parameters:
    frequency: 30.0
    use_sim_time: true
    two_d_mode: true
    publish_tf: true
    map_frame: map
    odom_frame: odom
    base_link_frame: base_link
    world_frame: map

    pose0: /amcl_pose
    pose0_config: [true,  true, false,
                   false, false, true,
                   false, false, false,
                   false, false, false,
                   false, false, false]

    odom0: /odom_raw
    odom0_config: [false, false, false,
                   false, false, false,
                   true, false, false,
                   false, false, true,
                   false, false, false]

Odom EKF config: (Gazebo will not update odom->base_link tf, as I close it in the diff_drive_plugin )

odom_ekf:
  ros__parameters:
    frequency: 30.0
    use_sim_time: true
    two_d_mode: true
    publish_tf: true
    map_frame: map
    odom_frame: odom
    base_link_frame: base_link
    world_frame: odom


    odom0: /odom_raw
    odom0_config: [false, false, false,
                   false, false, false,
                   true, false, false,
                   false, false, true,
                   false, false, false]

Originally posted by xingjl6280 on ROS Answers with karma: 26 on 2021-08-27

Post score: 0


Original comments

Comment by angello on 2022-05-27:
hey, i'm having some similar issues with my college work, do you have a github with your work? could you send me? my email: [email protected]

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

it is because I didn't give Y linear velocity in odom0. Issue resolved


Originally posted by xingjl6280 with karma: 26 on 2021-09-01

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.