ori-drs / allan_variance_ros

ROS compatible tool to generate Allan Deviation plots
BSD 3-Clause "New" or "Revised" License
496 stars 87 forks source link

Add imu data simulation to support evaluation of the calibration result #24

Closed kekeliu-whu closed 2 years ago

kekeliu-whu commented 2 years ago

There are several open source IMU instrinsic calibration tools. However the result of those tools varies a lot and the calibration result is difficult to evaluate.
So I create a tool to simulate IMU data by implementing IMU-Noise-Model then use the tools to calibrate simulated IMU data. After comparing IMU simulator configuration and calibration result, I found allan_variance_ros gives a good result.

Experiment steps

  1. Simulate IMU Data: Build the branch feature-support-imu-simulation and run rosrun allan_variance_ros imu_simulator imu-sim.bag config/simulation/imu_simulator.yaml to get simulated imu data imu-sim.bag;
  2. Compute calibration result: Use calibration tool to get imu.yaml.

    Result analysis

    Simulator configuration config/simulation/imu_simulator.yaml and result of allan_variance_ros fit very well, especially the noise_density.

config/simulation/imu_simulator.yaml

#Accelerometer
accelerometer_noise_density: 0.0025019929573561175 
accelerometer_random_walk: 6.972435158192731e-05
accelerometer_bias: 0.007

#Gyroscope
gyroscope_noise_density: 0.0001888339269965301 
gyroscope_random_walk: 2.5565313322052523e-06
gyroscope_bias: 0.006

rostopic: '/sensors/imu'
update_rate: 400.0

sequence_time: 11000

imu.yaml

#Accelerometer
accelerometer_noise_density: 0.002514275004256148 
accelerometer_random_walk: 7.839662376685361e-05 

#Gyroscope
gyroscope_noise_density: 0.00018857851446797772 
gyroscope_random_walk: 3.4044926542479456e-06 

rostopic: '/sensors/imu' #Make sure this is correct
update_rate: 400.0 #Make sure this is correct

Log graph of simulated data: acceleration gyro

I also test imu_utils, but get a bad result:

%YAML:1.0
---
type: IMU
name: xsens
Gyr:
   unit: " rad/s"
   avg-axis:
      gyr_n: 3.7434416456652866e-03
      gyr_w: 2.6282617430254198e-05
   x-axis:
      gyr_n: 3.7318006434153101e-03
      gyr_w: 2.5886094931213328e-05
   y-axis:
      gyr_n: 3.7504972327004698e-03
      gyr_w: 2.6307730658703765e-05
   z-axis:
      gyr_n: 3.7480270608800802e-03
      gyr_w: 2.6654026700845500e-05
Acc:
   unit: " m/s^2"
   avg-axis:
      acc_n: 4.9111024092767130e-02
      acc_w: 4.7116333895251159e-04
   x-axis:
      acc_n: 5.0225631388534600e-02
      acc_w: 4.2043757646841598e-04
   y-axis:
      acc_n: 4.8325112701115391e-02
      acc_w: 5.1573007305579790e-04
   z-axis:
      acc_n: 4.8782328188651393e-02
      acc_w: 4.7732236733332096e-04
kekeliu-whu commented 2 years ago

Result comparision between allan_variance_ros and imu_utils:

ground truth allan_variance_ros imu_utils
accelerometer_noise_density 0.0025019929573561175 0.002514275004256148 0.0024555512046383564
accelerometer_random_walk 6.972435158192731e-05 7.839662376685361e-05 0.009423266779050232
gyroscope_noise_density 0.0001888339269965301 0.00018857851446797772 0.00018717208228326434
gyroscope_random_walk 2.5565313322052523e-06 3.4044926542479456e-06 0.000525652348605084
raabuchanan commented 2 years ago

Thanks @kekeliu-whu ! I was just thinking about implementing something like this. I'll try to get reviewing this asap.

raabuchanan commented 2 years ago

Ok looks great, but I'm not able to build it because you haven't updated the CMakeLists.txt.

Can you add a line like: add_executable(imu_simulator src/ImuSimulator.cpp)

Thanks for the contribution

kekeliu-whu commented 2 years ago

Hi, I've added executable imu_simulator to CMakeLists.txt. Now users can generate simulated bag file by ./imu_simulator /path/to/output/bag_filename /path/to/simulation/config_filename.

goldbattle commented 2 years ago

Updating a section on the ReadMe with instructions would be greatly appreciated (e.g. how the "How to use" is formated). For example above the "Author" section: https://github.com/ori-drs/allan_variance_ros#author

kekeliu-whu commented 2 years ago

@goldbattle Due to my rusty English skills, it would be appreciated when you help to modify the readme if neccessary.

  1. Optinal Simulation We offer a tool to generate simulated bag file by simulation config file: rosrun allan_variance_ros imu_simulator [path_to_output_bag_file] [path_to_simulation_config_file]
raabuchanan commented 2 years ago

I've added some documentation in this PR and merged into master https://github.com/ori-drs/allan_variance_ros/pull/27

wbl17792615320 commented 1 year ago

Hello, in allan variance ros, why the data corresponding to the acceleration circle and the star can match the output result, while the data corresponding to the angular velocity circle and the star cannot match the output result, even several orders of magnitude worse. 你好,在allan_variance_ros中,为什么加速度的图里圆圈和星星对应的数据能符合输出结果,而角速度的图里圆圈和星星对应的数据不能匹配上输出结果,甚至差了几个数量级。

wbl17792615320 commented 1 year ago

This is my message under the original author, with my own results. Obviously the results you showed are the same as my question, but you didn 't mention it, I want to know how to analyze the results, the question should be out of me https://github.com/ori-drs/allan_variance_ros/issues/36 这是我在原作者下的留言,里面附有我自己的结果。显然您所展示的结果和我的问题一样,但您本没有提及,我想知道如何分析结果,问题应该是出在我这里