-
Notifications
You must be signed in to change notification settings - Fork 0
Running the arena registration scan
The run-arena-registration-scan program performs the automated scan needed to fit the (stage, pixel) ↔ physical coordinate mapping. It is implemented in recorder/src/runArenaRegistrationScan/runArenaRegistrationScan_main.cpp.
- The arena directory must already contain
metadata.yaml,mapping_board.pdf, andactive_area.png. For the built-in arena146 these are pre-generated; re-generate them by runningscripts/arena/make_arena146_config.pyfromspotlight-tools/. - Print
mapping_board.pdfat 100% scale and place it in the arena. - Compile the C++ code (see Compiling CPP code). The
run-arena-registration-scanbinary requireslibdmtx-dev(sudo apt install libdmtx-dev).
Run the program:
./run-arena-registration-scan -p ~/Spotlight/profiles/sibo_260514 -a ~/Spotlight/arenas/arena146
A window opens with a live behavior-camera preview and crosshairs. Manually move the stages so that the DataMatrix barcode printed at the centre of the mapping board is centred under the crosshairs, then press ENTER.
The program decodes the DataMatrix and verifies its checksum against metadata.yaml. A mismatch (e.g. wrong board in the arena) aborts with an error.
The program automatically visits every AprilTag position listed in metadata.yaml in sequence. At each position it:
- Moves the stage to the arena coordinates of the tag's centre (using the offset derived from the DataMatrix step).
- Waits for the stages to settle (number of settling frames is configurable in
recorder_config.yamlundermotion_control/apriltag_mapping_settling_frames). - Acquires 10 consecutive frames.
- Saves
apriltag<id>_img<i>.jpgand appends a row toapriltag_stage_positions.csvunder<arena_dir>/mapping_scan/.
Progress is shown in the preview window. The scan completes in a few minutes for arena146 (8 AprilTags × 10 frames).
Once the scan is complete, run fit-arena-registration from spotlight-tools/:
fit-arena-registration -a ~/Spotlight/arenas/arena146
See Fitting the calibration model for details.
$ ./run-arena-registration-scan --help
Usage: ./run-arena-registration-scan -p PROFILE_DIR -a ARENA_DIR [OPTIONS]
-p, --profile-dir PATH Profile directory
-a, --arena PATH Arena directory (containing metadata.yaml)
-v, --verbose Debug-level logging
--verbosity LEVEL trace/debug/info/warn/error/critical/off