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

Robot localization Ignoring IMU

asked 2020-09-17 06:17:15 -0500

nalistic gravatar image

updated 2021-04-24 02:31:36 -0500

miura gravatar image

I Have tried to followed all the information available in the forum regarding imu and robot localization without luck. Context: I am using the Robot localization package to fuse my IMU with my encoders. I have tried increasing the robot localization threshold, and set all the parameters, I have checked the /diagnostic topic and it says the package should be running fine, i have enabled debugging to find the errors but i am not being able, i attach the debug information returned, the demo was running with the robot still in place and moving the imu.

here are the logs from robot localization https://justpaste.it/7vwyf

and here my configuration of the robot localization package

frequency: 30
two_d_mode: true
publish_tf: false

base_link_frame: base_link
world_frame: map
map_frame: map
odom_frame: odom

imu0: Imu
imu0_config: [false, false, false,
          false,  false,  true,
          false, false, false,
          false,  false,  true,
          true,  false,  false]

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

odom0_differential: true

imu0_linear_acceleration_rejection_threshold: 100
imu0_pose_rejection_threshold: 10
imu0_angular_velocity_rejection_threshold: 10
debug: true
debug_out_file: /home/add/Escritorio/Test


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.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.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.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.025, 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.025, 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.04, 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.01, 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 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-09-17 10:11:56 -0500

JackB gravatar image

updated 2020-09-26 10:13:23 -0500

You have imu0_differential: true which is going to take the derivative of the of the two terms that your IMU is providing you (omega_z and a_x). If you take the derivative of those they are going to become angular acceleration and jerk respectively, both values which the filter does not use. Set imu0_differential: false and you should see the correct behavior assuming nothing else is wrong. Please let us know!

The Real Answer: The problem was that the tf tree had been configured to have multiple odom frames contrary to best practices established in REP105. Also the configuration file above had the world_frame set to "map", when it needs to be set to "odom" for a robot_localization node producing the odom->base_link tf.

edit flag offensive delete link more

Comments

Thanks a lot for the response! Ill test tommorrow early in the morning and update the post.

nalistic gravatar image nalistic  ( 2020-09-17 10:32:55 -0500 )edit

I have already test it without luck no different appreciated,

here i am sharing what the robot localization debug returns for the imu (while wheels encoders are posting 0) https://justpaste.it/7vwyf

also here is my tf in case it is something wrong wih it

transforms.push_back(tf::StampedTransform(
     tf::Transform(tf::Quaternion(0, 0, 1, 0), tf::Vector3(0.15, 0.0, 0.15)),
    ros::Time::now(),"base_link", "laser"));
transforms.push_back( tf::StampedTransform(
    tf::Transform(tf::Quaternion(0, 0, 1, 0), tf::Vector3(0.0, 0.0, 0.0)),
    ros::Time::now(),"base_link", "imu_link"));

the imu messages and the odometry (encoders) look fine, they are in the odom and imu_link frames

nalistic gravatar image nalistic  ( 2020-09-18 02:48:07 -0500 )edit

Just a tip, do rosrun tf view_frames to get a graphical output of the frames. I have found many problems using this tool that I would not have otherwise. I will try to read that debug output when I have a chance today.

JackB gravatar image JackB  ( 2020-09-18 08:31:08 -0500 )edit

It doesnt let me upload the view_frame to ros anwers, but maybe my issue is with the tf, the odom_raw is an odometry message with child_frame_id "odom_raw" and frame_id "base_link", is that set up correct? since there is no parent_frame_id thats the only solution i managed to make the odom_raw (odometry from encoders) child of the base link

nalistic gravatar image nalistic  ( 2020-09-21 06:59:08 -0500 )edit

In order to conform with REP 105 and the best practice of the robot_localization package your odom_raw odometry message should have the frame_id=odom and child_frame_id=base_link.

JackB gravatar image JackB  ( 2020-09-21 07:57:05 -0500 )edit

More generally, the only "discretionary" frames you should have, considering that we are not super users, are the frames below base_link. Above base_link it should always be map->odom->base_link. If you are ever tempted to change this idea, by adding "odom_raw" as a frame or something else like that, you should second guess yourself.

JackB gravatar image JackB  ( 2020-09-21 08:04:09 -0500 )edit

But right now I have 2 odometry sources and the odometry filtered result from the package, all odometry sources should be in the same Odom frame?

nalistic gravatar image nalistic  ( 2020-09-21 08:05:16 -0500 )edit

For this case yes. Your robot only has one odom frame no matter what happens, the same way it has only one base_link or map frame.

JackB gravatar image JackB  ( 2020-09-21 08:09:17 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-09-17 06:17:15 -0500

Seen: 421 times

Last updated: Sep 26 '20