Skip to content

FEATURE/Added an experimental option to use a Mira220-based camera [DO NOT MERGE]#202

Open
jamespilgrim wants to merge 1 commit into
mainfrom
mira220_sensor
Open

FEATURE/Added an experimental option to use a Mira220-based camera [DO NOT MERGE]#202
jamespilgrim wants to merge 1 commit into
mainfrom
mira220_sensor

Conversation

@jamespilgrim
Copy link
Copy Markdown
Collaborator

@jamespilgrim jamespilgrim commented Apr 29, 2026

Description

Added an experimental option to use a Mira220-based camera. Totally untested, and could possibly even break the code for non-Mira220 cameras, so DO NOT MERGE. This is just so folks can pull this code and fool around with it when someone actually gets a Mira220 camera such as this evaluation kit.

See also:

What does this PR do?

Begins the process of adding code to allow a user to select and use an Osram Mira220-based mono camera with PiTrac.

I say "begins" because we haven't actually tested with one of these cameras yet. I don't even have one. So, this PR is really just a start.

I'm aware that the Mira220 should work with the libcamera library that PiTrac is based on. However, we need to know things like where/what the tuning file for this camera is going to be and whether we need to run an external triggering setup utility through a shell call like we do for the Innomaker IMX296 camera.

I did set up the sensor width & height and resolution for the Mira220. Or at least I think so.

We may also have to add additional CameraModel types for different manufacturers of these cameras. It's likely that Innomaker may have a different setup than, say, Osram or Arducam, as those manufactures tend to deal with external triggering in a proprietary way.

Why is this change needed?

Folks are interested in using this sensor, so I wanted to at least get things started in the code to allow some experimenting.

Changes Made

  • Added Mira220 option to configurations.json
  • Added Mira220_Mono to CameraModels enum
  • Added camera processing placeholder code in libcamera_jpeg.cpp to allow for a Mira220 external triggering utility to be called.
  • Added camera processing option selection code in libcamera_interface.cpp (some of it just a guess) based on some initial internet research.
New Camera Option

Testing Performed

I just made sure it compiled.

Breaking Changes

This will almost certainly not work if you just hook up a Mira220 camera, select the option in the PiTrac UI and run it. :/

Dependencies

Need the tuning file(s) and any external triggering utilities before this would work. For example, right now, the triggering setup tool that will be called by PiTrac for the Teed Ball watching code is just:
std::string trigger_mode_command = "$PITRAC_ROOT/ImageProcessing/CameraTools/NEED_EXTERNAL_TRIGGER_UTILITY 4 1";

I don't yet know how to deal with auto-camera-detection in the web-server code for these sensors/cameras.
The server.py code will have to be changed to realize that we are using the Mira220 and then select the RPICAM_TUNING_FILE accordingly.

Hardware Compatibility

  • Tested on Pi 5
  • Tested on Pi 4
  • Tested with single Pi setup
  • Tested with dual Pi setup

Documentation

NA

Screenshots/Videos

See attached screen shot of the new option

AI (Vibe-Coded) Content Description

None

Checklist

Code Quality

  • [ x] Code follows existing patterns and conventions
  • [ x] No unnecessary comments added
  • [ x] Error handling implemented appropriately

Build & Test

  • [ x] Successfully builds with ./packaging/build.sh build
  • All existing tests pass
  • New tests added for new functionality
  • [ x] Tested on actual Raspberry Pi hardware (not just CI)

Submission Requirements

  • Commits squashed if needed (git rebase -i HEAD~n)
  • CLA signed
  • PR title follows format: [PR TYPE] Brief description
  • Branch is up-to-date with main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant