This repository provides the codebase for radar-based bundle adjustment and localization. The pipeline includes local map generation using DRO, loop closure proposal using RaPlace, pose graph optimization using Dr-PoGO, bundle adjustment using Dr-BA, and direct localization using DRL. Please refer to our paper for full details: https://arxiv.org/abs/2605.07041.
All dependencies should be in requirements.txt. Please install them in you virtual environment with
pip install -r requirements.txt
For Dr-PoGO, a required part of this repo, you will need Eigen3 and Ceres Solver:
sudo apt-get install python3-tk
sudo apt-get install python3-dev
sudo apt-get install build-essential
sudo apt-get install cmake
sudo apt-get install libeigen3-dev
sudo apt-get install libceres-dev
sudo apt-get install libyaml-cpp-devAlso clone the submodules
git submodule update --init --recursive- Compile Dr-PoGO:
cd pogo
mkdir -p build
cd build
cmake ..
make -j8
cd ../..- Compile Dr-BA
bash ba/scripts/build_package.shFirst, download data from the Boreas dataset here. The pipeline has thus far only been tested on Boreas RT data and the config files are populated with good values for this data. To run everything including localization you will need to download at least two sequences from the same route. The full set of sequences used in the paper can be found in script_for_paper/run_dr_pogo.py.
You need to run the following steps in order:
- Run pose graph optimization for local maps, cumulative images, and initial guess generation (Dr-PoGO)
- Run bundle adjustment for refined map poses (Dr-BA)
- (Optional) Run mapping step to create a map based on the BA results. Only needed if the mapping parameters are different from those used in BA.
- Run direct localization based on a created map (DRL)
Modify the data_path in the DRO/config.yaml file to point to one of the downloaded sequences:
data:
data_path: /absolute/path/to/Boreas/<seq-name>
multi_sequence: falseIt does not matter what sequence name you put here as it will be swapped out automatically later. The main runfile that will be used is script_for_paper/run_dr_pogo.py. Edit the set of sequences that you want Dr-PoGO to be run on.
Then, simply run
python script_for_paper/run_dr_pogo.pyModify the ba/config/ba_config.yaml file with at minimum an udpate to:
data/data_pathto point to parent directory of Boreas data is downloadeddata/meas_pathto point to the output of Dr-PoGO (automatically located underthis/repo/output)output/output_pathto point to where you want to save Dr-BA results to (if saving is enabled)output/visualizeandoutput/save_resultfor self-explanatory behaviour. You must save results if you want to run localization.ba/seq_idmust be set to the sequence name
If you are running out of RAM to run BA, you can also lower the ba/optimization/max_loaded_scans parameter. The lower this is the slower the optimization will be, but the less RAM it will require.
Once the config file is good, run
bash ba/scripts/run_ba.shThis step is optional in the case that you wish to generate a map with parameters different from those used to run BA. To generate a new map on the base of the BA-optimized poses, modify the ba/config/map_config.yaml file with at minimum an udpate to:
mapping/seq_idwith the same sequence ID as what was used to generate the BA solutionmapping/estimate_locationwithoutput/output_pathfrom the BA solve
Once the config file is good, run
bash ba/scripts/run_map.shModify the ba/config/loc_config.yaml file with at minimum an udpate to:
localization/seq_idwith the localizing sequence IDlocalization/map_seq_idwith the sequence ID of the mapping sequence (the one that BA was run on)localization/map_locationwith the location of the BA or mapping step output
Once the config file is good, run
bash ba/scripts/run_loc.shThe script will automatically print out the localization RMSE for the sequence.
A number of self-explanatory visualization scripts are available under ba_py.
These get automatically triggered when the output/visualize options are enabled under any part of the Dr-BA pipeline.
They can also be manually called with a specific output directory.