From 4958924358807a108a062743e4f73f60d5a59e87 Mon Sep 17 00:00:00 2001 From: caTrixLiu Date: Fri, 20 Sep 2024 09:25:03 +0800 Subject: [PATCH] fixed a little bug in game piece simulation --- .../frc/robot/subsystems/drive/HolonomicDriveSubsystem.java | 2 -- .../CompetitionFieldUtils/Objects/GamePieceInSimulation.java | 2 +- .../frc/robot/subsystems/drive/HolonomicDriveSubsystem.java | 2 -- .../CompetitionFieldUtils/Objects/GamePieceInSimulation.java | 2 +- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/example/5516-2024-OffSeason/src/main/java/frc/robot/subsystems/drive/HolonomicDriveSubsystem.java b/example/5516-2024-OffSeason/src/main/java/frc/robot/subsystems/drive/HolonomicDriveSubsystem.java index 7dbe117..e54b796 100644 --- a/example/5516-2024-OffSeason/src/main/java/frc/robot/subsystems/drive/HolonomicDriveSubsystem.java +++ b/example/5516-2024-OffSeason/src/main/java/frc/robot/subsystems/drive/HolonomicDriveSubsystem.java @@ -54,8 +54,6 @@ public interface HolonomicDriveSubsystem extends Subsystem { */ default void addVisionMeasurement(Pose2d visionPose, double timestamp, Matrix measurementStdDevs) {} - default double getPreviousVisionMeasurementTimeStamp() {return -1;} - /** * @return the measured(actual) velocities of the chassis, robot-relative * */ diff --git a/example/5516-2024-OffSeason/src/main/java/frc/robot/utils/CompetitionFieldUtils/Objects/GamePieceInSimulation.java b/example/5516-2024-OffSeason/src/main/java/frc/robot/utils/CompetitionFieldUtils/Objects/GamePieceInSimulation.java index 7f2a9d9..f8cae08 100644 --- a/example/5516-2024-OffSeason/src/main/java/frc/robot/utils/CompetitionFieldUtils/Objects/GamePieceInSimulation.java +++ b/example/5516-2024-OffSeason/src/main/java/frc/robot/utils/CompetitionFieldUtils/Objects/GamePieceInSimulation.java @@ -33,7 +33,7 @@ public GamePieceInSimulation(Translation2d initialPosition, Convex shape, double super(); BodyFixture bodyFixture = super.addFixture(shape); bodyFixture.setFriction(EDGE_COEFFICIENT_OF_FRICTION); - bodyFixture.setFriction(EDGE_COEFFICIENT_OF_RESTITUTION); + bodyFixture.setRestitution(EDGE_COEFFICIENT_OF_RESTITUTION); bodyFixture.setDensity(mass / shape.getArea()); super.setMass(MassType.NORMAL); diff --git a/src/main/java/frc/robot/subsystems/drive/HolonomicDriveSubsystem.java b/src/main/java/frc/robot/subsystems/drive/HolonomicDriveSubsystem.java index 7dbe117..e54b796 100644 --- a/src/main/java/frc/robot/subsystems/drive/HolonomicDriveSubsystem.java +++ b/src/main/java/frc/robot/subsystems/drive/HolonomicDriveSubsystem.java @@ -54,8 +54,6 @@ public interface HolonomicDriveSubsystem extends Subsystem { */ default void addVisionMeasurement(Pose2d visionPose, double timestamp, Matrix measurementStdDevs) {} - default double getPreviousVisionMeasurementTimeStamp() {return -1;} - /** * @return the measured(actual) velocities of the chassis, robot-relative * */ diff --git a/src/main/java/frc/robot/utils/CompetitionFieldUtils/Objects/GamePieceInSimulation.java b/src/main/java/frc/robot/utils/CompetitionFieldUtils/Objects/GamePieceInSimulation.java index 7f2a9d9..f8cae08 100644 --- a/src/main/java/frc/robot/utils/CompetitionFieldUtils/Objects/GamePieceInSimulation.java +++ b/src/main/java/frc/robot/utils/CompetitionFieldUtils/Objects/GamePieceInSimulation.java @@ -33,7 +33,7 @@ public GamePieceInSimulation(Translation2d initialPosition, Convex shape, double super(); BodyFixture bodyFixture = super.addFixture(shape); bodyFixture.setFriction(EDGE_COEFFICIENT_OF_FRICTION); - bodyFixture.setFriction(EDGE_COEFFICIENT_OF_RESTITUTION); + bodyFixture.setRestitution(EDGE_COEFFICIENT_OF_RESTITUTION); bodyFixture.setDensity(mass / shape.getArea()); super.setMass(MassType.NORMAL);