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

robot_localization:The translation and rotation data of /odometry/filtered does not look smooth.

asked 2020-09-28 03:51:32 -0500

april_zhao425 gravatar image

updated 2020-09-28 03:56:27 -0500

I'm tring to fusing the imu data and the visual odometry data. I hope the imu data can be helpful to the visual odometry data,make the visual odometry data more stable. But the result seems like awful. Here is the robot_localization configuration:

<launch>
<param name="/use_sim_time" value="true" />

<node pkg="rosbag" type="play" name="rosbagplay" args="/home/nova/0/src/to_rosbag/output.bag --clock -d 5" required="true"/>

<node name="a" pkg="robot_localization" type="ekf_localization_node" clear_params="true">

  <param name="frequency" value="100"/>
  <param name="sensor_timeout" value="0.001"/>
  <param name="two_d_mode" value="false"/>

  <param name="odom_frame" value="odom"/>
  <param name="base_link_frame" value="base_link"/>
  <param name="world_frame" value="odom"/>

  <param name="transform_time_offset" value="0.0"/>
  <param name="transform_timeout" value="0.0"/>

  <param name="odom0" value="/data"/>
  <param name="imu0" value="/imu/data"/>

  <rosparam param="odom0_config">[true, true, true,
                                  true, true, true,
                                  false,  false,  false,
                                  false, false, false,
                                  false, false, false]</rosparam>

  <rosparam param="imu0_config">[false, false, false,
                                 true,  true,  false,
                                 false, false, false,
                                 true,  true,  false,
                                 false,  false,  false]</rosparam>

  <param name="odom0_differential" value="false"/>
  <param name="imu0_differential" value="false"/>

  <param name="odom0_relative" value="false"/>
  <param name="imu0_relative" value="false"/>

  <param name="imu0_remove_gravitational_acceleration" value="true"/>

  <param name="print_diagnostics" value="true"/>

  <param name="odom0_queue_size" value="10"/>
  <param name="imu0_queue_size" value="10"/>

  <param name="dynamic_process_noise_covariance" value="false"/>
  <param name="predict_to_current_time" value="false"/>


  <param name="debug"           value="false"/>
  <param name="debug_out_file"  value="debug_ekf_localization.txt"/>


  <rosparam param="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 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2020-09-28 08:11:38 -0500

JackB gravatar image

updated 2020-09-28 08:12:42 -0500

It looks like your imu is adding some noise into the system. In my experience, unless conditions are perfectly correct, the imu can potentially degrade the quality of your estimate. That being said:

1) If you are only traveling in 2D, set two_d_mode to true.

2) Your covariances are so small right now (from what I see) that you are essentially forcing the filter to integrate every measurement directly. If you can increase the size of the measurement covariances I think you will get a more smooth behavior

3) It looks like your IMU does not even generate linear velocity, but you specify in <rosparam param="imu0_config"> that you do. You should switch this to accept the angular velocity, which it looks like your IMU does generate.

4) I assume your odom message usually has a linear velocity and it just is empty here because the robot was stationary when you took that screenshot?

5) Make sure you IMU is configured correctly and has the right base_link tf. It seems that it introduces a very consistent bias, which is not the behavior I would expect for a properly configured IMU adding random noise.

6) Make you sensor timeout larger, maybe 0.5 seconds, I don't think your filter can/should be running that fast

I hope someone else can answer your question directly, but these are my thoughts with respect to my personal experience which I think may be of some help.

edit flag offensive delete link more

Comments

Hi JackB! Thank you for your answer. I tried your suggestion. Here is my feedback:

1) I am not using it in 2D.

2) I reduced the measurement covariances of the IMU, but the results did not become smooth. Actually, I hope imu can make odom more stable.

3)If I understand correctly, the fourth line of imu0_config represents the angular velocity. In my configure file, I only set the angular velocity to true.

4) My odom message only has position and orientation data.

5) My imu is placed on the top back of the camera that generates odom data. Do I need to calibrate the R T between imu and camera? Then set the tf transform between imu and camera through static_transform_publisher?

6) I set the value of sensor_timeout to 0.5,but the result did not change.

Look forward to your reply.

april_zhao425 gravatar image april_zhao425  ( 2020-09-29 01:10:39 -0500 )edit

1) I think 3D is hard with limited measurements like this but I look forward to hearing how it works

2) INCREASE, not reduce the measurement covariance. When you decrease it you are saying "hey trust the measurement more!", but I think it may be helpful to increase it and say "hey you can still trust me, but not so much..."

3) You are correct, that was my mistake. But it looks like your IMU does not generate angular position, so you should make the 2nd line of imu0_config false, right?

4) Ok.

5) If you IMU does not already have a tf that somehow connects it to base_link, then that is a problem. It can be through the camera or some other intermediary frame, but it must exist, and it must accurately transform the IMU xyz/rpy coordinate frames into your base_link coordinate frame. A static_transform_publisher is the way ...(more)

JackB gravatar image JackB  ( 2020-09-29 08:19:25 -0500 )edit

@april_zhao425 any followup?

JackB gravatar image JackB  ( 2020-10-01 07:24:05 -0500 )edit

Sorry for my late reply.

2)Sorry, I worte wrong. I increased the covariance of the imu.

5) I corrected the imu’s data coordinates as defined in REP_103. Valuing the bace_link to the FRAME_ID of the IMU. I always thought that the frame_id for IMU was base_link and the frame_id for visual odometry was odom. Do you mean that there must be a TF between imu and base_link?

april_zhao425 gravatar image april_zhao425  ( 2020-10-08 21:47:13 -0500 )edit

Unless your IMU is actually really positioned at the point on the robot where you defined the base_link, then there should be an IMU describing the transformation from the imu to your base_link

JackB gravatar image JackB  ( 2020-10-11 08:57:08 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-09-28 03:51:32 -0500

Seen: 419 times

Last updated: Sep 28 '20