Mars Logger records synchronized camera frames + accelerometer + gyroscope from an Android phone in a format suitable for visual-inertial odometry / SLAM benchmarks.
- Grab the latest
.apkfrom the project's transfer guide and install it. - Enable Developer Options: Settings → About → tap Build number 7 times.
- Enable USB debugging under Developer Options.
Install ADB on the host:
sudo apt-get update
sudo apt-get install -y android-tools-adbRecordings are written to /sdcard/Android/data/edu.osu.pcv.marslogger/files/data. Browse first:
adb shell
cd /sdcard/Android/data/edu.osu.pcv.marslogger/files/data
ls
exitPull a session to the host:
MARS_DIR=/sdcard/Android/data/edu.osu.pcv.marslogger/files/data
OUTPUT_DIR=$HOME/Desktop/MarsLogger
mkdir -p "$OUTPUT_DIR" && cd "$OUTPUT_DIR"
adb pull "$MARS_DIR"A session directory contains:
movie.mp4— H.264 videogyro_accel.csv— IMU samples (gyro + accel, hardware-timestamped)frame_timestamps.txt— per-frame capture timestampsintrinsics.yaml,*.csvmetadata
Use kalibr_bagcreater.py from vio_common. It produces /cam0/image_raw and /imu0 topics with frame timestamps aligned to the IMU clock.
BAG_PYTHON=$HOME/workspace/vio_common/python/kalibr_bagcreater.py
ANDROID_DATA_DIR=$HOME/Desktop/MarsLogger/data/2023_03_07_10_16_29
python "$BAG_PYTHON" \
--video "$ANDROID_DATA_DIR/movie.mp4" \
--imu "$ANDROID_DATA_DIR/gyro_accel.csv" \
--video_time_file "$ANDROID_DATA_DIR/frame_timestamps.txt" \
--output_bag "$ANDROID_DATA_DIR/movie.bag"For high-resolution captures, allow taller frames:
python "$BAG_PYTHON" \
--video "$ANDROID_DATA_DIR/movie.mp4" \
--max_video_frame_height 10000 \
--imu "$ANDROID_DATA_DIR/gyro_accel.csv" \
--video_time_file "$ANDROID_DATA_DIR/frame_timestamps.txt" \
--output_bag "$ANDROID_DATA_DIR/movie.bag"Kalibr is most easily run from its official Docker image.
Supported camera models:
pinhole-radtan, pinhole-equi, pinhole-fov,
omni-none, omni-radtan,
eucm-none, ds-none
FOLDER=$HOME/Desktop/MarsLogger/data/2023_03_06_15_20_28
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" \
kalibrInside the container:
source devel/setup.bashrosrun kalibr kalibr_calibrate_cameras \
--bag /data/cam_april.bag \
--target /data/april_6x6.yaml \
--models pinhole-radtan \
--topics /cam0/image_rawOutput: cam_april-camchain.yaml.
rosrun kalibr kalibr_calibrate_imu_camera \
--bag /data/cam_april.bag \
--cam /data/cam_april-camchain.yaml \
--imu /data/imu.yaml \
--target /data/april_6x6.yaml
[TargetViewTable] Tried to add second view to a given cameraId & timestamp. Maybe try to reduce the approximate syncing tolerance.
Two image messages share a timestamp (Kalibr de-dupes by (camera_id, timestamp)). Either re-record at a lower frame rate, or pass --dont-show-report --time-calibration --max-iter <N> plus a tighter sync tolerance.
cd $HOME/Desktop/MarsLogger/data/2023_03_07_10_16_29
# Mono
rosrun ORB_SLAM3 Mono \
$HOME/workspace/ORB_SLAM3/Vocabulary/ORBvoc.txt \
./ORB3_EuRoC.yaml
# Mono + IMU
rosrun ORB_SLAM3 Mono_Inertial \
$HOME/workspace/ORB_SLAM3/Vocabulary/ORBvoc.txt \
./ORB3_EuRoC.yaml
# Replay the bag with topics remapped to ORB-SLAM3's defaults
rosbag play movie.bag /cam0/image_raw:=/camera/image_raw /imu0:=/imuThe YAML must contain the camera intrinsics + camera-IMU extrinsics produced by Kalibr in §4.
roslaunch vins vins_rviz.launch
rosrun vins vins_node $HOME/Desktop/MarsLogger/data/2023_03_06_15_20_28/android_imu_config.yaml
# In another terminal
rosbag play movie.bagThe VINS config YAML expects body_T_cam0, accelerometer/gyroscope noise densities, and the topic names that match the bag.