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

IMU without compas-Kinematic Only Fusion Issues

asked 2020-02-21 01:05:38 -0500

frkanyk gravatar image

Hello dear community,

Im trying to fuse IMU+kinematic model fusion with robot_localization package. My IMU sensor only measures lateral and longitudinal acceleration and yaw rate which also does not give covariances of measurements. On the other hand, I have 4 wheel encoder data which is used for kinematic bicycle model.

GOAL : The fusion of kinematic model's x-y position and velocity information with IMU yaw rate,x-y acceleration to achieve accurate lateral and longitudunal velocity, lateral acceleration,yaw rate in the car's COG direction.

PROBLEM : * IMU does not really contribute to lateral velocity while longitudunal velocity, lateral accelaration and yaw rate fusions are okay. So lateral velocity and yaw angle of odometry output is terrible. After a while when the robot is going straight lateral velocity is bigger more than 5m/s.*


This is how I filled empty covariance data of IMU message :

data2.orientation_covariance = (1e-9, 1e-9, 1e-9, 1e-9, 1e-9, 1e-9, 1e-9, 1e-9, 1e-9)

data2.angular_velocity_covariance = (1e-9, 1e-9, 1e-9, 1e-9, 1e-9, 1e-9, 1e-9, 1e-9, 1e-5)

data2.linear_acceleration_covariance = (1e-4, 1e-9, 1e-9, 1e-9, 0.5, 1e-9, 1e-9, 1e-9, 1e-9)


When I'm trying to fuse them in robot_localization package, IMU does not contribute to lateral velocity. And drift in IMU message causes really wrong fused lateral velocity . Also I observed two major problems in the "debug.txt" file generated by the package :

  1. Timestamp is sometimes same , so package says "delta is 0" in some correction steps like below,

    Measurement time is 1455209554.6450054646, last measurement time is 1455209554.6450054646, delta is 0
    
  2. Second is package states message is enqueued.

    3 measurements in queue.
    

I really don't know if it is a problem, because I guess the package uses older messages to predict next state which causes inaccurate estimations.


In my config file,

<node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization" clear_params="true">

  <param name="transform_time_offset" value="0.0001"/>
  <param name="transform_timeout" value="0"/>
  <param name="predict_to_current_time" value="true"/>
  <param name="publish_acceleration" value="true"/>


  <param name="map_frame" value="map"/>
  <param name="odom_frame" value="odom"/>
  <param name="base_link_frame" value="base_link"/>
  <param name="world_frame" value="odom"/>

  <!-- odom0 ve imu0 config axes order -->
  <!-- X Y Z -->
  <!-- R P Y -->
  <!-- X' Y' Z' -->
  <!-- R' P' Y' -->
  <!-- X'' Y'' Z'' -->
  <param name="odom0" value="/Kinematic_Odom"/>
  <rosparam param="odom0_config">[true,  true,  false,
                                  false,  false,  true,
                                  true,   true,  false,
                                  false,  false,  false,
                                  false,  false,  false]</rosparam>

  <param name="imu0" value="/imu_fixed"/>
  <rosparam param="imu0_config">[false,  false,  false,
                                 false,  false,  false,
                                 false,  false,  false,
                                 false,  false,  true,
                                 true,   true,  false]</rosparam>



  <param name="odom0_differential" value="false"/>   
  <param name="imu0_differential" value="false"/> 

  <param name="imu0_remove_gravitational_acceleration" value="false"/>
  <param name="print_diagnostics" value="true"/>

  <param name="debug" value="true"/>
  <param name="debug_out_file" value="/home/furkan/Desktop/debug.txt"/>

  <!-- config axes order -->
  <!-- X Y Z -->
  <!-- R P Y -->
  <!-- X' Y' Z' -->
  < ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2020-04-20 03:26:51 -0500

Tom Moore gravatar image

updated 2020-04-20 03:29:45 -0500

OK, there's a lot going on here. You should include one sample sensor message for every sensor input if you want to really get to the bottom of it.

First, robot_localization uses its own internal kinematic model. It's unidirectional, but if you do two things, it effectively is the unicycle model:

  1. Turn on two_d_mode (you have a car, so you really need to do this). As it is now, you are trying to estimate the pose in 3D, but only providing 2D data. The correlation between variables will cause all sorts of bad things to happen.
  2. (This is where you're having trouble) You need to feed a constant 0 value to the filter for Y velocity. If your car can't move laterally, then you can explicitly represent that using the sensor data. It looks like you are feeding the Y velocity from your odometry to the filter now, but something is clearly amiss, hence the need for your sensor data.

Next, you covariance values are all singular. As an example, consider your angular velocity covariance:

1e-9, 1e-9, 1e-9,
1e-9, 1e-9, 1e-9,
1e-9, 1e-9, 1e-5

That matrix cannot be inverted. For most sensors, you can/should just fill in the diagonal values (the variance). Same for the other two sensors.

Finally, you can use your own kinematic model and feed that in as pose data, but understand that the prediction step of the EKF is going to use its internal kinematic model, which won't agree with a Ackermann kinematics. So there will be some error introduced there.

Anyway, if you can, please post more information. Thanks.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-02-21 01:05:38 -0500

Seen: 112 times

Last updated: Apr 20 '20