Head Tracker - northern-bites/nbites GitHub Wiki

Head Tracker

The Head Tracker handles all head motion. It is a complete python FSA (although it should eventually be migrated to c++). The interface is entirely in HeadTracking.py, but many of its states are spread throughout the rest of /headTracking. HeadTrackingHelper.py provides most of the non-state methods.

HeadTracking.py

These are the primary interface methods in HeadTracking.py and what they do.

performHeadMove(headMove)

Executes the given headMove, then stops.

repeatHeadMove(headMove)

Executes the given headMove, then executes it again, forever. Note that this method is safe to call every frame; if the head move is already executing, it will not be interrupted.

trackBall()

Enters a state cycle: when ball is in view, uses vision information to stare at it. When ball is not in view, executes naive pans.

spinPan()

Stares straight ahead. This reduces motion blur while the robot spins, and given the slight lag in seeing the ball and stopping spinning (thresholds and finishing current steps) this tends to result in the robot actually facing the ball when it stops.

repeatBasicPan(), repeatWidePan(), repeatNarrowPan()

Repeats the named pan. Convenient to call from classes that don’t import headMoves.py

performKickPan()

Performs the standard pre-kick pan once.

startScan(newScan)

Repeatedly perform the given newScan. Note that this doesn’t preserve fixed pitch, so it should probably not be called anymore (summer 2012).

trackTarget(target)

Tracks given target using vision information when possible, otherwise uses naive scans.

lookStraightThenTrack()

Re-centers the head, then begins tracking the ball via trackBall().

lookToAngle(yaw)

Looks in the direction of the “yaw” parameter. Sets pitch to avoid shoulder collisions as per fixed pitch guidelines.

⚠️ **GitHub.com Fallback** ⚠️