0
$\begingroup$

Rosanswers logo

Hello everyone, I have been searching for a long time for my problem but still have not found a solution. I am using robot_localization with IMU data. My imu data is published to a topic /inertial_data with frame_id = "imu". The following is my configuration file

frequency: 30

sensor_timeout: 0.1

transform_time_offset: 0.0

two_d_mode: false

print_diagnostics: true

debug: false
debug_out_file: /home/mohak/catkin_ws/debug_file.txt

map_frame: map
odom_frame: odom
base_link_frame: base
world_frame: odom

use_control: true
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]

imu0: /inertial_data
imu0_config: [false, false, false,
              false,  false,  false,
              false, false, false,
              true,  true,  true,
              true,  true,  true]
imu0_nodelay: false

imu0_queue_size: 5
imu0_pose_rejection_threshold: 0.8
imu0_twist_rejection_threshold: 0.8
imu0_linear_acceleration_rejection_threshold: 0.8

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,    0,     0,     0,     0,    0,    0,
                              0,    0,    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,     0,     0,    0,    0,
                              0,    0,    0,    0,    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,    0,    0,
                              0,    0,    0,    0,    0,    0,    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,
                              0,    0,    0,    0,    0,    0,    0,    0,    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,    0,    0,    0,    0,    0,    0,    0,    0,     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,    0,    0,    0,    0,    0,    0,     0,     0,     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,    0,    0,    0,    0,     0,     0,     0,    0,    1e-9]

I am also publishing the transform between base_link and imu via a ßstatic_transform_publisher. On running the ekf_localization_node the odometry/filered topic displays the odometry messages with frame_id as odom and child_frame_id as "base" but the trasform tree does not show the appropriate transform as being published. The transform tree only shows the transform being published between imu and base and that too by ekf_se and not the static_transform_publisher. The transform tree is imu->base and odom is shown as a floating frame not connected to either.

EDIT: This is the tf tree published when I run the entire system: http://imgur.com/CPAxgOx

My robot_localization launch file is included from another launch file in a package called data_publisher. I am including both of the files here:

http://www.filedropper.com/datapublisher_1

http://www.filedropper.com/ekfimu

Thanks for the help in advance and sorry if it is too confusing


Originally posted by mohakbhardwaj on ROS Answers with karma: 13 on 2016-07-10

Post score: 1


Original comments

Comment by Arwen on 2016-07-13:
Can you post a tf tree of the frames you've got? There are several things that I suspect might be wrong like running static_transform_publisher that broadcasts the imu->base which is obviously wrong or even base_link_frame which is "base"... but first post that tf tree!

Comment by mohakbhardwaj on 2016-07-13:
@Arwen I have edited the answer to include an image of the tf tree. It shows the odom frame being published as not connected to any other frame but as a floating frame. The static transform publisher is used to publish the transform from the location where the imu is mounted on the system to the bas

Comment by Arwen on 2016-07-13:
It's a little spooky... your robot_localization parameters seem fine but it's strange that the tf tree shows that imu -> base is being broadcast by ekf_se, you may wanna post your robot_localization launch file and exact line you're using for running static_transform_publisher.

Comment by mohakbhardwaj on 2016-07-13:
@Arwen: Yes that seems very unnatural to me as well. I have included links the launch files in my original post now. I have a data_publisher package which has the responsibility of publishing the imu data (only rotation rates and linear accelerations in my case) as a sensor_msgs/Imu message

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Thanks to the information you've provided now I can help you solve your problem.

The ekf_localization_node that you run provides the transformation between odom and base, the static_transform_publisher instance also broadcasts transformation between imu and base. So this will be the result:

odom -> base , imu -> base

while the correct tf tree must be like this:

odom -> base -> imu

Your base frame has two parents which is clearly not possible. Each frame can only have one parent.

In your case, you are running static_transform_publisher with wrong input parameters.

    <node pkg="tf" type="static_transform_publisher" name="imu_to_robot_base" args="0 0 0 0 0 0 $(arg imu_frame_id) base 100" />

Just switch the parent and child frame in the input arguments and your problem should be solved. The result must be like this:

    <node pkg="tf" type="static_transform_publisher" name="imu_to_robot_base" args="0 0 0 0 0 0 base $(arg imu_frame_id) 100" />

Originally posted by Arwen with karma: 146 on 2016-07-14

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by mohakbhardwaj on 2016-07-14:
Thanks! It is now publishing the transform. I have one confusion thought, is there anything in the parameters file that I am missing for the robot_localization package to compute x,y,z position from the rates and accelerations only? It is constantly publishing the x,y,z position as zero

Comment by Arwen on 2016-07-15:
@mohakbhardwaj: I think you should start with a simpler configuration, currently you have set several advanced parameters and finding the exact problem is not that easy. By the way I haven't tested robot_localization with only a single imu, but I don't think the result would be satisfying.

$\endgroup$

Your Answer

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