[wpiutil] Add serializable marker interfaces (#6060)

This commit is contained in:
Peter Johnson
2023-12-23 08:20:26 -08:00
committed by GitHub
parent c1178d5add
commit aeb1a4aa33
27 changed files with 149 additions and 25 deletions

View File

@@ -6,12 +6,15 @@ package edu.wpi.first.math.controller;
import edu.wpi.first.math.controller.proto.ArmFeedforwardProto;
import edu.wpi.first.math.controller.struct.ArmFeedforwardStruct;
import edu.wpi.first.util.protobuf.ProtobufSerializable;
import edu.wpi.first.util.struct.StructSerializable;
/**
* A helper class that computes feedforward outputs for a simple arm (modeled as a motor acting
* against the force of gravity on a beam suspended at an angle).
*/
public class ArmFeedforward {
public class ArmFeedforward
implements ProtobufSerializable<ArmFeedforward>, StructSerializable<ArmFeedforward> {
public final double ks;
public final double kg;
public final double kv;

View File

@@ -6,9 +6,13 @@ package edu.wpi.first.math.controller;
import edu.wpi.first.math.controller.proto.DifferentialDriveWheelVoltagesProto;
import edu.wpi.first.math.controller.struct.DifferentialDriveWheelVoltagesStruct;
import edu.wpi.first.util.protobuf.ProtobufSerializable;
import edu.wpi.first.util.struct.StructSerializable;
/** Motor voltages for a differential drive. */
public class DifferentialDriveWheelVoltages {
public class DifferentialDriveWheelVoltages
implements ProtobufSerializable<DifferentialDriveWheelVoltages>,
StructSerializable<DifferentialDriveWheelVoltages> {
public double left;
public double right;

View File

@@ -9,12 +9,15 @@ import edu.wpi.first.math.Nat;
import edu.wpi.first.math.controller.proto.ElevatorFeedforwardProto;
import edu.wpi.first.math.controller.struct.ElevatorFeedforwardStruct;
import edu.wpi.first.math.system.plant.LinearSystemId;
import edu.wpi.first.util.protobuf.ProtobufSerializable;
import edu.wpi.first.util.struct.StructSerializable;
/**
* A helper class that computes feedforward outputs for a simple elevator (modeled as a motor acting
* against the force of gravity).
*/
public class ElevatorFeedforward {
public class ElevatorFeedforward
implements ProtobufSerializable<ElevatorFeedforward>, StructSerializable<ElevatorFeedforward> {
public final double ks;
public final double kg;
public final double kv;