Conversation
| private boolean inBounds(Pose2d pose2d) { | ||
| return pose2d.getX() > 0 && pose2d.getX() < 20 && pose2d.getY() > 0 && pose2d.getY() < 20; | ||
| public static boolean inBounds(Pose2d pose2d) { | ||
| return pose2d.getX() > 0 && pose2d.getX() < 16.5 && pose2d.getY() > 0 && pose2d.getY() < 8.1; |
There was a problem hiding this comment.
Make constants for FIELD_LENGTH and FIELD_WIDTH
| public Pose2d getPose() { | ||
| return swerveDrive.getPose(); | ||
| } | ||
| public Pose2d getSimulationPose() { |
There was a problem hiding this comment.
Add line spaces around the new method
| this.io = io; | ||
| estimator = new PoseEstimator(drivebase.getKinematics(), drivebase, 0, this); | ||
| estimator = new PoseEstimator(drivebase.getKinematics(), drivebase, 0, this); | ||
| robotPoseSupplier = drivebase::getSimulationPose; |
There was a problem hiding this comment.
Why can't we just use drive base.getSimulationPose when we need to? There is no value in hiding it behind a supplier.
| double cosIncidenceAngle = (-adjPose.getX() * Math.cos(adjPose.getRotation().getZ()) - adjPose.getY() * Math.sin(adjPose.getRotation().getZ())) / (adjPose.getTranslation().getNorm()); | ||
| double distance = tag.getTranslation().getDistance(cameraPos.getTranslation()); | ||
| if (distance / cosIncidenceAngle < Constants.MAX_VISION_DISTANCE_SIMULATION) { | ||
| VisionMeasurement measurement = new VisionMeasurement(new Pose2d(), distance, 0); |
There was a problem hiding this comment.
We should probably give this the right time (e.g. off of the Logger) to allow the filtering algorithms to do their thing.
| public abstract class BaseIoImpl<I extends LoggableInputs> implements BaseIo { | ||
| // The name of the "folder" where the logs from this IO will be logged | ||
| private final String prefix; | ||
| protected final String prefix; |
There was a problem hiding this comment.
Not needed if you call super.periodic from the subclass.
| return ordinal(); | ||
| return ordinal()+1; | ||
| } | ||
| public TagPose getTagInfo() { |
| THIRTY_ONE(0.32, 147.47, 21.75),//Tower, Blue z rotation:0 | ||
| THIRTY_TWO(0.32, 164.47, 21.75);//Tower, Blue z rotation:0 | ||
| */ | ||
| public record TagPose(Apriltag tag, Pose3d pose) {} |
|
|
||
| public Translation3d getTranslation() { | ||
| return new Translation3d(x, y, z); | ||
| return translation; |
There was a problem hiding this comment.
The translation is now returning distances in meters, but I don't think it makes a difference since no one (other than logging) is using this data.
| private AutoFactory autoFactory; | ||
| private static AutoRoutine straightRoutine; | ||
| private static AutoTrajectory straightTrajectory; | ||
| private final VisionTruster truster = new ConstantVisionTruster(visionMeasurementStdDevs2); |
There was a problem hiding this comment.
Should we be using this truster or the square one?
No description provided.