OCCRA
Go to Post Every team in FIRST can make this choice. Be positive, help others, and work like a maniac behind the scenes. This approach will bring you joy and satisfaction, whether you win or not. - OZ_341 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media  
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 08-11-2018, 05:36 AM
REEE8822 REEE8822 is offline
Registered User
FRC #4739
 
Join Date: Aug 2018
Location: Australia
Posts: 2
REEE8822 is an unknown quantity at this point
Placing files in the Nonvolatile memory or ROM of a RoboRIO without recompiling code

Being able to tweak how your robot runs robot runs on the fly can be extremely useful. Smart Dashboard does a great job of this, especially since the code does not have to be recompiled if a change is made. However, this doesn't seem to work for larger files (eg. autonomous paths). Is it possible to put these larger files in the Nonvolatile memory or ROM of the RoboRIO to be accessed inside a C++ program or to transmit them from the driver station to the robot at runtime? I am aware that I could embed these files inside the code before it is compiled, but is there a better way than to recompile your code every time that an autonomous path is tweaked?
Reply With Quote
  #2   Spotlight this post!  
Unread 08-11-2018, 08:55 AM
gerthworm's Avatar
gerthworm gerthworm is offline
Making the 1's and 0's
FRC #1736 (Robot Casserole)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Peoria, IL
Posts: 709
gerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond repute
Re: Placing files in the Nonvolatile memory or ROM of a RoboRIO without recompiling c

Not sure if there's a specific technology for storage you're trying to target. But, since the RIO supports USB and a filesystem, we just attach a flash drive and dump files there to store data.Here's an example of our code where we create these files for data logging purposes. It's Java, but I'm assume the C++ standard file read/write functions should work the same way.
Reply With Quote
  #3   Spotlight this post!  
Unread 08-11-2018, 09:06 AM
marshall's Avatar
marshall marshall is offline
Online Stripe & Drape Sales
FRC #0900 (The Zebracorns)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2003
Location: North Carolina
Posts: 3,029
marshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond repute
Re: Placing files in the Nonvolatile memory or ROM of a RoboRIO without recompiling c

Quote:
Originally Posted by gerthworm View Post
Not sure if there's a specific technology for storage you're trying to target. But, since the RIO supports USB and a filesystem, we just attach a flash drive and dump files there to store data.Here's an example of our code where we create these files for data logging purposes. It's Java, but I'm assume the C++ standard file read/write functions should work the same way.
They do. File access on the roboRIO is slooooooooow and depending on how much you are writing then it can fill up buffers and cause delays elsewhere..

Sounds like OP just wants to read from it though. USB mass storage devices work brilliantly.
__________________
"La mejor salsa del mundo es la hambre" - Miguel de Cervantes
"The future is unwritten" - Joe Strummer
"Simplify, then add lightness" - Colin Chapman
Clarke's Laws
Reply With Quote
  #4   Spotlight this post!  
Unread 08-11-2018, 09:12 AM
gerthworm's Avatar
gerthworm gerthworm is offline
Making the 1's and 0's
FRC #1736 (Robot Casserole)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Peoria, IL
Posts: 709
gerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond repute
Re: Placing files in the Nonvolatile memory or ROM of a RoboRIO without recompiling c

Quote:
Originally Posted by marshall View Post
They do. File access on the roboRIO is slooooooooow and depending on how much you are writing then it can fill up buffers and cause delays elsewhere..

Sounds like OP just wants to read from it though. USB mass storage devices work brilliantly.
Fair enough - I've never bothered to benchmark the file speeds, but probably should at some point...

So given the slow speed, the proper strategy is to buffer to RAM before actually needing to use the data... in DisabledInit or DisabledPeriodic() perhaps?
Reply With Quote
  #5   Spotlight this post!  
Unread 08-11-2018, 09:17 AM
marshall's Avatar
marshall marshall is offline
Online Stripe & Drape Sales
FRC #0900 (The Zebracorns)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2003
Location: North Carolina
Posts: 3,029
marshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond repute
Re: Placing files in the Nonvolatile memory or ROM of a RoboRIO without recompiling c

Quote:
Originally Posted by gerthworm View Post
Fair enough - I've never bothered to benchmark the file speeds, but probably should at some point...

So given the slow speed, the proper strategy is to buffer to RAM before actually needing to use the data... in DisabledInit or DisabledPeriodic() perhaps?
That I don't know... there isn't much RAM on the roboRIO either unfortunately.

We started dumping IO across the network and having the Jetson log it because it could keep up and getting the packet to the line didn't take nearly as long as trying to write it to the filesystem. Granted, we're a bit of an odd unicorn when it comes to what we're doing on the roboRIO. We shouldn't be held up as an example of what to do or not to do... we're just doing.
__________________
"La mejor salsa del mundo es la hambre" - Miguel de Cervantes
"The future is unwritten" - Joe Strummer
"Simplify, then add lightness" - Colin Chapman
Clarke's Laws
Reply With Quote
  #6   Spotlight this post!  
Unread 08-11-2018, 09:33 AM
gerthworm's Avatar
gerthworm gerthworm is offline
Making the 1's and 0's
FRC #1736 (Robot Casserole)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Peoria, IL
Posts: 709
gerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond repute
Re: Placing files in the Nonvolatile memory or ROM of a RoboRIO without recompiling c

Quote:
Originally Posted by marshall View Post
That I don't know... there isn't much RAM on the roboRIO either unfortunately.

We started dumping IO across the network and having the Jetson log it because it could keep up and getting the packet to the line didn't take nearly as long as trying to write it to the filesystem. Granted, we're a bit of an odd unicorn when it comes to what we're doing on the roboRIO. We shouldn't be held up as an example of what to do or not to do... we're just doing.
Nifty! I'll admit, some years, we've been logging enough that we've seen processor load jump by 20% just from adding the log processing/writing (abet with ~100 signals logged). I always thought "boy that stinks" but it never pushed us past 100%, and during build season these sorts of things tend to fall to the bottom of the priority list...

The idea of doing logging offboard is intriguing for sure. I'm starting to brew up an idea for a 2.0 version of our current data logging/viewing architecture....
Reply With Quote
  #7   Spotlight this post!  
Unread 08-12-2018, 01:24 AM
Aric5301's Avatar
Aric5301 Aric5301 is offline
Registered User
AKA: Aric Radzin
FRC #3339 (BumbleB)
Team Role: Leadership
 
Join Date: Jan 2017
Rookie Year: 2014
Location: Kfar Yona, Israel
Posts: 6
Aric5301 is an unknown quantity at this point
For the 2017 season, we were programming in LabVIEW and therefore changing parameters on-the-fly without re-building the code was extremely important because it takes a lot of time on LabVIEW.
We had an algorithm that took all our important parameters and made a json file out of them, which we then placed in the RoboRIO memory.
Then, we just read this file everytime the robot booted and of course we could edit it without even starting LabVIEW by just accessing the RoboRIO memory (We used FileZilla for that).

Sent from my ONEPLUS A3010 using Tapatalk
Reply With Quote
  #8   Spotlight this post!  
Unread 08-12-2018, 11:18 AM
Prateek M's Avatar
Prateek M Prateek M is offline
Kotlin Master Race
FRC #5190 (Green Hope Falcons)
Team Role: Programmer
 
Join Date: May 2018
Rookie Year: 2018
Location: Cary, North Carolina
Posts: 41
Prateek M is on a distinguished road
Re: Placing files in the Nonvolatile memory or ROM of a RoboRIO without recompiling c

Quote:
Originally Posted by REEE8822 View Post
Being able to tweak how your robot runs robot runs on the fly can be extremely useful. Smart Dashboard does a great job of this, especially since the code does not have to be recompiled if a change is made. However, this doesn't seem to work for larger files (eg. autonomous paths). Is it possible to put these larger files in the Nonvolatile memory or ROM of the RoboRIO to be accessed inside a C++ program or to transmit them from the driver station to the robot at runtime? I am aware that I could embed these files inside the code before it is compiled, but is there a better way than to recompile your code every time that an autonomous path is tweaked?
We developed a program to send serialized Pathfinder paths over the network for the very purpose of not re-deploying to test. That is available here:
https://github.com/5190GreenHopeRobotics/2018Feeder

These paths are then read in the robot code here

Alternatively, if your command to run a path reads from a location on the RIO file system, you can just SSH the paths in a serializable format to the RIO and the next time you read from that location, it should read the new path.
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 11:14 PM.

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


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi