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.
add a simple checkDevices() method to each mechanism for RevA. add a …
…CheckDevices procedure that checks each mechanism and signals whether or not the checks passed.
- Loading branch information
Showing
11 changed files
with
127 additions
and
0 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
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
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
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
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
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
45 changes: 45 additions & 0 deletions
45
src/main/java/com/team766/robot/reva/procedures/CheckDevices.java
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.team766.robot.reva.procedures; | ||
|
||
import com.team766.framework.Context; | ||
import com.team766.framework.Procedure; | ||
import com.team766.robot.reva.Robot; | ||
|
||
public class CheckDevices extends Procedure { | ||
@Override | ||
public void run(Context context) { | ||
boolean check = true; | ||
context.takeOwnership(Robot.drive); | ||
check &= Robot.drive.checkDevices(); | ||
context.releaseOwnership(Robot.drive); | ||
|
||
context.takeOwnership(Robot.climber); | ||
check &= Robot.climber.checkDevices(); | ||
context.releaseOwnership(Robot.climber); | ||
|
||
context.takeOwnership(Robot.forwardApriltagCamera); | ||
check &= Robot.forwardApriltagCamera.checkDevices(); | ||
context.releaseOwnership(Robot.forwardApriltagCamera); | ||
|
||
context.takeOwnership(Robot.intake); | ||
check &= Robot.intake.checkDevices(); | ||
context.releaseOwnership(Robot.intake); | ||
|
||
context.takeOwnership(Robot.noteCamera); | ||
check &= Robot.noteCamera.checkDevices(); | ||
context.releaseOwnership(Robot.noteCamera); | ||
|
||
context.takeOwnership(Robot.shooter); | ||
check &= Robot.shooter.checkDevices(); | ||
context.releaseOwnership(Robot.shooter); | ||
|
||
context.takeOwnership(Robot.shoulder); | ||
check &= Robot.shoulder.checkDevices(); | ||
context.releaseOwnership(Robot.shoulder); | ||
|
||
if (check) { | ||
Robot.lights.signalDeviceCheckHealthy(); | ||
} else { | ||
Robot.lights.signalDeviceCheckUnhealthy(); | ||
} | ||
} | ||
} |