Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Apply linter :(
Browse files Browse the repository at this point in the history
  • Loading branch information
maxspier committed Oct 24, 2024
1 parent 4899d3c commit 0abd381
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
5 changes: 2 additions & 3 deletions src/main/java/com/team766/orin/NoTagFoundError.java
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);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public boolean signalStartingShootingProcedure() {
return handleErrorCode(e);
}

public boolean signalHasTag(){
public boolean signalHasTag() {
ErrorCode e = m_candle.setLEDs(255, 215, 0);
return handleErrorCode(e);
}
Expand Down
15 changes: 6 additions & 9 deletions src/main/java/com/team766/robot/reva/mechanisms/Orin.java
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();
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void run(Context context) {
Transform3d toUse;
try {
/* Interchange the following two lines for Orin vs. Orange Pi! */
//toUse = getTransform3dOfRobotToTag();
// toUse = getTransform3dOfRobotToTag();
toUse = getTransform3dOfRobotToTagOrin();
} catch (NoTagFoundError e) {
LoggerExceptionUtils.logException(e);
Expand Down Expand Up @@ -127,8 +127,9 @@ private Transform3d getTransform3dOfRobotToTagOrin() throws NoTagFoundError {
AprilTag tag = Robot.orin.getTagById(tagId);

Pose3d pose = tag.pose;

Transform3d poseNew = new Transform3d(pose.getX(),pose.getY(), pose.getZ(), new Rotation3d());

Transform3d poseNew =
new Transform3d(pose.getX(), pose.getY(), pose.getZ(), new Rotation3d());
return poseNew;
}
}

0 comments on commit 0abd381

Please sign in to comment.