diff --git a/junction/core/src/org/littletonrobotics/junction/AutoLogOutputManager.java b/junction/core/src/org/littletonrobotics/junction/AutoLogOutputManager.java index 25ec70e0..674be517 100644 --- a/junction/core/src/org/littletonrobotics/junction/AutoLogOutputManager.java +++ b/junction/core/src/org/littletonrobotics/junction/AutoLogOutputManager.java @@ -13,8 +13,6 @@ package org.littletonrobotics.junction; -import edu.wpi.first.math.kinematics.SwerveModuleState; -import edu.wpi.first.math.proto.Trajectory; import edu.wpi.first.wpilibj.smartdashboard.Mechanism2d; import edu.wpi.first.units.Measure; import java.lang.reflect.Field; @@ -329,13 +327,6 @@ private static void registerField(String key, Class type, Supplier supplie if (value != null) Logger.recordOutput(key, (String[]) value); }); - } else if (componentType.equals(SwerveModuleState.class)) { - callbacks.add( - () -> { - Object value = supplier.get(); - if (value != null) - Logger.recordOutput(key, (SwerveModuleState[]) value); - }); } else { callbacks.add( () -> { @@ -403,13 +394,6 @@ private static void registerField(String key, Class type, Supplier supplie if (value != null) Logger.recordOutput(key, (Measure) value); }); - } else if (type.equals(Trajectory.class)) { - callbacks.add( - () -> { - Object value = supplier.get(); - if (value != null) - Logger.recordOutput(key, (Trajectory) value); - }); } else if (type.equals(Mechanism2d.class)) { callbacks.add( () -> { diff --git a/junction/core/src/org/littletonrobotics/junction/CustomStructs.java b/junction/core/src/org/littletonrobotics/junction/CustomStructs.java deleted file mode 100644 index df85a8e7..00000000 --- a/junction/core/src/org/littletonrobotics/junction/CustomStructs.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2021-2023 FRC 6328 -// http://github.com/Mechanical-Advantage -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// version 3 as published by the Free Software Foundation or -// available in the root directory of this project. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -package org.littletonrobotics.junction; - -import java.nio.ByteBuffer; - -import edu.wpi.first.math.geometry.Pose3d; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.math.kinematics.SwerveModuleState; -import edu.wpi.first.util.struct.Struct; - -public final class CustomStructs { - public static final class ASwerveModuleState implements Struct { - @Override - public Class getTypeClass() { - return SwerveModuleState.class; - } - - @Override - public String getTypeString() { - return "struct:SwerveModuleState"; - } - - @Override - public int getSize() { - return kSizeDouble + Rotation2d.struct.getSize(); - } - - @Override - public String getSchema() { - return "double speed;Rotation2d angle"; - } - - @Override - public Struct[] getNested() { - return new Struct[] { Rotation2d.struct }; - } - - @Override - public SwerveModuleState unpack(ByteBuffer bb) { - double speed = bb.getDouble(); - Rotation2d angle = Rotation2d.struct.unpack(bb); - return new SwerveModuleState(speed, angle); - } - - @Override - public void pack(ByteBuffer bb, SwerveModuleState value) { - bb.putDouble(value.speedMetersPerSecond); - Rotation2d.struct.pack(bb, value.angle); - } - } - - public static final ASwerveModuleState swerveModuleState = new ASwerveModuleState(); -} \ No newline at end of file diff --git a/junction/core/src/org/littletonrobotics/junction/Logger.java b/junction/core/src/org/littletonrobotics/junction/Logger.java index 4a00b4c2..6cd23660 100644 --- a/junction/core/src/org/littletonrobotics/junction/Logger.java +++ b/junction/core/src/org/littletonrobotics/junction/Logger.java @@ -39,8 +39,6 @@ import edu.wpi.first.math.MathShared; import edu.wpi.first.math.MathSharedStore; import edu.wpi.first.math.MathUsageId; -import edu.wpi.first.math.kinematics.SwerveModuleState; -import edu.wpi.first.math.trajectory.Trajectory; import edu.wpi.first.math.geometry.Pose2d; import edu.wpi.first.math.geometry.Pose3d; import edu.wpi.first.wpilibj.DriverStation; @@ -719,32 +717,6 @@ public static void recordOutput(String key, T... value) { } } - /** - * 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. - * - * The trajectory is logged as a series of poses. - * - * @param key The name of the field to record. It will be stored under - * "/RealOutputs" or "/ReplayOutputs" - * @param value The value of the field. - */ - public static void recordOutput(String key, Trajectory value) { - recordOutput(key, Pose2d.struct, value.getStates().stream().map(state -> state.poseMeters).toArray(Pose2d[]::new)); - } - - /** - * 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. - * - * @param key The name of the field to record. It will be stored under - * "/RealOutputs" or "/ReplayOutputs" - * @param value The value of the field. - */ - public static void recordOutput(String key, SwerveModuleState... value) { - recordOutput(key, CustomStructs.swerveModuleState, value); - } - /** * 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.