12-26-2022 restore Return-to-Top function. Header-only link is no longer recognized, now requires full URL.
@ -24,7 +24,7 @@ Right-click this image to open a demonstration video in a new tab:
|
|||||||
<br><i><b>Datalogging demonstration on YouTube</b></i>
|
<br><i><b>Datalogging demonstration on YouTube</b></i>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
## Data Sources
|
## Data Sources
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ Data can accumulate and change rapidly, often too fast for detailed evaluation f
|
|||||||
<br>
|
<br>
|
||||||
<p align="center">[[/images/Datalogging-4/020-Datalogs-folder-circled.png|020-Datalogs-folder-circled]]
|
<p align="center">[[/images/Datalogging-4/020-Datalogs-folder-circled.png|020-Datalogs-folder-circled]]
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
## Writing a log file, Part 1
|
## Writing a log file, Part 1
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ Ultimately the log file will contain multiple lines of text, where each line is
|
|||||||
|
|
||||||
The Datalogger class' **key lines of code** are described here in six sections.
|
The Datalogger class' **key lines of code** are described here in six sections.
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
### Constructor
|
### Constructor
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ public Datalogger (String fileName) {
|
|||||||
|
|
||||||
<i>Note: the FileWriter() and StringBuffer() tasks need exception handling, omitted here for clarity.</i>
|
<i>Note: the FileWriter() and StringBuffer() tasks need exception handling, omitted here for clarity.</i>
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
### NewLine method
|
### NewLine method
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ public void newLine(){
|
|||||||
|
|
||||||
<i>Note: the writer.write() task needs exception handling, omitted here for clarity.</i>
|
<i>Note: the writer.write() task needs exception handling, omitted here for clarity.</i>
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
### AddField methods, for text
|
### AddField methods, for text
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ public void addField(char c) {
|
|||||||
|
|
||||||
Checking the line length (before inserting a comma) is not needed when a default timestamp (and its comma) will be inserted before all data, as in the current example. The check is here in case the default timestamp is removed.
|
Checking the line length (before inserting a comma) is not needed when a default timestamp (and its comma) will be inserted before all data, as in the current example. The check is here in case the default timestamp is removed.
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
### AddField method, for Booleans
|
### AddField method, for Booleans
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ public void addField(boolean b) {
|
|||||||
|
|
||||||
If the parameter b is true, the character '1' is logged. Otherwise the character '0' is logged.
|
If the parameter b is true, the character '1' is logged. Otherwise the character '0' is logged.
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
### AddField methods, for numbers
|
### AddField methods, for numbers
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ public void addField(double d) {
|
|||||||
|
|
||||||
Any `int` values are processed as `long`, through Java's implicit type casting or type promotion.
|
Any `int` values are processed as `long`, through Java's implicit type casting or type promotion.
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
### Closing method
|
### Closing method
|
||||||
|
|
||||||
@ -208,7 +208,7 @@ public void closeDataLogger() {
|
|||||||
|
|
||||||
<i>Note: the writer.close() task needs exception handling, omitted here for clarity.</i>
|
<i>Note: the writer.close() task needs exception handling, omitted here for clarity.</i>
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
### Full Datalogger class
|
### Full Datalogger class
|
||||||
|
|
||||||
@ -234,7 +234,7 @@ Study the Java code and its comments. Add any comments you think will help you
|
|||||||
|
|
||||||
Optional to right-click and Download that Java file, to store it safely on the laptop.
|
Optional to right-click and Download that Java file, to store it safely on the laptop.
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
### FTC Blocks programming
|
### FTC Blocks programming
|
||||||
|
|
||||||
@ -242,7 +242,7 @@ For **FTC Blocks** users, myBlocks can be created to provide Datalogger's method
|
|||||||
|
|
||||||
To get started, myBlocks should provide Datalogger's **instantiation** and its individual **methods** addField(), firstLine(), newLine(), resetTime() and closeDataLogger(). Use annotations with detailed comments/documentation describing how to use these myBlocks.
|
To get started, myBlocks should provide Datalogger's **instantiation** and its individual **methods** addField(), firstLine(), newLine(), resetTime() and closeDataLogger(). Use annotations with detailed comments/documentation describing how to use these myBlocks.
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
## Writing a log file, Part 2
|
## Writing a log file, Part 2
|
||||||
|
|
||||||
@ -257,7 +257,7 @@ Testing this OpMode can be done by simply rotating the Hub by hand, then looking
|
|||||||
|
|
||||||
The OpMode's **key lines of code** are described here in seven sections.
|
The OpMode's **key lines of code** are described here in seven sections.
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
### Set up Datalogger
|
### Set up Datalogger
|
||||||
|
|
||||||
@ -270,7 +270,7 @@ imuDL = new Datalogger(datalogFilename);
|
|||||||
|
|
||||||
Edit the logfile name (in quotes) for each run. A repeated name will over-write the previous datalog. Optional to Rename the saved file **after** each run.
|
Edit the logfile name (in quotes) for each run. A repeated name will over-write the previous datalog. Optional to Rename the saved file **after** each run.
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
### Name the data fields
|
### Name the data fields
|
||||||
|
|
||||||
@ -285,7 +285,7 @@ imuDL.firstLine(); // end first line (row)
|
|||||||
|
|
||||||
The `firstLine()` method is the same as `newLine()`, without adding a timestamp. It's not described above, for clarity.
|
The `firstLine()` method is the same as `newLine()`, without adding a timestamp. It's not described above, for clarity.
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
### Collect the data
|
### Collect the data
|
||||||
|
|
||||||
@ -297,7 +297,7 @@ myHeading = angles.firstAngle; // store Z-angle or heading
|
|||||||
readCount ++; // increment the counter
|
readCount ++; // increment the counter
|
||||||
```
|
```
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
### Add data to log file
|
### Add data to log file
|
||||||
|
|
||||||
@ -312,7 +312,7 @@ imuDL.addField(myHeading);
|
|||||||
imuDL.newLine(); // end the current set of readings
|
imuDL.newLine(); // end the current set of readings
|
||||||
```
|
```
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
### Optional: add DS telemetry
|
### Optional: add DS telemetry
|
||||||
|
|
||||||
@ -327,7 +327,7 @@ telemetry.update();
|
|||||||
|
|
||||||
These optional telemetry commands send data only to the Driver Station (DS) screen, not to the datalog file.
|
These optional telemetry commands send data only to the Driver Station (DS) screen, not to the datalog file.
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
### Optional: loop for time
|
### Optional: loop for time
|
||||||
|
|
||||||
@ -351,7 +351,7 @@ while (logTimer.time() < logDuration && opModeIsActive()) {
|
|||||||
|
|
||||||
Blocks programmers can refer to this [loop timer example](https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Timers-in-FTC-Blocks#1-loop-for-time). It's part of an FTC Wiki tutorial on [FTC Timers](https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Timers-in-FTC-Blocks), useful for Blocks and Java programmers.
|
Blocks programmers can refer to this [loop timer example](https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Timers-in-FTC-Blocks#1-loop-for-time). It's part of an FTC Wiki tutorial on [FTC Timers](https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Timers-in-FTC-Blocks), useful for Blocks and Java programmers.
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
### Close Datalogging
|
### Close Datalogging
|
||||||
|
|
||||||
@ -361,7 +361,7 @@ This housekeeping step must be performed when Datalogging is complete.
|
|||||||
imuDL.closeDataLogger(); // close Datalogger when finished
|
imuDL.closeDataLogger(); // close Datalogger when finished
|
||||||
```
|
```
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
### Full OpMode
|
### Full OpMode
|
||||||
|
|
||||||
@ -395,7 +395,7 @@ This example OpMode does **not** include two optional features mentioned above:
|
|||||||
|
|
||||||
- call to `resetTime()` method is commented out; it can restart the main timer (columns 1 & 2)
|
- call to `resetTime()` method is commented out; it can restart the main timer (columns 1 & 2)
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
## Run the OpMode
|
## Run the OpMode
|
||||||
|
|
||||||
@ -413,7 +413,7 @@ The test is done! At this point there should be a new log file on the RC device
|
|||||||
|
|
||||||
- It's OK to run the OpMode while the RC device is (optionally) connected wirelessly via Android Debug Bridge (adb), if used.
|
- It's OK to run the OpMode while the RC device is (optionally) connected wirelessly via Android Debug Bridge (adb), if used.
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
## Download log file
|
## Download log file
|
||||||
|
|
||||||
@ -431,7 +431,7 @@ The downloaded CSV filename may appear at the bottom of the browser window (gree
|
|||||||
|
|
||||||
If the sample Java class "Datalogger" was modified to store the log files elsewhere, they can be transferred using instructions from [Datalogging Part 3, RC File Transfer](https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging-Part-3,-RC-File-Transfer).
|
If the sample Java class "Datalogger" was modified to store the log files elsewhere, they can be transferred using instructions from [Datalogging Part 3, RC File Transfer](https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging-Part-3,-RC-File-Transfer).
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
## Import to spreadsheet
|
## Import to spreadsheet
|
||||||
|
|
||||||
@ -439,7 +439,7 @@ Now the CSV file is stored on the computer. The goal is to import this data to
|
|||||||
|
|
||||||
For the following example datalog, the OpMode was started, then the REV Control Hub was manually (slowly) rotated past 90 degrees, then the OpMode was stopped. This took about 15 seconds overall.
|
For the following example datalog, the OpMode was started, then the REV Control Hub was manually (slowly) rotated past 90 degrees, then the OpMode was stopped. This took about 15 seconds overall.
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
## Charting with Excel
|
## Charting with Excel
|
||||||
|
|
||||||
@ -463,7 +463,7 @@ Excel locks any open file. Close Excel, or the open CSV file, to allow an `adb
|
|||||||
|
|
||||||
Excel offers many more data evaluation features, beyond the scope of this tutorial. You are encouraged to learn and explore those features, ultimately providing a better understanding of robot performance. This may help you with troubleshooting, optimization and robot design.
|
Excel offers many more data evaluation features, beyond the scope of this tutorial. You are encouraged to learn and explore those features, ultimately providing a better understanding of robot performance. This may help you with troubleshooting, optimization and robot design.
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
## Charting with Google Sheets
|
## Charting with Google Sheets
|
||||||
|
|
||||||
@ -493,7 +493,7 @@ At top left, type a filename to replace "Untitled spreadsheet". There's no "sav
|
|||||||
|
|
||||||
Google Sheets offers many more data evaluation features, beyond the scope of this tutorial. You are encouraged to learn and explore those features, ultimately providing a better understanding of robot performance. This may help you with troubleshooting, optimization and robot design.
|
Google Sheets offers many more data evaluation features, beyond the scope of this tutorial. You are encouraged to learn and explore those features, ultimately providing a better understanding of robot performance. This may help you with troubleshooting, optimization and robot design.
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
## Summary
|
## Summary
|
||||||
|
|
||||||
@ -514,7 +514,7 @@ FTC students will benefit from this valuable skill, widely used in professional
|
|||||||
|
|
||||||
You are encouraged to submit and describe other examples that worked for you.
|
You are encouraged to submit and describe other examples that worked for you.
|
||||||
|
|
||||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Datalogging Part 4, Java Learning Exercise]]</i><p>
|
||||||
|
|
||||||
===========
|
===========
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user