Skip to content

Conversation

@literal-gargoyle
Copy link
Contributor

Added files and configs for vision subsystems

@literal-gargoyle
Copy link
Contributor Author

Uhh, spotless apply was already done D:

@sophiep29
Copy link
Contributor

Try rerunning and making sure the changes are committed and pushed, says spotless is still the issue

@literal-gargoyle
Copy link
Contributor Author

@sophiep29 forgot to push 😭

@sophiep29
Copy link
Contributor

lol alright I'll check over the code in a bit

public class Vision extends SubsystemBase {}
public class Vision extends SubsystemBase {
public static final PhotonCamera mainCamera =
new PhotonCamera(VisionConfig.MAIN_CAMERA_NAME); // Might be used for aprilTags? but I dunno
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for main camera, just call it driver camera

public static final PhotonPoseEstimator.PoseStrategy STRATEGY =
PhotonPoseEstimator.PoseStrategy.MULTI_TAG_PNP_ON_COPROCESSOR;
/*
//These are the previous year's camera locations.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't have to comment this out, just set those values to zero for now

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will also need a driver camera position given that it will also be used for apriltag processing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I leave the camera positions values zero for now? Or should I look at the cad and figure it out?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave them at zero for now, they aren't in the CAD. We'll measure them when the cameras are on the robot.

public static final String APRIL_LEFT_CAMERA_NAME = "aprilLeftCamera";
public static final String APRIL_RIGHT_CAMERA_NAME = "aprilRightCamera";

public static final double FIELD_LENGTH = Units.inchesToMeters(57);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the field is in feet, I'm not 100% sure if Units.feetToMeters exists so otherwise you'll have to multiply by 12

public static final double FIELD_LENGTH = Units.inchesToMeters(57);
public static final double FIELD_WIDTH = Units.inchesToMeters(27);

public static final List<AprilTag>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this should be good


public static final List<AprilTag>
aprilTags = // Using a List.of, as it is immutable. Kinda redundant cus of the final keyword,
// but its probs fine
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you want you can get rid of these comments since you don't need them anymore

new AprilTag(
3,
new Pose3d(
new Translation3d(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, Translation3d here is unnecessary as Pose3d has an x, y, z, and rotation3d constructor but this works here too

Units.inchesToMeters(46.0)),
new Rotation3d(0.0, 0.0, 180.0))));

public static final AprilTagFieldLayout bunnyBotsFieldLayout =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally we'd use this formatting: BUNNYBOTS_FIELD_LAYOUT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants