voxl-logger
Tool to save data published through Modal Pipe Architecture to disk. By default, this saves images to /data/voxl-logger/ since the /data/ partition is the largest partition on VOXL. You can change this with the -d argument.
The voxl-replay tool is used to play back the logs on target.
voxl-logger checks the free disk space before it starts and while it is logging, and stops the log rather than filling the disk.
Usage
-a, --armed only record to log when armed
-b, --benchtest_vio log normalized tracking cams + imu for vio benchtesting
-B, --barometer {name} log barometer data from mpa
-c, --cam {name} name of a camera to log, e.g. tracking.
greyscale images will be saved as a lossless png.
color images as jpg unless --color-png is set
-d, --directory {dir} name of the directory to save the log to, default
is /data/voxl-logger/ if argument is not provided.
-f, --pose_6dof {name} name of a pose6DOF topic to log, e.g. vvpx4_attitude
-h, --help print this help message
-i, --imu {name} name of an imu to log, e.g. imu1.
-j, --benchtest_vio_no_tracking[=skip] log imu and barometer data for vio benchtesting without tracking data
optional skip parameter sets frames to skip for tracking camera (default=500)
-k, --skip {n_to_skip} number of samples to skip between logged samples
-l, --local_position_ned log local position NED data from mavlink stream
-m, --mavlink {name} name of a mavlink pipe.
-n, --note {note} optionally add a very short note to the end of the log
directory name, e.g. flight_with_new_motors
-o, --preset_odometry record a preset log containing qvio, ovins, tracking cam and
IMUs for testing VIO. This can be used with other pipes.
-p, --tof {name} name of a PMD TOF pipe.
-q, --qvio log the extended qvio data including feature points and covarience
-r, --snapshot_rate_hz {hz} How fast to send snapshot commands to snapshot camera pipes
-R, --rc_channels log RC channel data from mpa
-s, --samples {samples} maximum samples to save for one specific channel,
otherwise it will run untill you quit the program.
-t, --time {seconds} time to log for in seconds.
-v, --vio {name} name of a vio pipe to log, e.g. qvio
-w, --raw log raw binary data to data.raw file
-O, --offboard_log log the offboard_log pipe (ext_vfc_data_t) as a
structured CSV (no post-conversion needed). Also
logs px4_baro on the side.
-z, --debug enable verbose debug mode
typical uses:
To log one camera image:
voxl2:/# voxl-logger --cam tracking --samples 1
To log 5000 imu samples:
voxl2:/# voxl-logger -i imu1 -s 5000 --note "primary imu test"
To log barometer data for 60 seconds:
voxl2:/# voxl-logger -B {name} -t 60 --note "barometer test"
To log RC channels for 30 seconds:
voxl2:/# voxl-logger -R -t 30 --note "RC test"
To log 1000 imu0 samples and 2000 imu1 samples:
voxl2:/# voxl-logger -i imu0 -s 1000 -i imu1 -s 2000
To log every 5th imu sample (skip 4) for 5.5 seconds:
voxl2:/# voxl-logger -i imu1 --skip 4 -t 5.5
To log tracking camera and both imus until you press ctrl-c
voxl2:/# voxl-logger --preset_odometry
To record a typical log for testing VIO (imu + tracking) for 1 minute
voxl2:/# voxl-logger --preset_odometry --time 60 --note "log for vio replay test 1"
The
--color-pngoption mentioned in the help text above is not actually implemented in this version, so color images are always saved as jpg.
Log Automatically on Boot
The voxl-logger.service systemd service runs /usr/bin/voxl-logger-autorun.sh on boot. This script is meant to be edited by the user to record whatever you want; the default script runs:
voxl-logger --armed --benchtest_vio
The -a/--armed flag makes voxl-logger record only while the vehicle is armed, so the service can be left enabled and it will only write logs during flight. Enable it with:
systemctl enable --now voxl-logger
Triggered Logging with voxl-logger-auto
For logging that starts and stops on demand (from a script, a button, or a flight event) use the config-driven auto mode:
systemctl enable --now voxl-logger-auto
This runs voxl-logger --config /etc/modalai/voxl-logger-auto.conf persistently. It waits for a trigger before recording, and writes one logNNNN/ session directory per trigger. Control it with the helper CLI:
voxl-logger-auto start [note] begin a recording session
voxl-logger-auto stop end the current session
voxl-logger-auto status print whether a session is active
voxl-logger-auto arm-trigger {on|off}
arm-trigger toggles record-on-arm live (the daemon applies it immediately, no restart) and persists it by rewriting the config’s trigger field so the change survives a reboot.
The config file /etc/modalai/voxl-logger-auto.conf supports the following keys:
| Key | Description |
|---|---|
base_dir | where log sessions are written, one logNNNN/ dir per trigger (default /data/voxl-logger-auto/) |
control_pipe_name | MPA control pipe that start/stop/status commands are sent to (default voxl-logger-auto) |
max_duration_s | safety auto-stop for a session in seconds, 0 disables the limit |
trigger | manual = control pipe only; armed = also start on vehicle arm and stop on disarm |
note | default note written into each session’s info.json |
pipes | list of {type, name} entries to log, using the same type vocabulary as voxl-logger; an optional skip drops N of every N+1 samples |
Related Tools
voxl-convert-calprints.cal,.yml, and.csvcalibration files as JSON; use-kfor human-readable formatting.voxl-logger-to-rosbagis a host-side ROS package included in the voxl-logger repo for replaying voxl-logger logs into ROS topics.