robot_localization - gps and imu minimal example not working
I have some trouble getting robot_localization
working. I have tried several configurations but nothing gives me a good result. So I thought I would try to get the minimal working. I have gps data and imu data. I also have wheel odometry. All this is simulated and all the values are currently almost ideal (no or very small noise). I use navsat with the following conf:
navsat_transform:
frequency: 30
delay: 3.0
magnetic_declination_radians: 0 #
yaw_offset: 0
zero_altitude: true
broadcast_utm_transform: true
publish_filtered_gps: true
use_odometry_yaw: true
wait_for_datum: false
And then I use one ekf node with the following conf:
odom0: odom
odom0_config: [false, false, false,
false, false, false,
true, true, true,
false, false, false,
false, false, false]
odom0_queue_size: 10
odom0_nodelay: true
odom0_differential: false
odom0_relative: false
odom1: odometry/gps
odom1_config: [true, true, false,
false, false, false,
true, true, true,
false, false, false,
false, false, false]
odom1_queue_size: 10
odom1_nodelay: true
odom1_differential: false
odom1_relative: false
imu0: imu/data
imu0_config: [false, false, false,
true, true, true,
false, false, false,
true, true, false,
true, true, true]
imu0_nodelay: false
imu0_differential: false
imu0_relative: false
imu0_queue_size: 10
imu0_remove_gravitational_acceleration: true
The conf is pretty taken from the examples.
I have static transform for map
-> odom
(they are exactly the same). ekf publishes odom
-> base_link
transform. The latitude-longitude are exactly aligned with y and x axis.
Wheel odometry is in odom topic.
The problem I am facing: when there is no movement, the filtered odometry (also the transform from odom
to base_link
) starts moving slowly (the robot itself is not moving). When the robot is moving, everything gets messy pretty quickly.
I have tried to exclude imu, odom, change covariance, all the other parameters. What is my problem here? I would like to get a minimal example working, which would mainly use GPS.
EDIT:
To be exact, the movement of the transform grows strangely. Here are some example of my tf topic (two consecutive messages, we use base_footprint instead of base_link):
header:
seq: 0
stamp:
secs: 7
nsecs: 200000000
frame_id: odom
child_frame_id: base_footprint
transform:
translation:
x: 0.00408947608922
y: -0.0837722308319
z: 0.0
rotation:
x: 0.0
y: 0.0
z: 0.241644993047
w: 0.970364723872
header:
seq: 0
stamp:
secs: 7
nsecs: 250000000
frame_id: odom
child_frame_id: base_footprint
transform:
translation:
x: 0.215371691561
y: -0.862578741381
z: 0.0
rotation:
x: 0.0
y: 0.0
z: -0.574137811256
w: 0.818758678541
And after that it goes wild. The strange thing here is that the rotation also changes. Although imu sensor simulator should be pretty stable. And every time I run the simulator, it gets about the same results (about the same time).
Please provide sample input messages. Also, is there a reason you are fusing velocities from
/odometry/gps
, or is that a remnant from the examples?Thanks for the reply! Yes, gps odom comes from the examples. Comes out imu simulator was very wrong. Now I have managed to get IMU simulator working, everything seems to work just fine. But I will open a new question regarding the configuration.