No announcement yet.

Data logging for beginners and non-software coaches.

  • Filter
  • Time
  • Show
Clear All
new posts

  • Data logging for beginners and non-software coaches.

    Well the kids are done with their season and learned a lot.
    Since they like to putter around between seasons, I want to get them started on some code work/skills so they are better equipped next season. One area is data-logging. This year they just printed various robot telemetry on the driver station screen. I'd like them to be able to create some sort of comma-delimited file they could get off the phones, driver or RC, which they could use for import into other applications for visualization and debugging. Ideally without slowing down the loop times and DS-to-RC delays and such.

    Can somebody point me to some example code and simple outline of how this could be accomplished?


  • #2
    We are doing something similar. We create a Datalogger object that internally contains a LinkedList of Object arrays (each Object[] represents one line). Throughout loop(), we add lines of data to it (since any type of Object is valid information, you can log any sort of information you want, as long as it has a useful toString() method). In stop(), we create a PrintWriter around a File stored in a "Datalogs" directory and write each line to it in order, with lines separated by newline characters and columns in a line separated by commas. We have written a second app to view the most recent log, but that isn't really necessary. You can either call cat on the file in the ADB shell, or transfer the file to your computer by ADB or through the file system and open it in something like Excel since it's just a CSV file.


    • #3
      Take a look of the DataLogger library in It shows an imlementation to allow multiple simultaneous data collection streams and rendering the results in Excel.

      In, look DlDemo to see an example of the datalogger usage.

      Cheers, Ollie