-
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
Driver Station Computer
committed
Oct 5, 2024
1 parent
fa5d9bb
commit 6d7898e
Showing
4 changed files
with
42 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
24 changes: 24 additions & 0 deletions
24
src/main/java/com/team766/robot/rookie_bot/mechanisms/Drive.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,24 @@ | ||
package com.team766.robot.rookie_bot.mechanisms; | ||
|
||
import com.team766.hal.RobotProvider; | ||
|
||
import com.team766.hal.MotorController; | ||
|
||
import com.team766.framework.Mechanism; | ||
|
||
import com.team766.framework.Mechanism; | ||
|
||
public class Drive extends Mechanism{ | ||
private MotorController leftMotor; | ||
private MotorController rightMotor; | ||
|
||
public Drive() { | ||
leftMotor = RobotProvider.instance.getMotor("drive.Left"); | ||
rightMotor = RobotProvider.instance.getMotor("drive.Right"); | ||
} | ||
|
||
public void setMotorSpeed(double leftPower, double rightPower) { | ||
leftMotor.set(leftPower); | ||
rightMotor.set(rightPower); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/team766/robot/rookie_bot/procedures/DriveStraight.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,14 @@ | ||
package com.team766.robot.rookie_bot.procedures; | ||
|
||
import com.team766.framework.Context; | ||
import com.team766.framework.Procedure; | ||
import com.team766.robot.rookie_bot.Robot; | ||
|
||
public class DriveStraight extends Procedure{ | ||
public void run(Context context) { | ||
Robot.drive.setMotorSpeed(0.1, 0.1); | ||
context.waitForSeconds(7.5); | ||
Robot.drive.setMotorSpeed(0, 0); | ||
} | ||
|
||
} |