-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Some WPILib classes can be passed in as a parameter to Logger.recordOutput(...) since they implement the StructSerializable interface.
/**
* Records a single output field for easy access when viewing the log. On the simulator, use this
* method to record extra data based on the original inputs.
*
* <p>This method serializes an array of objects as a struct automatically. Top-level protobuf
* arrays are not supported.
*
* <p>This method is <b>not thread-safe</b> and should only be called from the main thread. Check
* the <a href=
* "https://docs.advantagekit.org/getting-started/common-issues/multithreading">documentation</a>
* for details.
*
* @param <T> The object type.
* @param key The name of the field to record. It will be stored under "/RealOutputs" or
* "/ReplayOutputs"
* @param value The value of the field.
*/
@SuppressWarnings("unchecked")
public static <T extends StructSerializable> void recordOutput(String key, T... value) {
if (running) {
outputTable.put(key, value);
}
}Implement these interfaces on our own classes that are meant to mirror the WPILib classes, like our Pose2d and Transform3d, so that they can be logged without fetching the wpilib object, if possible. Yes I don't know if this is possible.
Metadata
Metadata
Assignees
Labels
No labels