This repository has been archived by the owner on Jan 10, 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.
* blah blah blah * Intake work * the fog is coming the fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is comingthe fog is coming --------- Co-authored-by: NotSimon5673 <[email protected]>
- Loading branch information
1 parent
1e6d8c3
commit 0dd7ea6
Showing
7 changed files
with
140 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import commands2 | ||
import logging | ||
|
||
from subsystems.drivesubsystem import DriveSubsystem | ||
from wpimath.geometry import Rotation2d | ||
|
||
|
||
class PoseReset(commands2.Command): | ||
def __init__( | ||
self, | ||
_drivetrain=DriveSubsystem, | ||
): | ||
super().__init__() | ||
|
||
# local subsystem instance | ||
self.drivetrain = _drivetrain | ||
|
||
def initialize(self): | ||
# what do I put here? :3 | ||
pass | ||
|
||
def execute(self): | ||
driveX = 0 | ||
driveY = 0 | ||
rotZ = 0 | ||
Pose = self.drivetrain.getPose() | ||
|
||
if Pose.X() > 0: | ||
driveX = 0.1 | ||
elif Pose.X() < 0: | ||
driveX = -0.1 | ||
|
||
if Pose.Y() > 0: | ||
driveY = 0.1 | ||
elif Pose.Y() < 0: | ||
driveY = -0.1 | ||
|
||
if Pose.rotation().degrees() > 0: | ||
rotZ = 0.1 | ||
elif Pose.rotation().degrees() < 0: | ||
rotZ = -0.1 | ||
|
||
self.drivetrain.drive(driveX, driveY, rotZ) | ||
|
||
def isFinished(self): | ||
return self.drivetrain.isPoseZero() | ||
|
||
def end(self, interrupted: bool): | ||
logging.info("Yaw iz zero mah boi") | ||
return True |
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,29 @@ | ||
import commands2 | ||
import logging | ||
|
||
from subsystems.drivesubsystem import DriveSubsystem | ||
from wpimath.geometry import Pose2d, Rotation2d | ||
|
||
|
||
class zeroPose(commands2.Command): | ||
def __init__( | ||
self, | ||
_drivetrain=DriveSubsystem, | ||
): | ||
super().__init__() | ||
|
||
# local subsystem instance | ||
self.subsystem = _drivetrain | ||
|
||
def initialize(self): | ||
self.subsystem.resetOdometry(Pose2d.fromFeet(0, 0, Rotation2d.fromDegrees(0))) | ||
|
||
def execute(self): | ||
pass | ||
|
||
def isFinished(self): | ||
return True | ||
|
||
def end(self, interrupted: bool): | ||
logging.info("Pose iz zero mah boi") | ||
return True |
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