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.
Merge pull request #16 from FRC-1721/feat/intakeTuning
Feat/intake tuning
- Loading branch information
Showing
20 changed files
with
333 additions
and
113 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
|
||
[dev-packages] | ||
|
||
[requires] | ||
python_version = "3.11" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -15,3 +15,6 @@ robotpy-commands-v2 = "2024.2.1" | |
|
||
[requires] | ||
python_version = "3.11" | ||
|
||
[pipenv] | ||
allow_prereleases = 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,19 @@ | ||
import commands2 | ||
|
||
|
||
class FlyWheelSpeed(commands2.Command): | ||
def __init__(self, speed, subsystem): | ||
super().__init__() | ||
|
||
# local subsystem instance | ||
self.subsystem = subsystem | ||
|
||
# requested speed | ||
self.speed = speed | ||
|
||
def initialize(self): | ||
self.subsystem.setFlyWheelSpeed(self.speed) | ||
|
||
def end(self, interrupted: bool): | ||
self.subsystem.setFlyWheelSpeed(0) | ||
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 was deleted.
Oops, something went wrong.
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,38 @@ | ||
import commands2 | ||
import logging | ||
|
||
from subsystems.intake import IntakeSubsystem | ||
|
||
|
||
class RotateIntake(commands2.Command): | ||
def __init__(self, angle: float, subsystem: IntakeSubsystem): | ||
""" | ||
rotates the intake | ||
supposed to be used with | ||
presets | ||
""" | ||
super().__init__() | ||
|
||
# local subsystem instance | ||
self.intakeSubsystem = subsystem | ||
|
||
# requested speed | ||
self.angle = angle | ||
|
||
def initialize(self): | ||
logging.info(f"Moving intake to {self.angle}") | ||
|
||
def execute(self): | ||
self.intakeSubsystem.lift(self.angle) | ||
logging.info( | ||
f"Still moving... {self.intakeSubsystem.getAngle()} to {self.angle}" | ||
) | ||
|
||
def isFinished(self): | ||
e = 1 # How close before we're done | ||
|
||
return abs(self.intakeSubsystem.getAngle() - self.angle) < e | ||
|
||
def end(self, interrupted: bool): | ||
logging.info(f"Done moving! Finished normally: {interrupted}") | ||
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,33 @@ | ||
import logging | ||
import commands2 | ||
|
||
from subsystems.intake import IntakeSubsystem | ||
|
||
|
||
class SetIntakeSpeed(commands2.Command): | ||
def __init__(self, speed: float, subsystem: IntakeSubsystem): | ||
""" | ||
takes in the rings | ||
""" | ||
super().__init__() | ||
|
||
# local subsystem instance | ||
self.intakeSubsystem = subsystem | ||
|
||
# requested speed | ||
self.speed = speed | ||
|
||
def initialize(self): | ||
logging.debug(f"Running command Intake Suck (manual) with speed {self.speed}") | ||
|
||
def execute(self): | ||
if self.speed > 0: | ||
if not self.intakeSubsystem.switchPress(): | ||
self.intakeSubsystem.intake(self.speed) | ||
else: | ||
self.intakeSubsystem.intake(self.speed) | ||
|
||
def end(self, interrupted: bool): | ||
self.intakeSubsystem.intake(0) | ||
logging.debug(f"Intake suck done") | ||
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,18 @@ | ||
import commands2 | ||
|
||
|
||
class ShooterROT(commands2.Command): | ||
def __init__(self, angle, subsystem): | ||
super().__init__() | ||
|
||
# local subsystem instance | ||
self.subsystem = subsystem | ||
|
||
# requested speed | ||
self.angle = angle | ||
|
||
def initialize(self): | ||
self.subsystem.setRotateAngle(self.angle) | ||
|
||
def end(self, interrupted: bool): | ||
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.