Distributed vision processing in C++

Hello,
The 2012 preview documents mention support for distributed vision processing (sending image data to the DS, processing it there in NI VA or openCV, sending data back). Is C++ currently supported?

Two questions:

  1. What context can C++ code (call it VCP for Vision Co-Processor) on the DS be executed in (separate process, C++ extension to DS, C++ extension to SD)? Are there any examples? Our preference would be to run VCP as a clean, separate Windows C++ application. It appears that the Java version is using the SD extension route.

  2. If #1 is not fully supported, is there a simple way (without hacking IMAQ structures) to send images processed (NOT raw camera images) by the cRIO (in C++ running on the cRIO) to the smart dashboard video window? Looks like customizing PCVideoServer.cpp might do it, but it appears that DS support displaying jpeg only and appear to be only functions supporting writing of jpeg files flash, not in-memory creation. Something akin to a “PCVideoServer::sendImage(const Image*)” would do.

Thanks!

Personally I started with the winriver circular target sample and changed it to process rectangles.

Yes, from reading the manual it seems you can process in C++ or the DS dashboard. I presume though that running at the DS will introduce a delay while the images are streamed to the DS. As for sending the image you want to the dashboard, I’m not sure, because the dashboard seems to get an image even without code, so the DS seems to go directly to the camera. I’m using a crio II with a network switch. Not sure if that changes when you use the second ethernet port on the crio I.

I was playing with the vision 2011 and it seems there is a function to replicate everything you can do in vision, from C++. So it makes more sense to me to do it in C++ and save the overhead.

Hopes this helps.

My suggestion would be to modify your Dashboard app (SmartDashboard or whatever), which is probably the one requesting the image, to either forward the JPG data or decompressed image data to a DLL where your C++ code runs. If you prefer, you can have your C++ code directly get the image from the camera using HTTP, or you can even write the dashboard in C++. The dashboard doesn’t even need to display much.

The Driver station automatically launches a process called Dashboard.exe, and that is why I recommend changing the dashboard. You can also edit the ini file for the driver station to run whatever command line you wish, or you can get your dashboard to launch a C++ process.

Your options are very open, but it will take some effort to do it.

Greg McKaskle

Thanks for the reply! I didn’t realize that just replacing the dashboard.exe (or adding another process there) was allowed. That makes it a lot easier… BTW - is there an open C++ API for the Network Tables (i.e. a way to write values back to the DS and ultimately the robot)? The docs seem to imply that there is/will be, but I haven’t seen anything.

I’d look on FIRSTForge. I don’t know whether it is in the Smart Dashboard section or somewhere else, but I’m pretty sure it exists.

Greg McKaskle

We have been looking everywhere - for 2 weeks now, with no luck… I have a feeling that Network Tables are not quite baked yet… the closest thing to what we need was the “validation suite” somebody did a couple years ago (basically a port of wpilib to Visual Studio with stubs for hardware and Vx dependencies). Unfortunately it was a one-off that seems to have died (and network tables weren’t around at that time).

It looks like you can use the SmartDashboard with C++. It also looks like the smartdashboard has some capability for sending data from the dashboard to the crio. (their example of the autonomous program chooser for example) I haven’t found where that data would show up on the crio/c++ side yet but it seems promising.