Repository navigation
Running ROVIOLI in Localization mode
TODO: For the public repository, check all links.
In this tutorial, we will run ROVIOLI in Localization mode. This can greatly improve the estimator accuracy and reduce the drift of the estimated trajectory.
As in the VIO case, you need to get the three calibration files (camera, IMU maplab, and IMU rovio) for your sensor setup. Furthermore, you also need:
- A VI map to localize against. This map should be optimized and loop-closed to obtain better results in ROVIOLI.
- A dataset to run. Alternatively, a live source can be used.
To get an optimization map, either manually optimize the VI map from running ROVIOLI in VIO mode using the maplab console. TODO: link tutorial here.
Alternatively, you can run the rovioli script from the previous tutorial with the --optimize_map_to_localization_map flag set to true:
source ~/maplab_ws/devel/setup.bash
roscore&
rosrun rovioli tutorial_euroc save_folder_loc_map MH_01_easy.bag --optimize_map_to_localization_map(Note: the optimization may take some time.)
This will save an optimized localization map under save_folder_loc_map_localization:
$ tree save_folder_loc_map_localization
save_folder_loc_map_localization
└── localization_summary_mapFor this tutorial, we use the Machine Hall 02 dataset from the Euroc dataset website.
As for localization map, we use an optimized VI map of the Machine Hall 01 dataset that we assume to be saved under save_folder_loc_map_localization.
Use the following script:
#!/usr/bin/env bash
LOCALIZATION_MAP_INPUT=$1
LOCALIZATION_MAP_OUTPUT=$2
ROSBAG=$3
NCAMERA_CALIBRATION="$ROVIO_CONFIG_DIR/ncamera-euroc.yaml"
IMU_PARAMETERS_MAPLAB="$ROVIO_CONFIG_DIR/imu-adis16488.yaml"
IMU_PARAMETERS_ROVIO="$ROVIO_CONFIG_DIR/imu-sigmas-rovio.yaml"
REST=$@
rosrun rovioli rovioli \
--alsologtostderr=1 \
--v=2 \
--ncamera_calibration=$NCAMERA_CALIBRATION \
--imu_parameters_maplab=$IMU_PARAMETERS_MAPLAB \
--imu_parameters_rovio=$IMU_PARAMETERS_ROVIO \
--publish_debug_markers \
--datasource_type="rosbag" \
--optimize_map_to_localization_map=false \
--vio_localization_map_folder=$LOCALIZATION_MAP_INPUT \
--save_map_folder=$LOCALIZATION_MAP_OUTPUT \
--map_builder_save_image_as_resources=false \
--datasource_rosbag=$ROSBAG $RESTNow, run the script:
# Make sure that your maplab workspace is sourced!
source ~/maplab_ws/devel/setup.bash
roscore&
rosrun rovioli tutorial_euroc_localization save_folder_loc_map_localization save_map_with_localization MH_02_easy.bagThe map under save_folder_loc_map_localization is used as reference map for localization.
It can either be a localization summary map (generated with --optimize_map_to_localization_map in ROVIOLI) or a full VI map (generated from ROVIOLI and optimized with the maplab console).
If the argument is an empty string, ROVIOLI will fall back to VIO mode, i.e., ROVIOLI will not perform any localization.
After ROVIOLI is finished, the VI map will be stored under save_folder_with_localization.
If you do not want the resulting VI map to be saved, you can keep the argument emtpy:
bash run_rovioli_localization "" save_map MH_02_easy.bagIn addition to the standard ROVIOLI topics (as explained before), localization mode adds the following visualization topics to RViz:
-
/loopclosure_database: Point cloud of all landmarks in the loop closure database. -
/loop_closures: Lines connecting the current active vertex with all landmarks that have been used for the localization. -
/loopclosure_inliers: Point cloud with all landmarks that have been used for the last successful localization. -
/debug_T_G_I_raw_localization: Red points indicating the vertex positions where a successful localization occurred.