Robot_Localization , exploding covariances, why?
Hello dear ROS community. I'm trying to use robot_localization with the ekf node inorder to produce an accurate orientation of my robot using 3 IMUs. I wrote the program for the IMU (Sparkfun SEN-14001) myself and it works pretty good. The IMUs give euler angles with respect to a fixed world frame which is exactly what i need. I wrote a node (python) to read the data through serial from the IMUs and publish it to three topics named: imu_0, imu_1, imu_2 (sensor_msgs/imu).
when i launch the ekf node of robot localization and open up Rviz i can see my static transforms are ok but then orientation output from the ekf node is totally wrong and behaves randomly.
so, for now i switched off all the inputs except the pitch angle so that i can debug more easily.
anyone see what im doing wrong?
here are my files.
i dont have enough points to upload a picture of my tf tree unfortunately as im pretty new to ROS, but it goes:
odom -> base_link -> imu_0 -> [ imu_1 , imu_2 ]
my launch file:
<launch>
<node pkg="robot_localization" type="ekf_localization_node" name="ekf_se" clear_params="true">
<rosparam command="load" file="$(find robot_localization)/params/skyline_template.yaml" />
<!-- Placeholder for output topic remapping
<remap from="odometry/filtered" to=""/>
<remap from="accel/filtered" to=""/>
-->
</node>
<node pkg="tf2_ros" type="static_transform_publisher" name="base_link_to_imu0" args="0 0 0 0 0 0 base_link imu_0" />
<node pkg="tf2_ros" type="static_transform_publisher" name="imu0_to_imu1" args="0 -0.25 0 0 0 0 imu_0 imu_1" />
<node pkg="tf2_ros" type="static_transform_publisher" name="imu0_to_imu2" args="0 0.28 0 0 0 0 imu_0 imu_2" />
</launch>
my ekf.yaml:
frequency: 50
sensor_timeout: 1
two_d_mode: false
transform_time_offset: 0.0
transform_timeout: 0.0
print_diagnostics: true
debug: false
debug_out_file: /path/to/debug/file.txt
publish_tf: true
publish_acceleration: false
map_frame: map # Defaults to "map" if unspecified
odom_frame: odom # Defaults to "odom" if unspecified
base_link_frame: base_link # Defaults to "base_link" if unspecified
world_frame: odom # Defaults to the value of odom_frame if unspecified
###################################################
imu0: imu0
imu0_config: [false, false, false,
false, true, false,
false, false, false,
false, false, false,
false, false, false]
imu0_nodelay: false
imu0_differential: false
imu0_relative: true
imu0_queue_size: 1
imu0_pose_rejection_threshold: 0.8 # Note the difference in parameter names
imu0_twist_rejection_threshold: 0.8 #
imu0_linear_acceleration_rejection_threshold: 0.8 #
imu0_remove_gravitational_acceleration: true
####################################################
imu1: imu1
imu1_config: [false, false, false,
false, true, false,
false, false, false,
false, false, false,
false, false, false]
imu1_nodelay: false
imu1_differential: false
imu1_relative: true
imu1_queue_size: 1
imu1_pose_rejection_threshold: 10 # Note the difference in parameter names
imu1_twist_rejection_threshold: 10 #
imu1_linear_acceleration_rejection_threshold: 10 #
imu1_remove_gravitational_acceleration: true
####################################################
imu2: imu2
imu2_config: [false, false, false,
false, true, false,
false, false, false,
false, false, false,
false, false, false]
imu2_nodelay: false
imu2_differential: false
imu2_relative: true
imu2_queue_size: 1
imu2_pose_rejection_threshold: 10 # Note the difference in parameter names
imu2_twist_rejection_threshold: 10 #
imu2_linear_acceleration_rejection_threshold: 10 #
imu2_remove_gravitational_acceleration: true
####################################################
use_control: false
stamped_control: false
control_timeout: 0.2
control_config: [false, false, false, false, false, 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 ...
just making sure: the
sensor_msgs/Imu::orientation
is aQuaternion
, not a 3 tuple of Euler angles. Is that correctly implemented in your Imu driver?yes thank you, im using the built in function of tf to do that: q=tf.transformations.quaternion_from_euler(roll,pitch,yaw) then x=q[0] y=q[1] and so on..