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

how to config robot_localization package?

asked 2019-01-04 03:50:58 -0500

Amos_RXQ gravatar image

I want to localize my robot with the robot_localization package. I have a IMU and wheel encoder to supply the imu data and odom data. When i use the robot_localization, and i control my robot with keyboard. The odom(filtered) will drift, if i rotate my robot. I cant figure out what problem i have made. Could anyone help me?

frequency: 30

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

odom0_config: [false,  false,  false,
               false, false, true,
               true, true, false,
               false, false, false,
               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

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

1 Answer

Sort by » oldest newest most voted
1

answered 2019-01-04 04:58:57 -0500

juanlu gravatar image

Hi! before answering let me point you to the robot localization wiki, which is great and has a lot of information and tips for this configuration. Also, this is a very complex problem that a lot of people, including me, struggles with and has spent a lot of hours trying to improve, so don't get discouraged!

I see a couple of problems with that config, the first one is the sensor config (odom0_config and imu0_config).

The odom0_config you have is:

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

Which sets to true(and therefore takes as input, discarding the rest) the yaw position and the speed in x and speed in y. Now, I don't know what kind of robot you have but you mention that you are using wheel encoders so I am going to asume that is some kind of ground based wheeled robot. In that case you have to see what information that /odom topic is providing and set to true the values that come from it. The configuration you have would work for a holonomic robot(using omniwheels for example), otherwise (diff drive, ackerman, etc) your odom config would need to be different and possible not trust the yaw position values nor speed in y (as it would have 0 always).

The imu0_config you have is:

imu0_config: [false, false, false,
              false,  false,  true,
              false, false, false,
              false,  false,  true,
              true, false, false]

Where you are using yaw position, yaw velocity and x acceleration. Again, check if that is information your imu is actually sending you because otherwise the node will integrate the data which is something that can cause drift. I would recommend you try using just yaw position or just yaw position and x acceleration.

It is also sometimes advisable to delegate forward movement information to odom and rotational movement to IMU, that would be only using x velocity in odom0 and only using yaw position in imu0 but that is not a solve-it-all solution.

I set all my imu and odom covariance as 0. Is there any problem with it?

If your imu and odom covariances are coming as 0 allways that means to the kalman filter that there is no uncertainty in them and therefore can "trust" them completely ignoring the internal model it has. This is not good because the odometry and imu sources are certaintly not 100% accurate and defeats the purpose of the kalman filter which can adapt to noisy sources.

Finally one other thing that rubs me the wrong way is the acceleration and deceleration limits you have for yaw speed (3.5 and 4.5m/s²) that seem to me a bit on the high side.

After this, go over the wiki for the robot localization node and read the description for each parameter you have to make sure it is within reasonable boundaries and if unsure of the parameter erase it, not all parameters are necessary to ... (more)

edit flag offensive delete link more

Comments

Thank you so much. It helps a lot.

Amos_RXQ gravatar image Amos_RXQ  ( 2019-01-06 21:06:14 -0500 )edit

Question Tools

Stats

Asked: 2019-01-04 03:50:58 -0500

Seen: 428 times

Last updated: Jan 04 '19