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

Some questions about imu_tools and robot_localization

asked 2020-09-30 22:08:02 -0500

elgarbe gravatar image

updated 2020-10-02 14:30:20 -0500

Hi, I'm trying to get imu_filter_madgwick and robot_localization in order to fuse imu (gyro+accel) and wheel odometry for my robot. First, imu_filter_madg. I have it working ok, I think. I have just one question about coordinate frames. My Imu is publishing in imu_link frame. I set

<param name="fixed_frame" value="base_link" />

so in my tf tree I have a transformation between imu_link and base_link published by imu_filter. But in fact imu_link and base_link are the same. Do I need to publish a static transformation from those frames? is it ok that imu_filter publish that transformation?

Second RL: I'm using this bag file and configuration file. I run

rosparam set use_sim_time true
roslaunch ekf_chori.launch
rosbag play chorirover_casa_09-2020.bag --clock
rostopic echo /odometry/filtered

and I get really bad position estimate and the covariance matrix seems to explode. am I doing something wrong?

The /Chori/odom topic is created by me uC frmware and published to ROS using rosserial. The same for the imu message. Orientation from wheel encoder is very poor that's why I just feed velocity to de filter.

Thank

EDIT: Thank to @martin-gunther and @JackB orientation part of the problem is solved.

Now I have a little problem with RL. this is my new bag file. In a terminal I run :

rosparam set use_sim_time true
roslaunch ekf_chori.launch

then in another terminal run

rosbag play chorirover_casa_09-2020.bag --clock

finally in another one run

rostopic echo /odometry/filtered

The first message gives a very high value on twist.linearvel.y (odometry from my robot inform 0 on this field)so the filter integrate it and get some position value on the Y axis. After some seconds, Vy tends to 0. The other problem is that X position start with a non 0 value. Am I configuring RL the wrong way?

thank

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2020-10-01 07:22:55 -0500

JackB gravatar image

The IMU and base_link should not be at the same position unless they really are the same position. Use a static_transform_publisher to represent the position of the imu relative to the base_link. For your case I think it would look something like:

 <launch>
         <node pkg="tf" type="static_transform_publisher" name="link1_broadcaster" args="x y z qx qy qz qw base_link imu_link 100" />
 </launch>

Make sure that the imu messages have their frame_id set to imu_link, and not base_link. The IMU itself is not publishing a transform. See static_transform_publisher for explanation of the command launch command above.

edit flag offensive delete link more

Comments

Taking into account of this (from here):

~fixed_frame (string, default: odom)
    The parent frame to be used in publish_tf. 

~publish_tf (bool, default: true)
    Whether to publish a TF transform that represents the orientation of the IMU, using the frame specified in fixed_frame as the parent frame and the frame given in the input imu message as the child frame.

should I set publish_tf=false on imu_filter_madgick and launch a static_transform_publisher like you suggest? I was setting fixed_frame = base_link, but they suggest "odom"...

elgarbe gravatar image elgarbe  ( 2020-10-01 20:33:07 -0500 )edit
1

Personally, I would set fixed_frame to base_link, publish_tf to false, and publish my own transform between imu_link and base_link. But there may be a reason, which I don't know, that they suggest their way as a best practice

JackB gravatar image JackB  ( 2020-10-01 20:56:00 -0500 )edit

Ok, I will try what you say. In fact odom->base_link will be published by RL. BTW, do you use RL?

elgarbe gravatar image elgarbe  ( 2020-10-01 21:18:02 -0500 )edit
1

You should definitely set publish_tf to false in imu_filter_madgwick - it's only there for debugging purposes. The TF transform should be published by robot_localization.

Martin Günther gravatar image Martin Günther  ( 2020-10-02 04:02:55 -0500 )edit

Thank you for some clarity Martin, and yes I use RL a lot @elgarbe. But of course I still always have more to learn.

JackB gravatar image JackB  ( 2020-10-02 07:05:23 -0500 )edit

I edit original question in order to get some help on RL part.

elgarbe gravatar image elgarbe  ( 2020-10-02 14:30:57 -0500 )edit

Question Tools

Stats

Asked: 2020-09-30 22:08:02 -0500

Seen: 329 times

Last updated: Oct 02 '20