Skip to content

Commit

Permalink
Add switch statement for coprocessor camera name
Browse files Browse the repository at this point in the history
  • Loading branch information
bforcum committed Mar 4, 2024
1 parent 967796b commit ad93c82
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
14 changes: 13 additions & 1 deletion src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,18 @@ public static class SwerveDrivetrainConstants {
public static class VisionConstants {

public static final Transform3d CAMERA_POSE = new Transform3d(0.5, 0, 0.25, new Rotation3d());
public static final String CAMERA_NAME = "Arducam_OV9281_USB_Camera";
static {
switch (currentBot) {
case WOOD_BOT:
CAMERA_NAME = "Arducam_OV2311_USB_Camera";
break;
case COMP_BOT:
default:
CAMERA_NAME = "Arducam_OV9281_USB_Camera";
break;
}
}
public static final String CAMERA_NAME;
// public static final String CAMERA_NAME = "Arducam_OV9281_USB_Camera";
}
}
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/Vision.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/** Vision subsystem */
public class Vision extends SubsystemBase {

private final static boolean DEBUG_INFO = false;
private final static boolean DEBUG_INFO = true;

final PhotonCamera camera;
final Transform3d robotToCamera;
Expand Down
10 changes: 5 additions & 5 deletions vendordeps/photonlib.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"fileName": "photonlib.json",
"name": "photonlib",
"version": "v2024.2.4",
"version": "v2024.2.8",
"uuid": "515fe07e-bfc6-11fa-b3de-0242ac130004",
"frcYear": "2024",
"mavenUrls": [
Expand All @@ -14,7 +14,7 @@
{
"groupId": "org.photonvision",
"artifactId": "photonlib-cpp",
"version": "v2024.2.4",
"version": "v2024.2.8",
"libName": "photonlib",
"headerClassifier": "headers",
"sharedLibrary": true,
Expand All @@ -29,7 +29,7 @@
{
"groupId": "org.photonvision",
"artifactId": "photontargeting-cpp",
"version": "v2024.2.4",
"version": "v2024.2.8",
"libName": "photontargeting",
"headerClassifier": "headers",
"sharedLibrary": true,
Expand All @@ -46,12 +46,12 @@
{
"groupId": "org.photonvision",
"artifactId": "photonlib-java",
"version": "v2024.2.4"
"version": "v2024.2.8"
},
{
"groupId": "org.photonvision",
"artifactId": "photontargeting-java",
"version": "v2024.2.4"
"version": "v2024.2.8"
}
]
}

0 comments on commit ad93c82

Please sign in to comment.