Robot localization doesnt affect pose in filtered odometry
Hi!
Im sending nav_msgs/Imu
from Arduino to ROS in topic /imu
. Its working properly. Im getting acceleration in X axis and angular velocity in Z axis. Header frame id is imu
Arduino sends ticks from encoders to ros node too. Node comuptes X linear velocity and Z angular velocity. Then publishes nav_msgs/Odom
to the /odom
topic. In my opinion velocities are computed properly too. Header frame id is odom
and child frame id is base_link
Units in messages meet requirements from REP103.
Im creating transform between base_link
and imu
<?xml version="1.0"?>
<launch>
<node pkg="tf" type = "static_transform_publisher" name="base_imu"
args="0 0 0 0 0 0 base_link imu 100" />
</launch>
Then im trying to fuse both measurements using ekf in robot_localization
package
My .yaml file is
frequency: 50
two_d_mode: true
publish_tf: false
odom_frame: odom
base_link_frame: base_link
world_frame: odom
odom0: /odom
odom0_config: [ false, false, false,
false, false, false,
true, true, false,
false, false, true,
false, false, false]
odom0_differential: false
imu0: /imu
imu0_config: [ false, false, false,
false, false, false,
false, false, false,
false, false, true,
true, false, false]
imu0_differential: false
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]
Im running ekf_localization_node
<?xml version="1.0"?>
<launch>
<node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization">
<rosparam command="load" file ="$(find mybot_gazebo)/config/ekf_localization.yaml" />
</node>
</launch>
ekflocalizationnode publishing nav_msgs/Odom
to the topic /odometry/filtered
I have a problem there, because only covariance matrix changes. Pose and Twist parts of Odometry message are always 0 and nothing changes as I move my robot. Do you know where could be the problem?
Thanks for possible solutions!
Asked by Marseiliais on 2019-11-06 06:50:54 UTC
Answers
you should change your odom0 and imu0 configurations to this :
odom0_config: [false, false, false,
false, false, false,
true, true, true,
false, false, true,
false, false, false]
imu0_config: [false, false, false,
false, false, true,
false, false, false,
false, false, true,
true, false, false]
Asked by Ahmed_Desoky on 2020-08-26 04:02:32 UTC
Comments
two_d_mode
is set to true, so the 3D variable fusion doesn't help for odom0
.
Asked by Tom Moore on 2020-08-31 03:46:44 UTC
Comments
Please post sample sensor message for every sensor input.
Asked by Tom Moore on 2020-01-06 05:22:01 UTC