LH2 calibration firmware#
Streams raw Lighthouse 2 sweep data over UART as HDLC frames. Companion
firmware for the dotbot calibrate-lh2 TUI (from the
PyDotBot package), which uses
the streamed counts to compute per-basestation homography matrices
saved to ~/.dotbot/calibration/.
Folded in from the standalone dotbot-lh2-calibration repo.
Usage#
Flash this firmware on a DotBot (or any LH2-equipped board) that has visibility on the lighthouses you want to calibrate.
Connect the DotBot via USB-serial (default UART baudrate
115200).Run
dotbot calibrate-lh2from a host withpip install dotbot[calibrate]. Follow the TUI prompts to capture the four reference points per basestation.
Wire format#
Each frame is HDLC-encoded and contains:
1 byte: basestation index (
lh_index, 0-based)N × 4 bytes:
lfsr_countsfor each sweep (uint32_tlittle-endian), where N isLH2_SWEEP_COUNT(defined indotbot-libs/bsp/lh2.h)
Frames are emitted only when both sweeps of a basestation have
fresh DB_LH2_PROCESSED_DATA_AVAILABLE data; missing-data frames are
suppressed.