Go to Post Team 1114 does not design or build ROBOTS. They build AWESOME. - DonRotolo [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-02-2012, 01:56
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Labview on PC -> C++ on cRIO

Hello!
I have a pretty basic question that I cannot seem to find the answer for. Our team is going to do the vision processing on the PC running the driver station (since we're sending back the image anyway) using labview (since more vision functions are available there). We are also using C++ on the robot (because our programmers like it better).

So, what we are trying to do is send back the x-coordinate of the target (a float) to the robot. What is the recommended way of doing this? I've read about the NetworkTable class for C++, but I assume that it requires a specific interface that I would have to recreate in labview. Is there already a corrsponding vi? Is there another completely different way to do it?

Thank you!
  #2   Spotlight this post!  
Unread 06-02-2012, 08:15
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,756
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: Labview on PC -> C++ on cRIO

If you are interested in beta testing a LabVIEW version of Network Tables, post as much. It doesn't do transactions yet, and I need to test performance and a few other things.

Greg McKaskle

Last edited by Greg McKaskle : 06-02-2012 at 08:15. Reason: tweak
  #3   Spotlight this post!  
Unread 07-02-2012, 02:01
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: Labview on PC -> C++ on cRIO

Well I was trying to come up with a ready made solution or common practice (like using the udp functions), and I don't think I have enough time with labview this year to beta test it. Isn't sending data from the dashboard to the robot a common problem?
  #4   Spotlight this post!  
Unread 07-02-2012, 07: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,756
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: Labview on PC -> C++ on cRIO

A few years ago, I'd say it was very uncommon, but from what I've seen on the forums, it is becoming common enough to improve the level where it is programmed -- to put more support into WPILib. The four slot work pushed off most other work, so it is just now being wrapped up.

I posted on some other forum with some UDP snippets that will accomplish this. I hope to have the Network Tables up in a few days, but I was looking for a few teams who were doing the cross-language stuff, since that has not been easy for me to get to.

Greg McKaskle
  #5   Spotlight this post!  
Unread 07-02-2012, 20:10
naibla naibla is offline
Registered User
FRC #0830
 
Join Date: Feb 2012
Location: Ann Arbor
Posts: 1
naibla will become famous soon enoughnaibla will become famous soon enough
Re: Labview on PC -> C++ on cRIO

Hi,
My team has been trying to do the exact same thing as WizenedEE. We would be happy to do any beta testing if you need it.
  #6   Spotlight this post!  
Unread 08-02-2012, 20:44
jesusrambo jesusrambo is offline
Self-Proclaimed Programmer Messiah
AKA: JD Russo
FRC #2035 (Robo Rockin' Bots)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2010
Location: Carmel, CA
Posts: 114
jesusrambo is an unknown quantity at this point
Re: Labview on PC -> C++ on cRIO

I'm just opening a TCP connection in the labview on port 1140, one of the open ones. I take all my values, TCP Write them, and then outside of the dashboard loop I close the TCP connection.

I'm using Java, so I can't exactly help you step by step through the cRIO side, but all you need to do is read from the TCP stream. Make sure to include some tokens in your output string in Labview so you can sort it out in the C++.

If anybody wants to look at my java or labview for the TCP send/recieve code, you can look at all of our Java on our github repository. I'm attaching my TCP loop that handles connection on the Dashboard side in the Labview as well. I can attach the transmitting part too but it gets kinda nasty with all my other blocks. It's my first time doing labview and things aren't always pretty.
Attached Images
File Type: bmp TCPLoop.bmp (652.1 KB, 91 views)
  #7   Spotlight this post!  
Unread 09-02-2012, 02:44
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: 148
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: Labview on PC -> C++ on cRIO

Since you are using c++, you could switch to the smart dashboard which can send data to the robot. There is already an API for sending and recording data called networktables.
  #8   Spotlight this post!  
Unread 09-02-2012, 03:10
jesusrambo jesusrambo is offline
Self-Proclaimed Programmer Messiah
AKA: JD Russo
FRC #2035 (Robo Rockin' Bots)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2010
Location: Carmel, CA
Posts: 114
jesusrambo is an unknown quantity at this point
Quote:
Originally Posted by Hjelstrom View Post
Since you are using c++, you could switch to the smart dashboard which can send data to the robot. There is already an API for sending and recording data called networktables.
Yes, this is a very good point.

I didn't use networktables in my Java code because the Java implementation is... terribly done. There are methods documented that don't actually exist, etc, etc.
  #9   Spotlight this post!  
Unread 12-02-2012, 04:13
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,107
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: Labview on PC -> C++ on cRIO

Would I be able to get a copy of the Network Tables for labview. We have our dashboard written in labview, and are trying to get the data sent back to our C++ robot code.

Thanks
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
  #10   Spotlight this post!  
Unread 12-02-2012, 08:59
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,756
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: Labview on PC -> C++ on cRIO

The LabVIEW implementation of Network Tables is on FIRSTForge in File Releases/Network Tables. Eight downloads have already happened, and I haven't heard any explosions, so I guess it is stable enough. But I do need to say that it was built from the spec and tested against the SmartDashboard and LabVIEW running on the other side. I didn't have enough time or tools to test it thoroughly. Also, I'm redoing some of it for performance and need to get transactions in. A few examples are needed as well.

Please let me hear any questions or issues.

Greg McKaskle
  #11   Spotlight this post!  
Unread 13-02-2012, 19:41
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,107
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: Labview on PC -> C++ on cRIO

We have been trying to set this up, and dont know exactly what functions to call on the driverstation and the CRIO. currently on the dashboard we have a loop which writes an int. we then on the crio we dont know exactly what code we need to init to read the table. would anyone be able to help us?
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
  #12   Spotlight this post!  
Unread 13-02-2012, 20:55
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,756
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: Labview on PC -> C++ on cRIO

Be sure to place the Client in parallel with the other dashboard code and to wire the robot's IP to the client VI. I don't believe any of the other inputs are needed.

Greg McKaskle
  #13   Spotlight this post!  
Unread 13-02-2012, 23:01
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,107
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: Labview on PC -> C++ on cRIO

Quote:
Originally Posted by Greg McKaskle View Post
Be sure to place the Client in parallel with the other dashboard code and to wire the robot's IP to the client VI. I don't believe any of the other inputs are needed.

Greg McKaskle
In the labview code do we use the server vi or the client vi. We are going to be using the dashboard to send the data over to the CRIO. On the crio we are running c++. The CRIO says we dont have a connection, and the value never changes when we are running the code
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.

Last edited by Thad House : 13-02-2012 at 23:05.
  #14   Spotlight this post!  
Unread 14-02-2012, 08:02
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,756
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: Labview on PC -> C++ on cRIO

The robot is the server. The dashboard is the client. So be sure to run the client on the dashboard, give it the robot IP address and make sure that it does the auto-restart. You may want to run interactively at first to see if they are connecting. Also, the default to sync is a table called SmartDashboard. If you need to sync others, add them to the list.

Greg McKaskle
  #15   Spotlight this post!  
Unread 15-02-2012, 22:35
nmg49 nmg49 is offline
Registered User
FRC #2898
 
Join Date: Jan 2012
Location: Portland Oregon
Posts: 4
nmg49 is an unknown quantity at this point
Re: Labview on PC -> C++ on cRIO

Hi Greg, I'm a programmer working on the project in question. We tried to write up a simple test program to see if we could get data from the Dashboard to the Crio (running in C++). I don't have the Labview code handy, but here is the C code that's suppose to receive the data:

bool myBoolean;
Safety->Feed();
NetworkTable *myNetworkTable = new NetworkTable;
myNetworkTable->BeginTransaction();
myNetworkTable->GetTable("Robot");
myBoolean = myNetworkTable->GetBoolean("Test");
myNetworkTable->EndTransaction();
printf("%d, MyValue: \n", myBoolean);
Wait(1);
delete myNetworkTable;

Should this code be working? Are we doing anything wrong, at least on the receiving end?

Also, I was looking through the libraries a bit and I realized that the C++ and Labview functionality are different. For example, C++ doesn't have a function to create a Network Table (at least not one that's accessible from the NetworkTable class).

Any help you could give us on this would be amazing. Thanks.
Closed Thread


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 01:44.

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