Pi 5 for Romi vision coprocessor?

Hi we are running the latest (2023.2.1) Romi image and it’s working just fine for robot functionality. (MacOs, 2024 WPILib VSCode, Shuffleboard)

We are trying wpilibpi for vision processing and had initially tried to just plug a second pi into the Romi pi ethernet port. This would would approximate the competition usage of a coprocessor with RoboRio. However there’s a thread in here discussing how the wifi and ethernet aren’t bridged on Romi pi so that approach doesn’t work.

This means running vision models on the same pi that’s driving the Romi. This is supported and works quite well! The issue is the processing power offered by the pi itself. It’s not far off - a PyTorch mobile object detection model can run inference in about 1sec with a single core/thread on the pi 4b. Working with OpenCV and network tables in multiCameraServer.py you can get the relevant stream and coordinates to Shuffleboard (using more than single core seemed to degrade inference perf and the pi has other stuff to do!)

Note- we did try the PyTorch export to an onnx model but this immediately led to version compatibility issues. Seemed like it would be a constant whack-a-mole issue but haven’t totally given up on that. Just not sure if/why onnx would actually run any faster.

We can probably simplify the model and throw some other performance tuning at it, but would prefer to just use a pi 5 for vision and move on. So I think there are two approaches that would achieve this:

  1. Put the wifi/ethernet of Romi pi on same network so a vision coprocessor can be added similar to competition robot. Might need more batteries but this seems quickest (?)
  2. Fully support the pi 5 with a romi build. I’m assuming if this was easy it probably would have been done.

@Peter_Johnson - Thank you for keeping the Romi branch going. Anything in the works with Romi and Pi5? I would be happy to help if I’m able to.

The bookworm branch (update-bookworm) is what’s needed for Pi 5 support. Unfortunately, the web-based configuration of wifi broke with the OS upgrade, and that’s what I stalled out on fixing. There’s probably also a few other issues with it. If you’re able to help with that, it would be great (essentially we need to figure out what config files have to be changed / processes restarted for WiFi and Ethernet settings changes, and implement that functionality into the configServer). We also need to do a broader upgrade of WPILib to the latest version, but that’s relatively straightforward to do.

Ok thanks for update. I ordered a pi 5 to work with.