[FEATURE] Mira220 (Arducam pivariety) camera support + calibration fixes#206
[FEATURE] Mira220 (Arducam pivariety) camera support + calibration fixes#206AndyJado wants to merge 9 commits into
Conversation
Register Mira220_Mono (type 6) in CameraModel enum with sensor dimensions 4.464x3.906mm (2.79um pixel), default resolution 1600x1400, mono flag, and ball-radius parameter sharing with PiGS and InnoMaker IMX296.
|
Thanks for your PR! Before we can review it, please sign our Contributor License Agreement. How to sign (right here in this PR):
|
|
@AndyJado Please use the original, full PR template. This has AI patterns so those questions are especially important. Disregarding that template completely on your first contribution is generally a bad practice. |
Add v4l2_trigger script that sets trigger_mode control on the arducam-pivariety v4l-subdev for external trigger (FSIN pin). Call it from SetExternalTrigger() and extend cam2 quiesce time for Mira220 just like InnoMaker.
fd52c51 to
7d173c9
Compare
Extend sensor name regex to support hyphenated driver names. Recognise arducam-pivariety sensor as Mira220 (type 6).
Add type 6 to camera dropdowns in configurations.json and\nregister arducam-pivariety in detect_pi_cameras.sh.
…re; prompt on first install Map camera type 6 to dtoverlay=arducam-pivariety in config.txt. Preserve the overlay when only one camera is detected to avoid a circular failure. On first install, if Mira220 is not detected, interactively ask the user whether one is connected.
891f512 to
a8ef621
Compare
The Mira220 external trigger (trigger_mode=1) requires a longer priming pulse than the InnoMaker to reliably produce frame events on the FSIN pin.
SetLibcameraTuningFileEnvVariable: for Mira220_Mono, unset LIBCAMERA_RPI_TUNING_FILE so libcamera auto-detects the best available fallback. No matching tuning file exists for this sensor.
set_pipeline_configuration: make no-op. The rpi_apps.yaml causes a segfault with the Arducam-built libcamera on Mira220. IMX296 verified working without the override.
Do not restart camera on timeout in external trigger mode. The StopCamera/StartCamera restart path throws uncaught exceptions that call std::terminate. Instead, just continue waiting for FSIN pulses — the timeout is expected while the camera waits.
|
@AndyJado I also see that every almost single commit is co-authored by AI. We do not accept AI authored contributions in this repository. Not only that - the AI section was again ignored when you updated to use the template. Have you had a chance to look at our AI policy? The lack of transparency on this PR is going to be a blocker for the time being. Until this can be fully end to end and regression tested by a maintainer this should remain on hold. |
Description
What does this PR do?
Adds full support for the Mira220 (Arducam pivariety) mono sensor as Camera 2, including camera model detection, external trigger via v4l2, dtoverlay configuration, UI integration, and interactive install prompt. Also fixes calibration failures on this sensor.
Why is this change needed?
The Mira220 is a global-shutter mono sensor used as an alternative to the InnoMaker IMX296 for Camera 2 (flight camera). Without these changes, the sensor is detected but camera2 calibration crashes (SIGABRT/SIGSEGV). Three Mira220-specific issues:
SetLibcameraTuningFileEnvVariablealways sets an IMX296 tuning file. No Mira220 tuning file exists — skip for this model, let libcamera auto-detect.LIBCAMERA_RPI_CONFIG_FILEpoints torpi_apps.yaml. The Arducam-built libcamera segfaults on Mira220 when any pipeline config is loaded — disable the override entirely (IMX296 verified fine without it).StopCamera/StartCamera) whose exceptions went uncaught, callingstd::terminate.arducam-pivarietydtoverlay must be present at boot for detection, but on first install it is missing — interactive prompt added.Related Issue(s)
N/A
Changes Made
v4l2-ctl -c trigger_mode=1on subdev (replaces IMX296 sysfs path)arducam-pivariety→ type 6)detect_pi_cameras.shdtoverlay=arducam-pivariety, preserve on reconfigure, interactive prompt on first installunsetenv LIBCAMERA_RPI_TUNING_FILE)LIBCAMERA_RPI_CONFIG_FILEoverride (Arducam libcamera incompatibility)Testing Performed
Test Environment
./build.sh dev)Test Results
GetBall()executesrpicam-still --camera 0(IMX296): captures without pipeline config — no regressionrpicam-still --camera 1(Mira220): captures without tuning file — 1600×1400 valid imageTest Commands Run
Breaking Changes
rpi_apps.yamlis no longer set viaLIBCAMERA_RPI_CONFIG_FILE. Both cameras rely on libcamera native timeout.Dependencies
Hardware Compatibility
Documentation
Checklist
Code Quality
Build & Test
sudo ./build.sh devSubmission Requirements