-
Notifications
You must be signed in to change notification settings - Fork 9
/
calibrate_camera_dynamic.sh
executable file
·43 lines (31 loc) · 1.13 KB
/
calibrate_camera_dynamic.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
source /home/rpng/workspace/catkin_ws_kalibr/devel/setup.bash
DATASET="/media/rpng/RPNG_FLASH_5/calibration"
BASEDIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )/calibration"
export KALIBR_MANUAL_FOCAL_LENGTH_INIT=true
datasets=(
"d455_calib_02"
"d455_calib_03"
)
# scale-misalignment, calibrated
for d in "${!datasets[@]}"; do
bagname="${datasets[d]}"
rm -rf "$BASEDIR/kalibr_color_${d}_imu/"
mkdir -p "$BASEDIR/kalibr_color_${d}_imu/"
rosrun kalibr kalibr_calibrate_imu_camera \
--imu-models "calibrated" \
--reprojection-sigma 1.0 \
--target $BASEDIR/april_6x6_80x80cm.yaml \
--imu "$BASEDIR/imu.yaml" \
--cams "$BASEDIR/kalibr_color_${d}/$bagname-camchain.yaml" \
--bag "$DATASET/$bagname.bag" \
--dont-show-report \
# --bag-freq 10.0 \
# --show-extraction
# --bag-from-to 15 18 \
# --verbose
mv "$DATASET/$bagname-camchain-imucam.yaml" "$BASEDIR/kalibr_color_${d}_imu/"
mv "$DATASET/$bagname-imu.yaml" "$BASEDIR/kalibr_color_${d}_imu/"
mv "$DATASET/$bagname-report-imucam.pdf" "$BASEDIR/kalibr_color_${d}_imu/"
mv "$DATASET/$bagname-results-imucam.txt" "$BASEDIR/kalibr_color_${d}_imu/"
done