Segmentation Fault upon calling init_cam_poses in basalt_calibrate
Summary
When pressing init_cam_poses
in the GUI of basalt_calibrate, a Segmentation Fault occurs.
How to reproduce
Clone basalt, install dependencies and compile:
cd ~
git clone --recursive https://gitlab.com/VladyslavUsenko/basalt.git
cd basalt
./scripts/install_deps.sh
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j
Download the TUM-VI dataset (as per https://gitlab.com/VladyslavUsenko/basalt/-/blob/master/doc/Calibration.md):
mkdir ~/tumvi_calib_data
cd ~/tumvi_calib_data
wget http://vision.in.tum.de/tumvi/calibrated/512_16/dataset-calib-cam3_512_16.bag
wget http://vision.in.tum.de/tumvi/calibrated/512_16/dataset-calib-imu1_512_16.bag
Run the camera calibration GUI:
basalt_calibrate --dataset-path ~/tumvi_calib_data/dataset-calib-cam3_512_16.bag --dataset-type bag --aprilgrid ~/basalt/data/aprilgrid_6x6.json --result-path ~/tumvi_calib_result/ --cam-types ds ds
Do the following steps within the GUI:
- Press
load_dataset
- Press
detect_corners
- Press
init_cam_intr
- Press
init_cam_poses
Observed behavior
A segmentation fault occurs with the following output:
Started initial camera pose computation
Segmentation fault (core dumped)
Expected behavior
The poses are computed as explained in https://gitlab.com/VladyslavUsenko/basalt/-/blob/master/doc/Calibration.md ("init_cam_poses
computes an initial guess for camera poses given the current intrinsics").
System details
Tested on two systems, in both cases built from source from the current master branch (commit 47b063e6).
First system (real hardware):
- OS: Ubuntu 24.04.3 LTS x86_64
- CPU: Intel Xeon E5-2643 v3
- GPU: NVIDIA Quadro M4000
- RAM: 64GB
Second system (within WSL):
- OS: Ubuntu 24.04 (WSL2)
- CPU: Intel i7-1255U
- GPU: None
- RAM: 8GB within WSL
Additional Info
Running basalt_calibrate
as above, but with gdb --args
prepended, provides the following additional information:
Thread 1 "basalt_calibrat" received signal SIGSEGV, Segmentation fault.
basalt::CalibInitPoseData::CalibInitPoseData (this=0x7fff9030bf90)
at /home/nfreund/projects/basalt/include/basalt/calibration/calibration_helper.h:62
62 struct CalibInitPoseData {