RPC with C# control application

Our xyz gantry control application (C#) uses the OpenMV camera to recognize the objects in the xyz gantry’s space and detect collisions. The collision detection seems to work find, but we would like more than a digital collision/no-collision signal. Specifically, we would like to get a real-time video for observation and to modify “don’t care” regions from time to time. I see the RPC library for py. That would be ideal if there was a master written for C#. Is there something that exists or some documentation on what the serial transfer protocol is so that I could write the C# side?



Uh, there’s not really documentation. Honestly, code is kinda the best documentation. So, you can pretty much translate the rpc.py library into C# if you want to make a C# version.

ChatGPT can probably do this for you too. If you post the entire file into it and ask it to make it into C# it can probably do most of the work for you.

Alternatively, take the RPC library code and extend it to handle custom requests. E.g. when you open the rtsp URL you get a callback. You can pretty much make the URL anything. So, you could pass query parameters and then parse them in the callback to define don’t care regions. This is probably the easiest thing to do. Then you can get video via VLC/FFPMG and you just have to define a custom URL.

Also, openCV can open rtsp URLs. So, you can make a desktop app using OpenCV that opens a customer RTSP URL to the openmv cam and gives it a query parameter that provides the arguments to use.