Skip to content

Commit

Permalink
refactored toolkit
Browse files Browse the repository at this point in the history
  • Loading branch information
alexl1239 committed Dec 12, 2024
1 parent b64b27b commit 6bac7e6
Show file tree
Hide file tree
Showing 25 changed files with 1,464 additions and 282 deletions.
Empty file added command/intake.py
Empty file.
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


intake_id= 1 #PLACEHOLDER
intake_id= 9
INTAKE_CONFIG= TalonConfig(
0.315, 0, 0.0, 0, 0, brake_mode=False, current_limit=60, kV=0.12 #PLACEHOLDERS
)
10 changes: 6 additions & 4 deletions subsystem/intake.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import config
import constants
from toolkit.subsystem import Subsystem
from toolkit.motors.rev_motors import TalonFX
from toolkit.motors.ctre_motors import TalonFX

class Intake(Subsystem):

Expand All @@ -14,9 +14,11 @@ def __init__(self):
inverted=False
)

def start_intake(self):
self.motor.set_raw_output(10) #placeholder
self.note_exists_within: bool = False

def start_motor(self):
self.motor.set_raw_output(1) #placeholder

def stop_intake(self):
def stop_motor(self):
self.motor.set_raw_output(0)

24 changes: 24 additions & 0 deletions toolkit/command.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from typing import Generic, TypeVar
import commands2

from toolkit.subsystem import Subsystem

T = TypeVar("T", bound=Subsystem)


class BasicCommand(commands2.Command):
"""
Extendable basic command
"""
...


class SubsystemCommand(BasicCommand, Generic[T]):
"""
Extendable subsystem command
"""

def __init__(self, subsystem: T):
super().__init__()
self.subsystem = subsystem
self.addRequirements(subsystem)
2 changes: 0 additions & 2 deletions toolkit/motor.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

from units.SI import radians_per_second, radians



class Motor:
def init(self): ...

Expand Down
2 changes: 1 addition & 1 deletion toolkit/motors/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from toolkit.motors.ctre_motors import TalonSRX, TalonFX, TalonGroup, TalonConfig
from toolkit.motors.ctre_motors import TalonFX, TalonConfig
from toolkit.motors.rev_motors import SparkMax, SparkMaxConfig
Loading

0 comments on commit 6bac7e6

Please sign in to comment.