Skip to content

Commit

Permalink
Added a singer constants class for the singer constants. Started work…
Browse files Browse the repository at this point in the history
…ing on changing the singer joystick command to actual linear velocity
  • Loading branch information
1736student committed Jan 24, 2024
1 parent 981cdf0 commit 6f8c06b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
14 changes: 11 additions & 3 deletions humanInterface/operatorInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from wpilib import XboxController
from wpimath import applyDeadband
from wpimath.filter import SlewRateLimiter
from singerMovement.singerConstants import MAX_MAN_VEL_MPS, MAX_MANUAL_DEG_PER_SEC
from utils.faults import Fault
from utils.signalLogging import log
from utils.units import in2m
Expand Down Expand Up @@ -41,8 +42,6 @@ def __init__(self):
self.manualSingerRot = False

#I don't know what the max on the slew rate limiter should be. It should be a constant
MAX_MAN_VEL_MPS = in2m(12.0)
MAX_MANUAL_DEG_PER_SEC = 30
self.manualSingerUpDownSlewRateLimiter = SlewRateLimiter(MAX_MAN_VEL_MPS)
self.manualSingerRotSlewRateLimiter = SlewRateLimiter(MAX_MANUAL_DEG_PER_SEC)

Expand Down Expand Up @@ -178,4 +177,13 @@ def getCarriagePodiumPosCmd(self):
#if the manual commands to control the singer are active, we will have to know that and get them later
def manCmdActive(self):
return self.manualSingerUpDown != 0 or self.manualSingerRot != 0


#this will be in distance along the elevator, with 0 being at bottom and the top being whatever it is
def manUpDownCmd_M(self):
pass
#32 to 1 gear ratio
#1.5 inch sprocket

#this will be degrees that the singer is rotated, with 0 being parallel to base of robot
def manRotCmd_Deg(self):
pass
12 changes: 12 additions & 0 deletions singerMovement/singerConstants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from utils.units import in2m

"""Defines constants that the singer uses"""

#movement that the singer can have if it's being manually controlled by operator
#used in slew rate limiter. All arbitrary numbers
MAX_MAN_VEL_MPS = in2m(12.0)
MAX_MANUAL_DEG_PER_SEC = 30

#for operator input to elevator control function in operator interface
GEARBOX_GEAR_RATIO = 32
SPROCKET_RADIUS_IN = 1.5

0 comments on commit 6f8c06b

Please sign in to comment.