Skip to content

Commit

Permalink
Add URCL docs for DataLog-only config
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbonner committed Oct 5, 2024
1 parent d750aa6 commit eff3bb9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions docsSite/docs/more-features/urcl.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import TabItem from '@theme/TabItem';

Since REV does not provide an official method of automatically recording data from the Spark Max and Spark Flex, we have provided an unofficial alternative for Java and C++ called [URCL](https://github.com/Mechanical-Advantage/URCL) (**U**nofficial **R**EV-**C**ompatible **L**ogger). This enables live plotting and logging of all devices similar to CTRE's [Tuner X plotting feature](https://v6.docs.ctr-electronics.com/en/latest/docs/tuner/plotting.html) and [Phoenix 6 signal logger](https://pro.docs.ctr-electronics.com/en/latest/docs/api-reference/api-usage/signal-logging.html).

After setup, periodic CAN frames from all Spark Max and Spark Flex devices are published to NetworkTables. WPILib's [DataLogManager](https://docs.wpilib.org/en/stable/docs/software/telemetry/datalog.html) can be used to capture the data to a log file. These frames are then viewable in AdvantageScope (see [Managing Log Files](../getting-started/manage-files.md) and [Connecting to Live Sources](../getting-started/connect-live.md)).
After setup, periodic CAN frames from all Spark Max and Spark Flex devices are published to NetworkTables or DataLog. When using NetworkTables, WPILib's [DataLogManager](https://docs.wpilib.org/en/stable/docs/software/telemetry/datalog.html) can be used to capture the data to a log file. These frames are viewable in AdvantageScope (see [Managing Log Files](../getting-started/manage-files.md) and [Connecting to Live Sources](../getting-started/connect-live.md)).

- **All signals** are captured automatically, with **no manual setup for new devices**.
- **Every frame is captured**, even when the status frame period is faster than the robot loop cycle.
Expand All @@ -29,15 +29,19 @@ Install the URCL vendordep by going to "WPILib: Manage Vendor Libraries" > "Inst
https://raw.githubusercontent.com/Mechanical-Advantage/URCL/maven/URCL.json
```

URCL publishes to NetworkTables by default, but data can be saved to a log file by enabling WPILib's DataLogManager. The logger should be started in `robotInit`, as shown below.
URCL publishes to NetworkTables by default, where data can be saved to a log file by enabling WPILib's DataLogManager. Alternatively, URCL can log directly to a DataLog. The logger should be started in `robotInit`, as shown below.

<Tabs>
<TabItem value="java" label="WPILib (Java)" default>

```java
public void robotInit() {
// If publishing to NetworkTables and DataLog
DataLogManager.start();
URCL.start();

// If logging only to DataLog
URCL.start(DataLogManager.getLog());
}
```

Expand All @@ -49,8 +53,12 @@ public void robotInit() {
#include "URCL.h"

void Robot::RobotInit() {
// If publishing to NetworkTables and DataLog
frc::DataLogManager::Start();
URCL::Start();

// If logging only to DataLog
URCL::Start(frc::DataLogManager::GetLog());
}
```

Expand Down

0 comments on commit eff3bb9

Please sign in to comment.