Skip to content
This repository has been archived by the owner on Jan 15, 2018. It is now read-only.

Commit

Permalink
Added changes for Dustin. Includes tunables and won't stop if the goal
Browse files Browse the repository at this point in the history
isn't seen
  • Loading branch information
ArchdukeTim committed Apr 27, 2016
1 parent 0e28bd7 commit 52d1c28
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions robot/automations/targetGoal.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@ class TargetGoal(StateMachine):
present = ntproperty('/components/autoaim/present', False)
targetHeight = ntproperty('/components/autoaim/target_height', 0)


idealHeight = tunable(-11)
heightThreshold = tunable(10)

def on_enable(self):
self.atGoal = False

def target(self):
if not self.drive.enable_camera:
self.drive.enable_camera_tracking()
self.engage()
if self.present or self.atGoal:
self.engage()


@state(first = True)
Expand All @@ -35,10 +41,11 @@ def align(self):

@state
def camera_assisted_drive(self):
if self.targetHeight < 10:#> -12:
if self.targetHeight < self.heightThreshold:#> -12:
self.drive.move(max(abs(self.idealHeight-self.targetHeight)/55, .5), 0)
#self.drive.align_to_tower()
else:
self.atGoal = True
self.next_state('shoot')

@state
Expand Down

0 comments on commit 52d1c28

Please sign in to comment.