Synchronizes an SVIn trajectory with a Perdix dive-computer export and calibrates the SVIn depth measurements against the Perdix depth reference.
The script finds the time offset between the recordings, interpolates the SVIn trajectories at the Perdix sample times, fits a linear depth correction, and writes the corrected SVIn data and diagnostic plots to an output directory.
- Python 3.9 or newer
- NumPy
- pandas
- Matplotlib
- SciPy
- scikit-learn
- Open3D
To install Python dependencies and set up the workspace, run:
mkdir ~/depth_matcher_ws
cd ~/depth_matcher_ws
git clone https://github.com/AutonomousFieldRoboticsLab/Svin-Perdix-Matcher .
sudo apt install python3-venv
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -r requirements.txtUse the CSV exported by the Perdix dive computer. The matcher expects the export's metadata rows and these columns:
Dive Numberfor elapsed time and its unitGF Minimumfor depth samplesStart DateandEnd Datefor recording bounds
The depth unit must be supplied separately as either m or ft.
The SVIn file must be whitespace-delimited and contain:
#timestampwith Unix timestamps in secondstzwith depth measurements
If you have a .ply point cloud that should be shifted by the same calibrated depth offset, pass it with --pointcloud.
python svin_perdix_matcher.py PERDIX_CSV SVIN_TXT OUTPUT_DIRECTORY {m,ft} [--pointcloud POINT_CLOUD.ply]Example using the bundled data:
python svin_perdix_matcher.py \
data/CatacombsPerdix.csv \
data/svin_example.txt \
output \
ft \
--pointcloud data/pointcloud_example.plyThis creates:
output/svin_example_matched.txtoutput/depth_offset.txtoutput/pointcloud_example_matched.ply(only when--pointcloudis used)- several diagnostic PNG files in
output/
| Original recordings | Time-aligned and calibrated result |
|---|---|
![]() |
![]() |
The main output is the matched SVIn TXT file:
*_matched.txt- same original whitespace-delimited SVIn layout
tzvalues are replaced with the calibrated depth values
Additional diagram outputs in output/ include:
original_data.pngshifted.pnginterpolate.pngregression.pngfinal.pngdepth_offset.txt(saved calibration offset)*_matched.plywhen a point cloud is passed
- Perdix timestamps are interpreted as UTC.
- The Perdix recording must be at least as long as the SVIn recording.
- The time offset is searched at 0.1-second resolution.
- Existing output files are overwritten.
- The depth offset is stored in
depth_offset.txtand can be reused for aligned point-cloud processing.

