Simulation.md
September 2, 2021 ยท View on GitHub
Simulator
For better evaluation of the system we use the simulated environment where the optical flow and IMU data is generated from the ground truth by adding noise.
Note: The path to calibration and configuration files used here works for the APT installation. If you compile from source specify the appropriate path to the files in data folder.
Visual-inertial odometry simulator
granite_vio_sim --cam-calib /data/euroc_ds_calib_stereo.json --marg-data sim_marg_data --spline-path
data/spiral_spline.json --show-gui 1
The command line options have the following meaning:
--cam-calibpath to camera calibration file. Check calibration instructions to see how the calibration was generated.--marg-datafolder where the data from keyframe marginalization will be stored. This data can be later used for visual-inertial mapping simulator.--show-guienables or disables GUI.--spline-pathpath to a file containing the spline describing the trajectory. Optional. If no spline is provided the trajectory will be randomly generated.--num-pointsNumber of landmarks sampled.--use-imufuse inertial data. Can be0or1.
This opens the GUI and runs the sequence.

The buttons in the GUI have the following meaning:
show_obstoggles the visibility of the ground-truth landmarks in the image view.show_obs_noisytoggles the visibility of the noisy landmarks in the image view.show_obs_viotoggles the visibility of the landmarks estimated by VIO in the image view.show_idstoggles the IDs of the landmarks.show_accelshows noisy accelerometer measurements generated from the ground-truth spline.show_gyroshows noisy gyroscope measurements generated from the ground-truth spline.show_gt_...shows ground truth position, velocity and biases.show_est_...shows VIO estimates of the position, velocity and biases.next_stepproceeds to next frame.continueplays the sequence.align_se3performs SE(3) alignment with ground-truth trajectory and prints the RMS ATE to the console.
Visual-inertial mapping simulator
granite_mapper_sim --cam-calib data/euroc_ds_calib_stereo.json --marg-data sim_marg_data --show-gui 1
The command line arguments are the same as above.
This opens the GUI where the map can be processed.

The system processes the marginalization data and extracts the non-linear factors from them. Roll-pitch and relative-pose factors are initially added to the system. One way to verify that they result in gravity-aligned map is the following
optimizeruns the optimizationrand_incapplies a random increment to all frames of the system. If you run theoptimizeuntil convergence afterwards, and pressalign_se3the alignment transformation should only contain the rotation around Z axis.rand_yawapplies an increment in yaw to all poses. This should not change the error of the optimization once is have converged.setup_pointstriangulates the points and adds them to optimization. You should optimize the system again after adding the points.align_se3performs SE(3) alignment with ground-truth trajectory and prints the RMS ATE to the console.
For comparison we also provide the granite_mapper_sim_naive executable that has the same parameters. It runs a global bundle-adjustment on keyframe data and inserts pre-integrated IMU measurements between keyframes. This executable is included for comparison only.