Go to Post The mecanum is like the dress shoe, the treaded wheel is like the athletic shoe. - Chris Fultz [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 10-06-2016, 10:41
GuyM142's Avatar
GuyM142 GuyM142 is offline
Registered User
AKA: Guy
FRC #3339 (BumbleBee)
Team Role: Mentor
 
Join Date: Jul 2013
Rookie Year: 2012
Location: Israel
Posts: 156
GuyM142 is just really niceGuyM142 is just really niceGuyM142 is just really niceGuyM142 is just really niceGuyM142 is just really nice
Question Accessing files on the driver station laptop from the robot

Hey everyone,
Our team is working on some off-season projects and one of them is reading parameters to the robot from a text file (possibly using config files)
We know how to process the file when it's local but we try to make it easier to edit and want to have the file stored on the driver station laptop.
What is the best way to read the config text file from the robot?

Can we use ftp VI's to copy it to the roboRIO through the FMS? (Will it work?)

We also had an idea to send the entire file as a string through Network Tables VI's and then read it on the roboRIO and save as a (.ini) file to process it. (Can the Network Tables handle such long string efficiently?)

We are looking for other teams' solutions and we will be happy if you will share your experience with us.

Thank you!
__________________
2016-2017 - Programming Mentor
Curie Sub-Division Champions with 694, 379 & 1511
2015 - Team Captain & Head of Programming Crew
Carson Sub-Division Champions with 1325, 20 & 1711
First ever Israeli team on Einstein
2014 - Team Captain & Head of Programming Crew
2013 - Head of Programming Crew
2012 - Member of Programming Crew

Last edited by GuyM142 : 10-06-2016 at 12:32.
Reply With Quote
  #2   Spotlight this post!  
Unread 10-06-2016, 12:07
Sperkowsky's Avatar
Sperkowsky Sperkowsky is offline
Professional Multitasker
AKA: Samuel Perkowsky
FRC #2869 (Regal Eagles)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Bethpage, NY
Posts: 1,875
Sperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond repute
Re: Accessing files on the driver station laptop from the robot

+1 on this our programmer wrote some xml autonomous thing and wanted to know if he could do this.
Reply With Quote
  #3   Spotlight this post!  
Unread 10-06-2016, 12:41
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Accessing files on the driver station laptop from the robot

I suppose you could run an ftp server on the Driver Station computer and have the robot program connect and transfer the file. That does mean you will have to delay the initialization of your robot program until after there is a network connection.

If you are considering Network Tables at all, why not just use a Dashboard program to read the file and publish Network Tables variables for the configuration parameters? I think the Java SmartDashboard will do that sort of thing for you.

Why don't you want to put the file on the robot itself? I can think of a couple of ways to make doing that less of a hassle, the easiest of which might be to use a simple batch file to copy the file from the Driver Station computer to the robot filesystem after you've made changes to it.
Reply With Quote
  #4   Spotlight this post!  
Unread 10-06-2016, 12:55
GuyM142's Avatar
GuyM142 GuyM142 is offline
Registered User
AKA: Guy
FRC #3339 (BumbleBee)
Team Role: Mentor
 
Join Date: Jul 2013
Rookie Year: 2012
Location: Israel
Posts: 156
GuyM142 is just really niceGuyM142 is just really niceGuyM142 is just really niceGuyM142 is just really niceGuyM142 is just really nice
Re: Accessing files on the driver station laptop from the robot

Quote:
Originally Posted by Alan Anderson View Post
I suppose you could run an ftp server on the Driver Station computer and have the robot program connect and transfer the file. That does mean you will have to delay the initialization of your robot program until after there is a network connection.

If you are considering Network Tables at all, why not just use a Dashboard program to read the file and publish Network Tables variables for the configuration parameters? I think the Java SmartDashboard will do that sort of thing for you.

Why don't you want to put the file on the robot itself? I can think of a couple of ways to make doing that less of a hassle, the easiest of which might be to use a simple batch file to copy the file from the Driver Station computer to the robot filesystem after you've made changes to it.
1. Is there a way I can make sure that everything that is working at home will work with field setup as well? That's my biggest concern.
2. I remember reading about a team which tried to do that and had problems (with over 100 parameters). I will search for it.
3.I didn't know it was possible, how can it be done with a batch file?
__________________
2016-2017 - Programming Mentor
Curie Sub-Division Champions with 694, 379 & 1511
2015 - Team Captain & Head of Programming Crew
Carson Sub-Division Champions with 1325, 20 & 1711
First ever Israeli team on Einstein
2014 - Team Captain & Head of Programming Crew
2013 - Head of Programming Crew
2012 - Member of Programming Crew
Reply With Quote
  #5   Spotlight this post!  
Unread 10-06-2016, 14:32
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Accessing files on the driver station laptop from the robot

Quote:
Originally Posted by GuyM142 View Post
1. Is there a way I can make sure that everything that is working at home will work with field setup as well? That's my biggest concern.
That's a legitimate concern. If you can ensure that you're only using the defined open port numbers, and if you have a good way of finding out the Driver Station's IP address, you should be fine. The communication library in the robot program definitely knows the address you need to talk to, because it's receiving data from it. I don't know if LabVIEW's built-in ftp function can be told to use a nonstandard port number, though.

Quote:
2. I remember reading about a team which tried to do that and had problems (with over 100 parameters). I will search for it.
How much run-time configuration are you trying to do?!

It might actually end up being reasonable to put a specialized web server on the roboRIO that lets you edit the configuration file in place.

Quote:
3.I didn't know it was possible, how can it be done with a batch file?
The batch file just has to invoke the command-line ftp client to copy the file from wherever you keep it on the laptop to wherever you want to put it on the roboRIO. It's just a way to make things so you don't have to type the command every time you want to run it.
Reply With Quote
  #6   Spotlight this post!  
Unread 11-06-2016, 10:49
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: Accessing files on the driver station laptop from the robot

There was a new feature added to network tables this last year called persistence.

You can programmatically set persistence on a variable, using the Get or Update Persistence VIs (with blue floppies on the icon), or you can double-click on a variable in the dashboard to set or shift double-click to clear it.

What is persistence?
It means that the robot code will write the value to an ini-based file to keep the last known value. This is primarily for PID or pot tunings, and not as good for an auto-recipe. But if you think about it, as long as it is in network tables, it is the same on both sides. So you don't need to put the file on the robot. You can just read the file on the DB and update the variable(s) and they will show up on the robot. You can also persist them so that this is only needed when it changes.

To your original question, you can write a new program, use a command line batch file, or add code to a custom DB in order to read a file on the push of a button and send it to the robot using ftp, sftp, DAV, etc. You will need to make sure that the robot knows when to read the new file, and make sure that it is convenient to run that code.

A more manual method would be to put the file on a memory stick and insert it into the roboRIO's USB host port.

Greg McKaskle
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 17:46.

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