What are the ways to implement co-processor outputs into robotic code?

I am wondering on the ways of communicating and using the outputs of co-processors such as Jetson Nano or RPi ?

The potential outputs are vision processing data (object detection) or the outputs of any other suitable process that you may off-load onto a co-processor.

What software are you running on the coprocessor? PhotonVision? Or something custom?

If you’re using PhotonVision, you can use PhotonLib, its accompanying vendor library. If you’re using something custom, you can either develop a script to output variables to NetworkTables, and you can read them in the robot code from the NetworkTables, or you can develop a more custom solution with a server/client model.

I believe the main way you want to do this communication is by placing your coprocessor on the robot’s network and using network tables. I believe there are some python libraries that allow you to do that.

In the past I have worked with direct udp connections to the roborio to send/receive information. We have an example of this here.

You can also go for lower tech ways and use the I2C connection that is likely to be available and use it to communicate to the roborio or send binary data via the IO pins on the boards. I would suggest using a more network oriented approach as it will also allow you to send info to the dashboard and be more flexible on what you send.

3 Likes

It’s not recommended to use the I²C port on the roboRIO, it can lead to system lockups:

3 Likes

In frc, the main way of communicating between coprocessors and the rio are network tables. There is significant wpi documentation on it. Also, if you are using python on your coprocessor a solid api to use is ntcore. NTCore API — pyntcore 2023.4.3.0 documentation

UDP is a way we’ve used years ago and now we use NetworkTables.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.