Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Oct 18, 2022
Merged

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

merged 3 commits into from
Oct 18, 2022

Conversation

flex-transformer
Copy link
Contributor

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

@flex-transformer
Copy link
Contributor Author

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
Copy link
Collaborator

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

@raabuchanan
Copy link
Collaborator

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

@flex-transformer
Copy link
Contributor Author

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.

Copy link
Collaborator

@raabuchanan raabuchanan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for the contribution!

@raabuchanan raabuchanan merged commit 5b06010 into ori-drs:master Oct 18, 2022
@goldbattle
Copy link
Contributor

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

@flex-transformer
Copy link
Contributor Author

@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
Copy link
Collaborator

raabuchanan commented Oct 19, 2022

I've added some documentation in this PR and merged into master
#27

@flex-transformer flex-transformer deleted the feature-support-imu-simulation branch October 19, 2022 10:57
@wbl17792615320
Copy link

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
Copy link

wbl17792615320 commented Jun 19, 2023

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
#36
这是我在原作者下的留言,里面附有我自己的结果。显然您所展示的结果和我的问题一样,但您本没有提及,我想知道如何分析结果,问题应该是出在我这里

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants