Go to Post I knew you guys were really smokin' at Championships. I just didn't realize how much! - Mark McLeod [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 16-01-2012, 09:10
pavie pavie is offline
Registered User
AKA: Paul Bieganski
FRC #3630 (Stampede)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Minneapolis
Posts: 11
pavie is an unknown quantity at this point
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!

Last edited by pavie : 16-01-2012 at 09:21.
Reply With Quote
  #2   Spotlight this post!  
Unread 16-01-2012, 13:11
enrique's Avatar
enrique enrique is offline
Registered User
FRC #1251 (Tech Tigers)
Team Role: Electrical
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Florida
Posts: 87
enrique will become famous soon enough
Send a message via Yahoo to enrique
Smile Re: Distributed vision processing in C++

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.
Reply With Quote
  #3   Spotlight this post!  
Unread 18-01-2012, 08:45
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Distributed vision processing in C++

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
Reply With Quote
  #4   Spotlight this post!  
Unread 19-01-2012, 23:21
pavie pavie is offline
Registered User
AKA: Paul Bieganski
FRC #3630 (Stampede)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Minneapolis
Posts: 11
pavie is an unknown quantity at this point
Re: Distributed vision processing in C++

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.
Reply With Quote
  #5   Spotlight this post!  
Unread 20-01-2012, 07:35
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Distributed vision processing in C++

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
Reply With Quote
  #6   Spotlight this post!  
Unread 20-01-2012, 08:07
pavie pavie is offline
Registered User
AKA: Paul Bieganski
FRC #3630 (Stampede)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Minneapolis
Posts: 11
pavie is an unknown quantity at this point
Re: Distributed vision processing in C++

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).
Reply With Quote
  #7   Spotlight this post!  
Unread 20-01-2012, 11:19
Hjelstrom's Avatar
Hjelstrom Hjelstrom is offline
Mentor
FRC #0987 (High Rollers)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2005
Location: Las Vegas
Posts: 147
Hjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond repute
Re: Distributed vision processing in C++

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.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:02.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi