Skip to content

Commit

Permalink
updated note track
Browse files Browse the repository at this point in the history
  • Loading branch information
coder4003 committed May 21, 2024
1 parent a7f5a97 commit 978272c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions commands/note_lockon.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@
from wpimath.filter import SlewRateLimiter, LinearFilter

pn = SmartDashboard.putNumber
yaw_raw = None

class NoteLockOnCommand(Command):
def __init__(self, drivetrain, intake_note, photon: note_tracker.NoteTracker):
super().__init__()
self.drivetrain = drivetrain
self.intake_note = intake_note
self.photon = photon
self.note_yaw_filtered = LinearFilter.highPass(0.1, 0.02)



def periodic(self):
yaw_raw = self.photon.getYawOffset()
pn('drivetrain/note_tracker/yaw_raw', yaw_raw)

def execute(self):
if yaw_raw == None: return
self.note_visible = True
yaw_raw = self.photon.getYawOffset()
self.note_yaw_filtered = LinearFilter.highPass(0.1, 0.02)
self.current_yaw = self.note_yaw_filtered.calculate(yaw_raw)
pn('drivetrain/note_tracker/yaw', self.current_yaw)
pitch = self.photon.getPitchOffset()
# pitch = self.photon.getPitchOffset()

def end():
def end(self):
self.note_visible = False
pass

0 comments on commit 978272c

Please sign in to comment.