![]() |
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! |
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.
|
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. |
Re: Accessing files on the driver station laptop from the robot
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. 3.I didn't know it was possible, how can it be done with a batch file? |
Re: Accessing files on the driver station laptop from the robot
Quote:
Quote:
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:
|
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 |
| All times are GMT -5. The time now is 20:42. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi