Go to Post If you're in Israel, it might be a long flight to the nearest Walmart - MrForbes [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 22-02-2016, 10:52
laplacier's Avatar
laplacier laplacier is offline
Registered User
FRC #1287 (Aluminum Assault)
Team Role: Engineer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Myrtle Beach, SC
Posts: 25
laplacier is an unknown quantity at this point
Coprocessor with LabVIEW

I've seen a lot of discussion about Coprocessors with Grip and OpenCV but not much discussion about LabVIEW.

We have image processing built on LabVIEW but we'd like to run it off of a coprocessor. We want to send a numeric array to the RoboRIO and a processed image to the Driver Station.

We do not know, however, how to send our information from the coprocessor to the RoboRIO and the Driver Station. I have everything hooked up through a network switch and from my understanding the RoboRIO is the host of this network. Smart Dashboard VIs coming from the coprocessor don't seem to communicate with the RoboRIO or the Driver Station (probably not their intention but it was worth a try).

I had semi-success using a Driver Station program running on the coprocessor but it seems that only one Driver Station at a time can communicate with the robot.
Reply With Quote
  #2   Spotlight this post!  
Unread 22-02-2016, 11:46
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,748
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: Coprocessor with LabVIEW

You have a number of options for communicating between various computers on or off your robot.

Probably the easiest is to run a Network Tables version 3 client. This is what LV implements and what most of the other tools implement, though some are at version 2.

You can also use TCP, UDP, Serial, or other protocols to send data between the computers.

There is no need to run the driver station on another computer, and as you saw, they don't like that and will generally stop one another to keep only one up at a time.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 22-02-2016, 15:31
laplacier's Avatar
laplacier laplacier is offline
Registered User
FRC #1287 (Aluminum Assault)
Team Role: Engineer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Myrtle Beach, SC
Posts: 25
laplacier is an unknown quantity at this point
Re: Coprocessor with LabVIEW

Thank you for the reply Greg. I was able to send some data using the SD variables by starting the NT Client. I'm still stuck on sending the processed image to the Driver Station. How would I send an image file from the coprocessor to the Driver Station with LabVIEW?
Reply With Quote
  #4   Spotlight this post!  
Unread 22-02-2016, 17:21
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,748
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: Coprocessor with LabVIEW

WPILib contains a Send Images to PC Loop. This VI is responsible for getting the image from the camera, flattening it to a buffer, and sending it to the dashboard.

If the coprocessor can run LabVIEW, then this code may be a reasonable starting point. There is a similar multi-camera version in another thread. If it is in another language, then you may be able to translate it or look at a similar implementation in that language.

Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 02-03-2016, 14:51
laplacier's Avatar
laplacier laplacier is offline
Registered User
FRC #1287 (Aluminum Assault)
Team Role: Engineer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Myrtle Beach, SC
Posts: 25
laplacier is an unknown quantity at this point
Re: Coprocessor with LabVIEW

Thank you again for your help Greg. Send Images to PC expected a camera reference as an input but what I sought was the ability to send a post processed image to the Driver Station. However, I did figure it out and I was also able to learn more about sending data through networks as a result. I will be imparting this knowledge to the student programmers during our off-season so they can perform this next year.

To anyone who is interested in how to do this for their own team in the future and digs up this thread, I have created a guide with many pictures here which details how to wire up this system on your robot, how to get the image processing examples running, and how to send the data over the robot network.
Reply With Quote
  #6   Spotlight this post!  
Unread 03-03-2016, 09:31
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,748
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: Coprocessor with LabVIEW

Glad you figured it out. Nice tutorial by the way.

I'm curious what the modified image contained. I've generally annotated images by sending a few points to the DS and have those overplayed over the original image that is showing on the DB.

Greg McKaskle
Reply With Quote
  #7   Spotlight this post!  
Unread 03-03-2016, 10:35
laplacier's Avatar
laplacier laplacier is offline
Registered User
FRC #1287 (Aluminum Assault)
Team Role: Engineer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Myrtle Beach, SC
Posts: 25
laplacier is an unknown quantity at this point
Re: Coprocessor with LabVIEW

I'm not sure what the image did that caused Network Tables to cease working between the coprocessor and the RoboRIO. Another thing to note is that setting a static IP on the RoboRIO (to prevent from having to set the IP again later on the coprocessor) also failed and prevented the robot from working on the field altogether. Quite a few teams disconnected on the field (and even in the finals!) so I wonder how many of the teams had a static IP...

And again, all these errors could just come from my inexperience with networking.
Reply With Quote
  #8   Spotlight this post!  
Unread 03-03-2016, 14:50
laplacier's Avatar
laplacier laplacier is offline
Registered User
FRC #1287 (Aluminum Assault)
Team Role: Engineer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Myrtle Beach, SC
Posts: 25
laplacier is an unknown quantity at this point
Re: Coprocessor with LabVIEW

Quote:
Originally Posted by Greg McKaskle View Post
Glad you figured it out. Nice tutorial by the way.

I'm curious what the modified image contained. I've generally annotated images by sending a few points to the DS and have those overplayed over the original image that is showing on the DB.

Greg McKaskle
I didn't really think about doing it that way but I suppose I could have done it this way. I'll have to get a better handle on TCP protocol and see what I can manage that way.
Reply With Quote
  #9   Spotlight this post!  
Unread 03-03-2016, 23:18
JABot67 JABot67 is offline
Unregistered User
AKA: John Bottenberg
FRC #2930 (Sonic Squirrels)
Team Role: Engineer
 
Join Date: Feb 2009
Rookie Year: 2007
Location: Redmond, WA
Posts: 328
JABot67 has a reputation beyond reputeJABot67 has a reputation beyond reputeJABot67 has a reputation beyond reputeJABot67 has a reputation beyond reputeJABot67 has a reputation beyond reputeJABot67 has a reputation beyond reputeJABot67 has a reputation beyond reputeJABot67 has a reputation beyond reputeJABot67 has a reputation beyond reputeJABot67 has a reputation beyond reputeJABot67 has a reputation beyond repute
Re: Coprocessor with LabVIEW

What is the correct way to do this using just the NT Client and NT writes?

Is there an example out there of how to correctly add and wire the the NT Client VI in the Color Processing example?


Our specific problem:
We can use NT Write to send information that can eventually be read from the Variables tab of the dashboard, but after restarting the Color Processing example, the variables (centerX and centerY for instance) are static on the dashboard and do not respond to writes from the Kangaroo. If we change the names of the NT entries and restart the vision processing example, we can once again read the data on the dashboard. Basically, the names are "spoiled" after first use.
__________________
John Bottenberg - University of Michigan '14 - Microsoft
FLL Team "Dark Matter": 2003-2005
Robofest Team "Dark Matter": 2005-2008
Team 67 Programmer: 2007-2010
Team 3322 Programming Mentor: 2012-2014
Team 2930 Engineering Mentor: 2015-????
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:49.

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