Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge in photon camera stream branch #2

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions example/5516-2024-OffSeason/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "aaaaaaaaa",
"request": "launch",
"mainClass": "frc.robot.subsystems.objectdetection.aaaaaaaaa",
"projectName": "5516-2024-OffSeason"
},
{
"type": "wpilib",
"name": "WPILib Desktop Debug",
Expand Down
1 change: 1 addition & 0 deletions example/5516-2024-OffSeason/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ compileJava.finalizedBy checkAkitInstall
// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries.
// Also defines JUnit 4.
dependencies {

implementation wpi.java.deps.wpilib()
implementation wpi.java.vendor.java()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ public void configureButtonBindings() {
intake.runInvertVoltage();
flyWheels.forceMaxRevert();
}));

/* amp command */
driverXBox
.y()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

public class ApriltagVisionIOSim extends AprilTagVisionIOReal {
private final VisionSystemSim visionSystemSim;
// private final LocalhostCommunicator localhostCommunicator;
private final PhotonCameraSim[] camerasSim;
private final Supplier<Pose2d> robotActualPoseInSimulationSupplier;

Expand All @@ -27,7 +28,6 @@ public ApriltagVisionIOSim(
AprilTagFieldLayout aprilTagFieldLayout,
Supplier<Pose2d> robotActualPoseInSimulationSupplier) {
super(cameraProperties);

this.robotActualPoseInSimulationSupplier = robotActualPoseInSimulationSupplier;
this.visionSystemSim = new VisionSystemSim("main");
visionSystemSim.addAprilTags(aprilTagFieldLayout);
Expand All @@ -43,6 +43,8 @@ public ApriltagVisionIOSim(
cameraSim.enableDrawWireframe(true);
visionSystemSim.addCamera(camerasSim[i] = cameraSim, cameraProperties.get(i).robotToCamera);
}
// this.localhostCommunicator = new LocalhostCommunicator(camerasSim);

}

private static final Translation2d[] NOTE_INITIAL_POSITIONS = new Translation2d[] {
Expand Down Expand Up @@ -72,5 +74,11 @@ private void addNotesVisionTargets() {
public void updateInputs(VisionInputs inputs) {
visionSystemSim.update(robotActualPoseInSimulationSupplier.get());
super.updateInputs(inputs);
// localhostCommunicator.updateAllCameraFrames();
}

@Override
public void close(){
// localhostCommunicator.close();
}
}
2 changes: 1 addition & 1 deletion example/5516-2024-OffSeason/vendordeps/maple-sim.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{
"groupId": "org.ironmaple",
"artifactId": "maplesim-java",
"version": "0.1.5"
"version": "0.1.6"
},
{
"groupId": "org.dyn4j",
Expand Down