This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
13 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
package com.team766.orin; | ||
|
||
public class NoTagFoundError extends Exception{ | ||
public NoTagFoundError(int id){ | ||
public class NoTagFoundError extends Exception { | ||
public NoTagFoundError(int id) { | ||
super("No tag found on table with given id of: " + id); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,30 @@ | ||
package com.team766.robot.reva.mechanisms; | ||
|
||
import java.util.ArrayList; | ||
import com.team766.framework.Mechanism; | ||
import com.team766.orin.GetApriltagPoseData; | ||
import com.team766.orin.NoTagFoundError; | ||
import com.team766.robot.reva.Robot; | ||
import edu.wpi.first.apriltag.AprilTag; | ||
import java.util.ArrayList; | ||
|
||
public class Orin extends Mechanism { | ||
public Orin(){ | ||
|
||
} | ||
public Orin() {} | ||
|
||
public AprilTag getTagById (int id) throws NoTagFoundError{ | ||
public AprilTag getTagById(int id) throws NoTagFoundError { | ||
ArrayList<AprilTag> tags = GetApriltagPoseData.getAllTags(); | ||
|
||
for (AprilTag tag : tags){ | ||
for (AprilTag tag : tags) { | ||
if (tag.ID == id) return tag; | ||
} | ||
|
||
throw new NoTagFoundError(id); | ||
} | ||
|
||
public void run(){ | ||
public void run() { | ||
ArrayList<AprilTag> tags = GetApriltagPoseData.getAllTags(); | ||
|
||
if(tags.size() > 0){ | ||
if (tags.size() > 0) { | ||
Robot.lights.signalHasTag(); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters