ethz-asl / kalibr

The Kalibr visual-inertial calibration toolbox
Other
4.37k stars 1.4k forks source link

Ubuntu 20.04 and CI Dockerfiles #515

Closed goldbattle closed 2 years ago

goldbattle commented 2 years ago

This is a PR of the ori-drs/kalibr repo which has fixes for 20.04 and python3. As mentioned in https://github.com/ethz-asl/kalibr/pull/405#issuecomment-853946085 I forked and am willing to handle review comments to make this mergeable. I have additionally added Docker files and a CI github action to build the Docker files to ensure that the codebase builds on all platforms (ubuntu 16.04 kinetic, 18.04 melodic, 20.04 noetic). There were some modifications I needed to perform from the ori-drs repo to ensure that everything still built with python2.

I have tested performing camera calibration, and camera to IMU calibration with the sample datasets. One can see the github action CI builds here. The goldbattle/kalibr Readme has instructions on how to build and use the docker.

A short summary of changes:

The readme will likely need some small changes along with the wiki (or just add example build instructions to the readme).

ethzasl-jenkins commented 2 years ago

Can one of the admins verify this patch?

goldbattle commented 2 years ago

Docker instructions to be added to the wiki:

First make sure that you have install docker on your system using the official Docker Get Docker guide. We can then build the docker container using:

cd <workspace>/src/kalibr
docker build -t kalibr -f Dockerfile_ros1_20_04 .

Then after building we can first download an example dataset and then perform following to calibrate.

cd <workspace>
mkdir example && cd example
wget http://robotics.ethz.ch/~asl-datasets/ijrr_euroc_mav_dataset/calibration_datasets/cam_april/april_6x6.yaml
wget http://robotics.ethz.ch/~asl-datasets/ijrr_euroc_mav_dataset/calibration_datasets/cam_april/cam_april.bag

We can now mount the data folder in the container /data path and enter the command prompt. Some more details can be found on the ROS wiki for Docker.

FOLDER=$(pwd)
xhost +local:root
docker run -it -e "DISPLAY" -e "QT_X11_NO_MITSHM=1" \
    -v "/tmp/.X11-unix:/tmp/.X11-unix:rw" \
    -v "$FOLDER:/data" \
    kalibr
source devel/setup.bash
rosrun kalibr kalibr_calibrate_cameras \
    --bag /data/cam_april.bag --target /data/april_6x6.yaml \
    --models pinhole-radtan pinhole-radtan \
    --topics /cam0/image_raw /cam1/image_raw