Skip to content

Vision Target Alignment

extremetom90 edited this page Mar 24, 2017 · 17 revisions

Most of our alignment algorithm was based off of team 254's presentation from 2016.

State Machine Diagram for 2017:

State Machine

States

Not Controlling

Initial state. Robot is not aligning or attempting to. PID integrators always stopped.

Aligning

PIDs are running. Robot is aligning.

Delay

Wait 300 ms so that the vision system can catch up with the robot. Eliminates lag.

Confirm Target

Checks with vision system. Makes sure that it is aligned. When confirmed, tells outside world it is on target as it goes to On Target state.

On Target

Robot is on target. Stays here until is becomes unaligned (e.g. robots gets bumped) or vision alignment is no longer desired.

Events

Aligned

The delta angle and delta range are within tolerances.

Des & Pos

The driver has pressed the button to signal that alignment is desired (Desired). Vision is online and gyro is working (Possible)

TMO

The amount of time we needed to wait has expired.