The zero-based VIO - Allan variance Tools

1 Introduction

By learning "from scratch handwriting VIO" the second chapter, I gradually discovered that the contents of the course itself is not difficult to understand, the teacher's in place, but for me the biggest difficulty is environment configuration. If you give me a complete test environment for me to modify the code completion functions, it would be difficult to sag, the algorithm into actual code is not a very painful thing, at least be able to locate those places can be modified, and it was just questions. However, the algorithm will only just been far from satisfying the needs of the course, the so-called "scratch", that is, even the most basic libraries, tools, had to rely on from scratch. Just take Allan variance experiment, to share in this process of the experiment and the trouble encountered.

2. Overview

With regard to specific IMU and Allan variance theory we are not described here, mainly about the process of the experiment. The experiment is the use of random error Allan variance method calibration of IMU , IMU data used here is analog data provided by HE Bo, two points are most concerned about is the IMU gyroscopes and accelerometers. The actual data collection process in the IMU, produces two types of errors are generally divided into deterministic and random errors. Deterministic errors include offset, scale, coordinate axes due to a manufacturing error or the like does not perpendicular to each other resulting fine generated random errors including Gaussian white noise, bias random walk. So, to study variables, that is, gyroscopes and accelerometers respective Gaussian white noise and random walk .

3. Experiment

(1) Pre claim

ROS-kinetic: Follow the steps official website of the execution of tasks to complete the installation and initialization catkin_ws workspace. ROS to open the configuration is complete.

roscore

ceres solver: About Eigen and Sophus installation , refer to previous blog.
Then Ceres installation, you need cmake to compile:

sudo apt-get install liblapack-dev libsuitesparse-dev libcxsparse3.1.4 libgflags-dev libgoogle-glog-dev libgtest-dev
git clone https://github.com/ceres-solver/ceres-solver.git

Installation Matlab2018a, have not tried other versions, I do not know how compatibility.

(2) tools are mainly involved

Package involved a total of four, are code_utils , imu_utils , kalibr_allan , vio_data_simulation , after extracting all packets are placed catkin_ws / src of the path, to facilitate management. Code_utils which can be obtained through the README link imu_utils are available through the git clone command you can also go directly to github download. My suggestion is that each download a software package installed on a compilation.

https://github.com/gaowenliang/code_utils
https://github.com/gaowenliang/imu_utils
https://github.com/rpng/kalibr_allan
https://github.com/HeYijia/vio_data_simulation/tree/ros_version

Installation e.g. code_utils (Other Similarly):

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone https://github.com/gaowenliang/code_utils.git
cd ..
catkin_make

Compiler encountered a problem: there is no prompt matlab found. The solution is to find kalibr_allan / bagconvert / cmake / FindMatlab.cmake file, inside matlab path into the corresponding path on your machine.
FindMatlab.cmake part of the interface file

(3) generating a packet IMU

Find imu_utils the launch folder, create a new imu.launch file, and follow other launch file editing, aims to provide rostoic information.

cd ~/catkin_ws/src/imu_utils/launch/
vim imu.launch

imu.launch file contents are as follows, the most important to note that imu_topic and imu_name assignment:

<launch>
    <node pkg="imu_utils" type="imu_an" name="imu_an" output="screen">
    <param name="imu_topic" type="string" value= "imu"/>
    <param name="imu_name" type="string" value= "mytest"/>
    <param name="data_save_path" type="string" value= "$(find imu_utils)/data/"/>
    <param name="max_time_min" type="int" value= "120"/>
    <param name="max_cluster" type="int" value= "100"/>
    </node>
</launch>

IMU generate analog data packets imu.bag , when I can not find the execution will be prompted to vio_data_simulation, please use the source command solve.

cd ~/catkin_ws
source ./devel/setup.bash
rosrun vio_data_simulation vio_data_simulation_node

Generated here imu.bag size of 1.1G, bag files can not be used directly, use bagconvert converted into mat file, using matlab to view specific data. Find imu.bag path, execute the following command:

rosbag info imu.bag              //确认imu的topic,显示为imu
rosbag play -r 200 imu.bag       //200指的是回放频率
roslaunch imu_utils imu.launch
rosrun bagconvert bagconvert imu.bag imu

Generated here imu.mat size of 132M, the default path and imu.bag as the first experiment only 177bytes, bagconvert reason is that when the topic name does not generate an empty mat file. Will generate a bunch of txt file and yaml a file, the file name contains mytest (previously defined in imu.launch in imu_name ) IMU data file is newly generated.
IMU data file

(4) generating Allan variance curve

Generated imu.mat file after the task has been completed 90%, the next data visualization got left. In fact, I later realized, imu_utils and kalibr_allan Allan variance are two different tools, both can be used.
Use imu_utils tools : in imu_utils / scripts / can find a lot of m file path, I will just try to run the draw_allan.m , modify the path m file, change the previously generated txt file, run it in matlab. Specific data analysis yaml need to view files, and conversion to the continuous time domain (README imu_utils in a note).
m in the file imu_utils
draw_allan.m document interface
Allan variance curve generated by the tool imu_utils
Use kalibr_allan tools : the truth is the same, in kalibr_allan / matlab find m file, modify the path SCRIPT_allan_matparallel.m in the first, instead of the path imu.mat run, this process will last about 1 hour (due to the machine performance varies), will kalibr_allan / data / generate the name of the path with a result file copied to this path SCRIPT_process_result.m position corresponding to run the file, the same generating curve Allan variance. Specific data have been shown in the drawings.
SCRIPT_allan_matparallel.m document interface
SCRIPT_process_result.m document interface
kalibr_allan tool generates a gyro Allan variance curve
kalibr_allan tool generates an accelerometer Allan variance curve
Finally, there is an additional point: in vio_data_simulation / python_tool / under some py file, which can draw draw_trajcory.py IMU trajectories.

4. Summary

The difficulty of algorithm research, or modify the code for experiment and not too much, all the way down to do but also spent a lot of time, the fundamental reason is to install their own software packages, ROS , using matlab are more familiar with, but also positive through this opportunity is training about the use of various tools. This is especially ros an open source framework, but also back more practice. There is an excellent compilation environment is a prerequisite to ensure good code.

Released two original articles · won praise 0 · Views 113

Guess you like

Origin blog.csdn.net/EternalGlory_wx/article/details/104727667