gladiatorsprogramming1591/Thunderclap

Use ultrasonic sensor to choose autonomous path

dylantompkins opened this issue · 1 comments

Proposed Functionality

Attach an ultrasonic sensor on the side of the robot to detect how far it is from the sidewall of the field. Based on this distance (aka the position of the robot), the robot should know if it is lined up for the red or blue path for either the A or B path in the galactic search challenge. This is a total of 4 physical robot positions, to comply with GSC2-1 (see chart below).

~ Path A Path B
Red A-Red B-Red
Blue A-Blue B-Blue

Suggested Implementation

At the start of the autonomous routine, use a switch statement to determine which of the 4 distances the robot is located at (with some room for placement error). Then call the associated autonomous command for that path.

Resources

Page 22 of At Home Challenges Manual

Working on ultrasonic-choosing. Won't close until PR.