Ask Your Question
0

robot_localization tutorial with Turtlebot3 in ROS2 Foxy

asked 2021-02-18 08:17:07 -0500

cocodmdr gravatar image

updated 2021-02-19 03:23:11 -0500

Hello,

I am trying to make a simulation tutorial with Turtlebot3 waffle in the Turtlebot world that uses the robot_localization package.

image description

I am using ROS2 Foxy.

The goal is to use dual ekf with navsat transform node in order to use GPS position. For now I am only trying to use a simple ekf fusion of wheel odometry and IMU.

However I believe the fusion is not working well. See results on the picture: image description

  • In green is the pose given by the turtlebot3 diff drive wheel encoders in simulation.
  • In blue is the pose given by the fusion of IMU and wheel odometry.

Could someone give me advice on how to properly tune the ekf parameter?

Please try my package(only first example for now), I hope the README is good enough : https://github.com/cocodmdr/turtlebot...

If I can make this simulation work, I would be pleased that it could help others start with robot_localization package.

Here is the output of rqt_graph : image description

Here is my tf tree : image description

Here is my ekf.yaml parameter file:

ekf_filter_node:
    ros__parameters:
        frequency: 30.0
        sensor_timeout: 0.1
        two_d_mode: true
        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
        reset_on_time_jump: true

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

        odom0: wheel/odometry

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

        #        [x_pos   , y_pos    , z_pos,
        #         roll    , pitch    , yaw,
        #         x_vel   , y_vel    , z_vel,
        #         roll_vel, pitch_vel, yaw_vel,
        #         x_accel , y_accel  , z_accel]

        odom0_queue_size: 2
        odom0_nodelay: false
        odom0_differential: false
        odom0_relative: false
        odom0_pose_rejection_threshold: 5.0
        odom0_twist_rejection_threshold: 1.0

        imu0: imu/data
        imu0_config: [false, false, false,
                      true,  true,  true,
                      false, false, false,
                      true,  true,  true,
                      true,  true,  true]
        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: false
        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,    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,    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,    0.0,    0.0,    0.0,    0.0,
                                   0.0,    0.0,    0.0,    0.03, 0.0,    0.0,    0 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-03-25 04:44:56 -0500

Tom Moore gravatar image

Thank you for including a config file and sensor messages.

Try these:

  1. Get rid of the rejection threshold parameters (don't just delete them from the config file, either - if you are already running, you need to clear those parameters from the parameter server). Those are advanced parameters that you should use after the system is behaving generally as you expect.
  2. As a test, don't fuse the IMU data. Just fuse the wheel encoder velocities. Make sure it more or less matches the raw wheel encoder values. If it does, then the issue is with the IMU data. Try including one IMU variable (e.g., yaw velocity) and run again. Does it still work? Try including another one.
  3. Unrelated to your problem, but you have two_d_mode turned on (which is fine), but you are trying to fuse 3D orientation variables in your IMU config. You can set the roll, pitch, roll velocity, pitch velocity, Y acceleration, and Z acceleration values to false.
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-02-18 08:17:07 -0500

Seen: 655 times

Last updated: Mar 25 '21