|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#15
|
||||
|
||||
|
Re: Last minute autonomous help
Quote:
We're using C++. Our autonomous program manages a state machine that gets input from the light sensors and decides what to do based on them. Our algorithm is as follows: Light sensor values (L/C/R)-----------------------State to execute 000--------------------------------------------------move() - go forward until you see the line 010--------------------------------------------------move() - this is ideal, we're on the line 100--------------------------------------------------correctLeft() - move left to see the line 110--------------------------------------------------also correctLeft() 001 and 011----------------------------------------correctRight() 101--------------------------------------------------at the fork; correctLeft() or correctRight() based on a switch on the robot 111-------------------------------------------------placeTube() After executing placeTube(), the program quits the state machine and retreats back several feet, then turns on the spot (~180 degrees, but it's not perfect since we don't have encoders or a gyro). Generally, getting the tube on the rack takes about ten seconds, and we're only driving the motors at 40% for drive and 60% for turn. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|