Skip to content

Commit

Permalink
Remove warnings about missing WPILib structs
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbonner committed Dec 15, 2023
1 parent fdda52f commit b7105a8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
2 changes: 0 additions & 2 deletions docs/tabs/3D-FIELD.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ Logger.recordOutput("MyPoseArray", poseA, poseB);
Logger.recordOutput("MyPoseArray", new Pose3d[] {poseA, poseB});
```

> Note: Without AdvantageKit, WPILib does not currently support structured logging of trajectories (as of 2024.1.1-beta-2). Keep an eye out for updates on this feature. In the meantime, trajectories can be logged using `Field2d` or as an array of poses.
WPILib's [`Field2d`](https://docs.wpilib.org/en/stable/docs/software/dashboards/glass/field2d-widget.html) class can also be used to log several sets of 2D pose data together.

### Legacy Format
Expand Down
2 changes: 0 additions & 2 deletions docs/tabs/ODOMETRY.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ Logger.recordOutput("MyPoseArray", poseA, poseB);
Logger.recordOutput("MyPoseArray", new Pose3d[] {poseA, poseB});
```

> Note: Without AdvantageKit, WPILib does not currently support structured logging of trajectories (as of 2024.1.1-beta-2). Keep an eye out for updates on this feature. In the meantime, trajectories can be logged using `Field2d` or as an array of poses.
WPILib's [`Field2d`](https://docs.wpilib.org/en/stable/docs/software/dashboards/glass/field2d-widget.html) class can also be used to log several sets of pose data together.

### Legacy Format
Expand Down
17 changes: 7 additions & 10 deletions docs/tabs/SWERVE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,18 @@ SwerveModuleState[] states = new SwerveModuleState[] {
new SwerveModuleState()
}

// WPILib (Coming Soon!)
//
// StructArrayPublisher<SwerveModuleState> publisher = NetworkTableInstance.getDefault()
// .getStructArrayTopic("MyStates", SwerveModuleState.struct).publish();
//
// periodic() {
// publisher.set(states);
// }
// WPILib
StructArrayPublisher<SwerveModuleState> publisher = NetworkTableInstance.getDefault()
.getStructArrayTopic("MyStates", SwerveModuleState.struct).publish();

periodic() {
publisher.set(states);
}

// AdvantageKit
Logger.recordOutput("MyStates", states);
```

> Note: Without AdvantageKit, WPILib does not currently support struct logging of swerve module states (as of 2024.1.1-beta-2). Keep an eye out for updates on this feature. In the meantime, swerve states can be logged from WPILib in the legacy format described below.
Alternatively, the state fields can be numeric arrays with the format shown below. The rotation units are configurable (radians or degrees).

```
Expand Down

0 comments on commit b7105a8

Please sign in to comment.