-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConstants.java
More file actions
42 lines (37 loc) · 2.09 KB
/
Constants.java
File metadata and controls
42 lines (37 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package frc.robot;
import edu.wpi.first.apriltag.AprilTagFieldLayout;
import edu.wpi.first.apriltag.AprilTagFields;
import edu.wpi.first.math.Matrix;
import edu.wpi.first.math.VecBuilder;
import edu.wpi.first.math.geometry.Rotation3d;
import edu.wpi.first.math.geometry.Transform3d;
import edu.wpi.first.math.geometry.Translation3d;
import edu.wpi.first.math.numbers.N1;
import edu.wpi.first.math.numbers.N3;
import swervelib.math.Matter;
import edu.wpi.first.units.Units;
/**
* The Constants class provides a convenient place for teams to hold robot-wide numerical or boolean constants. This
* class should not be used for any other purpose. All constants should be declared globally (i.e. public static). Do
* not put anything functional in this class.
*
* <p>It is advised to statically import this class (or one of its inner classes) wherever the
* constants are needed, to reduce verbosity.
*/
public final class Constants
{
public static class VisionSystem {
public static final Transform3d kRobotToCam =
new Transform3d(new Translation3d(Units.Meters.convertFrom(Units.Millimeters.convertFrom(15, Units.Inches) - 100, Units.Millimeters), Units.Meters.convertFrom((Units.Millimeters.convertFrom(15, Units.Inches) - 90), Units.Millimeters), Units.Meters.convertFrom(177, Units.Millimeters)), new Rotation3d(0, 0, Units.Radians.convertFrom(-33.3, Units.Degrees)));
// The layout of the AprilTags on the field
public static final AprilTagFieldLayout kTagLayout =
AprilTagFieldLayout.loadField(AprilTagFields.k2025ReefscapeWelded);
// The standard deviations of our vision estimated poses, which affect correction rate
// (Update values based on your own robot.)
public static final Matrix<N3, N1> kSingleTagStdDevs = VecBuilder.fill(4, 4, 8);
public static final Matrix<N3, N1> kMultiTagStdDevs = VecBuilder.fill(0.5, 0.5, 1);
}
}