Go to Post Sometimes it's not about being fair. Some people are just very good at what they do. - Koko Ed [more]
Home
Go Back   Chief Delphi > Technical > Control System
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 18-12-2016, 21:20
OwenDotCode OwenDotCode is offline
Registered User
FRC #6201 (The Highlanders)
Team Role: Mechanical
 
Join Date: Nov 2016
Rookie Year: 2016
Location: massachusetts
Posts: 7
OwenDotCode is an unknown quantity at this point
Data Logging Through Driverstation

So my team has been wanting to collect more data than the driver station lets us. Ideally we don't want to be streaming this data over the network. We also need the data to not be lost if we lose power or brownout. Anyone have any ideas.

So far we have thought of:
USB drive in roborio
Raspberry Pi over Ethernet
Raspberry Pi over serial(done similarly to this)
Reply With Quote
  #2   Spotlight this post!  
Unread 18-12-2016, 22:22
kenfox kenfox is offline
Registered User
FRC #3322 (Eagle Imperium)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Ann Arbor, MI
Posts: 51
kenfox is a glorious beacon of lightkenfox is a glorious beacon of lightkenfox is a glorious beacon of lightkenfox is a glorious beacon of lightkenfox is a glorious beacon of light
Re: Data Logging Through Driverstation

You have plenty of capacity for logging to a file on the roboRIO. Just scp the match data off the robot when you get back to the pit.

The only thing you have to take care of is use a background thread for sync'ing data to disk. If you try to do that in the main robot thread, it will occasionally pause on you for much longer than a driver station event cycle.
Reply With Quote
  #3   Spotlight this post!  
Unread 18-12-2016, 22:37
phurley67 phurley67 is online now
Programming Mentor
FRC #0862 (Lightning Robotics)
Team Role: Mentor
 
Join Date: Apr 2014
Rookie Year: 2013
Location: Michigan
Posts: 65
phurley67 is an unknown quantity at this point
Re: Data Logging Through Driverstation

What language? You can find plenty of good examples. We have borrowed from a number of teams (thanks 254) with our base code for next year (java). See https://github.com/frc-862/valkyrie/ Check out the DataLogger, and, LogWriter, for a reasonable setup.

We log to a USB key, so as to be sure we never fill up the RIO. But if you are careful there is no risk of filling up the RIO in one or two matches.
Reply With Quote
  #4   Spotlight this post!  
Unread 19-12-2016, 07:08
OwenDotCode OwenDotCode is offline
Registered User
FRC #6201 (The Highlanders)
Team Role: Mechanical
 
Join Date: Nov 2016
Rookie Year: 2016
Location: massachusetts
Posts: 7
OwenDotCode is an unknown quantity at this point
Re: Data Logging Through Driverstation

We have considered both of those, but our issue if will those still work if the robot loses power?
Reply With Quote
  #5   Spotlight this post!  
Unread 19-12-2016, 07:12
OwenDotCode OwenDotCode is offline
Registered User
FRC #6201 (The Highlanders)
Team Role: Mechanical
 
Join Date: Nov 2016
Rookie Year: 2016
Location: massachusetts
Posts: 7
OwenDotCode is an unknown quantity at this point
Re: Data Logging Through Driverstation

Also we are using Java
Reply With Quote
  #6   Spotlight this post!  
Unread 19-12-2016, 11:14
Dwight_2's Avatar
Dwight_2 Dwight_2 is offline
Registered User
AKA: Dwight Howard
FRC #5842 (Royal Robotics)
Team Role: Leadership
 
Join Date: Sep 2016
Rookie Year: 2016
Location: New port Richey, FL
Posts: 37
Dwight_2 is an unknown quantity at this point
Re: Data Logging Through Driverstation

Quote:
Originally Posted by phurley67 View Post
What language? You can find plenty of good examples. We have borrowed from a number of teams (thanks 254) with our base code for next year (java). See https://github.com/frc-862/valkyrie/ Check out the DataLogger, and, LogWriter, for a reasonable setup.

We log to a USB key, so as to be sure we never fill up the RIO. But if you are careful there is no risk of filling up the RIO in one or two matches.
Your link is not working I don't know if you posted it wrong or some but my team is looking for a similar code to log the total distance our T-shirt cannon has traveled using encoders.
__________________
Systems Integration supervisor, CAD team, Drive team, Programming team (2016), Student team Co-Leader, Documentation Chair (2017)



"It Doesn't Get Easier. You Just Get Better."
Reply With Quote
  #7   Spotlight this post!  
Unread 19-12-2016, 11:24
bobbysq bobbysq is offline
Registered User
FRC #4646 (Team ASAP)
Team Role: Leadership
 
Join Date: Apr 2016
Rookie Year: 2015
Location: Des Moines, IA
Posts: 276
bobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud of
Re: Data Logging Through Driverstation

Quote:
Originally Posted by OwenDotCode View Post
We have considered both of those, but our issue if will those still work if the robot loses power?
If you log to something like a CSV as the data is collected, power loss shouldn't affect it since it'll only add one line at a time and it's a plain text file.
Reply With Quote
  #8   Spotlight this post!  
Unread 19-12-2016, 11:47
phurley67 phurley67 is online now
Programming Mentor
FRC #0862 (Lightning Robotics)
Team Role: Mentor
 
Join Date: Apr 2014
Rookie Year: 2013
Location: Michigan
Posts: 65
phurley67 is an unknown quantity at this point
Re: Data Logging Through Driverstation

Try it now (sorry about that, the repo was not supposed to be private).
Reply With Quote
  #9   Spotlight this post!  
Unread 19-12-2016, 18:26
OwenDotCode OwenDotCode is offline
Registered User
FRC #6201 (The Highlanders)
Team Role: Mechanical
 
Join Date: Nov 2016
Rookie Year: 2016
Location: massachusetts
Posts: 7
OwenDotCode is an unknown quantity at this point
Re: Data Logging Through Driverstation

Quote:
Quote:
Originally Posted by OwenDotCode
We have considered both of those, but our issue if will those still work if the robot loses power?
Quote:
If you log to something like a CSV as the data is collected, power loss shouldn't affect it since it'll only add one line at a time and it's a plain text file.
So would the CSV file be saved every time another line is added?

Thanks for the like to the Valkyrie, I will talk to my team about it at our next meeting.
Reply With Quote
  #10   Spotlight this post!  
Unread 19-12-2016, 18:47
phurley67 phurley67 is online now
Programming Mentor
FRC #0862 (Lightning Robotics)
Team Role: Mentor
 
Join Date: Apr 2014
Rookie Year: 2013
Location: Michigan
Posts: 65
phurley67 is an unknown quantity at this point
Re: Data Logging Through Driverstation

Our code will create a new file (with a new header record) every time the robot code restarts -- if it due to power loss, redeploy, or restart. It is pretty trivial to join a couple csv files either using bash script or in an editor.

Right now we are using sequential numbering, as we did all our off season testing using the qdriverstation and the date/time on the rio was not getting set. Probably going to change that, but it works as it (plus if the date is set the file's timestamps will be accurate).
Reply With Quote
  #11   Spotlight this post!  
Unread 20-12-2016, 20: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: Data Logging Through Driverstation

There are a number of good suggestions in this thread, but let me add a few points.

The OS and other utilities log things to the roboRIO flash all the time. A team is running with user privileges It should be pretty easy to look at your log file design, estimate usage, and determine whether a USB stick or RIO flash is the right approach. Also, if needed, you may want to disable buffering to on file open to better deal with power loss.

If you find that your CSV file is too large, binary files are often much smaller, typically a factor of five to ten.

Depending on the rate you want to log at, you may also want to consider network table logging. This logs the data at more like 10 Hz, but it automatically logs every variable update and it is built into the default DB. It is possible to build a custom DB and log faster if you wish.

I highly encourage you to log data, though. I love it when teams have data to understand what their robot is doing.

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 15:51.

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