From: maxwtan <100314265+MaxwellTTan20@users.noreply.github.com> Date: Tue, 24 Feb 2026 23:01:42 +0000 (-0800) Subject: Update VisionConstants.java X-Git-Url: https://git.taranathan.com/?a=commitdiff_plain;h=097f0c0603e8ed6af0b4b435ac2ce0f9acdcadaf;p=FRC2026.git Update VisionConstants.java --- diff --git a/src/main/java/frc/robot/constants/VisionConstants.java b/src/main/java/frc/robot/constants/VisionConstants.java index 83a56d6..39cf88a 100644 --- a/src/main/java/frc/robot/constants/VisionConstants.java +++ b/src/main/java/frc/robot/constants/VisionConstants.java @@ -19,118 +19,118 @@ import edu.wpi.first.math.util.Units; * Container class for vision constants. */ public class VisionConstants { - /** - * If April tag vision is enabled on the robot - */ - public static final boolean ENABLED = true; - - /** - * If object detection should be enabled - */ - public static final boolean OBJECT_DETECTION_ENABLED = false; - - /** If odometry should be updated using vision during auto */ - public static final boolean ENABLED_AUTO = true; - - /** - * If odometry should be updated using vision while running the GoToPose, - * GoToPosePID, and DriveToPose commands in teleop - */ - public static final boolean ENABLED_GO_TO_POSE = true; - - /** If vision should be simulated */ - public static final boolean ENABLED_SIM = false; - - /** If vision should only return values if it can see 2 good targets */ - public static final boolean ONLY_USE_2_TAGS = false; - - /** PoseStrategy to use in pose estimation */ - public static final PoseStrategy POSE_STRATEGY = PoseStrategy.MULTI_TAG_PNP_ON_COPROCESSOR; - - /** Fallback PoseStrategy if MultiTag doesn't work */ - public static final PoseStrategy MULTITAG_FALLBACK_STRATEGY = PoseStrategy.LOWEST_AMBIGUITY; - - /** - * Any April tags we always want to ignore. To ignore a tag, put its id in this - * array. - */ - public static final int[] TAGS_TO_IGNORE = {}; - - /** - * If multiple cameras return different poses, they will be ignored if the - * difference between them is greater than this - */ - public static final double MAX_POSE_DIFFERENCE = 0.2; - - /** - * The maximum distance to the tag to use - */ - public static final double MAX_DISTANCE = 2; - - /** If vision should use manual calculations */ - public static final boolean USE_MANUAL_CALCULATIONS = true; - - //
- * The options are: - *
- * 0: Disable driver assist - *
- * 1: Completely remove the component of the driver's input that is not toward - * the object - *
- * 2: Interpolate between the next achievable driver speed and a speed - * calculated using trapezoid profiles - *
- * 3-5: Add a speed perpendicular to the driver input; there are 3 similar but - * different calculations for this - */ - public static final int DRIVER_ASSIST_MODE = 5; - - /** - * The number to multiply the distance to the April tag by. - *
- * Only affects manual calculations. - *
- * To find this, set it to 1 and measure the actual distance and the calculated - * distance. - *
- * This should not be needed, and it is only here because it improved the
- * accuracy of vision in the 2023 fall semester
- */
- public static final double DISTANCE_SCALE = 1;
-
- /**
- * The standard deviations to use for vision
- */
- public static final Matrix
- * Only affects calculations using PhotonVision, not manual calculations.
- */
- public static final double HIGHEST_AMBIGUITY = 0.01;
-
- public static final int MAX_EMPTY_TICKS = 10;
+ /**
+ * If April tag vision is enabled on the robot
+ */
+ public static final boolean ENABLED = true;
+
+ /**
+ * If object detection should be enabled
+ */
+ public static final boolean OBJECT_DETECTION_ENABLED = false;
+
+ /** If odometry should be updated using vision during auto */
+ public static final boolean ENABLED_AUTO = true;
+
+ /**
+ * If odometry should be updated using vision while running the GoToPose,
+ * GoToPosePID, and DriveToPose commands in teleop
+ */
+ public static final boolean ENABLED_GO_TO_POSE = true;
+
+ /** If vision should be simulated */
+ public static final boolean ENABLED_SIM = false;
+
+ /** If vision should only return values if it can see 2 good targets */
+ public static final boolean ONLY_USE_2_TAGS = false;
+
+ /** PoseStrategy to use in pose estimation */
+ public static final PoseStrategy POSE_STRATEGY = PoseStrategy.MULTI_TAG_PNP_ON_COPROCESSOR;
+
+ /** Fallback PoseStrategy if MultiTag doesn't work */
+ public static final PoseStrategy MULTITAG_FALLBACK_STRATEGY = PoseStrategy.LOWEST_AMBIGUITY;
+
+ /**
+ * Any April tags we always want to ignore. To ignore a tag, put its id in this
+ * array.
+ */
+ public static final int[] TAGS_TO_IGNORE = {};
+
+ /**
+ * If multiple cameras return different poses, they will be ignored if the
+ * difference between them is greater than this
+ */
+ public static final double MAX_POSE_DIFFERENCE = 0.2;
+
+ /**
+ * The maximum distance to the tag to use
+ */
+ public static final double MAX_DISTANCE = 6;
+
+ /** If vision should use manual calculations */
+ public static final boolean USE_MANUAL_CALCULATIONS = true;
+
+ //
+ * The options are:
+ *
+ * 0: Disable driver assist
+ *
+ * 1: Completely remove the component of the driver's input that is not toward
+ * the object
+ *
+ * 2: Interpolate between the next achievable driver speed and a speed
+ * calculated using trapezoid profiles
+ *
+ * 3-5: Add a speed perpendicular to the driver input; there are 3 similar but
+ * different calculations for this
+ */
+ public static final int DRIVER_ASSIST_MODE = 5;
+
+ /**
+ * The number to multiply the distance to the April tag by.
+ *
+ * Only affects manual calculations.
+ *
+ * To find this, set it to 1 and measure the actual distance and the calculated
+ * distance.
+ *
+ * This should not be needed, and it is only here because it improved the
+ * accuracy of vision in the 2023 fall semester
+ */
+ public static final double DISTANCE_SCALE = 1;
+
+ /**
+ * The standard deviations to use for vision
+ */
+ public static final Matrix
+ * Only affects calculations using PhotonVision, not manual calculations.
+ */
+ public static final double HIGHEST_AMBIGUITY = 0.05;
+
+ public static final int MAX_EMPTY_TICKS = 10;
/**
* The camera poses
@@ -153,30 +153,45 @@ public class VisionConstants {
public static final ArrayList did not work
+ /**
+ * Which version of driver assist to use. This would be an enum, except there is
+ * no short and descriptive name for all of these.
+ *