★ Blink LED
- LED has 2 states, ON & OFF
- Transition Condition: has 400 ms passed?
- Use previous_time and current_time method NOT sleep_ms()
★★ Follow at a Distance
int goal_dist = 200; //mm
int tolerance = 50; //mm
Goal: Stay 20 ± 5 cm from object
Use the variables above^^
3 states: WAIT, FORWARD, BACKWARD
Transition Conditions are based on distance reading from lidar and allowable tolerance
★★ Write a function to print the state
- hint~ what type is our state?
★★★ Travel thru a Tunnel
- Find both sides of tunnel with lidar
- Rotate robot until facing the opening
- Go top speed thru, should be straight enough
★★★ Detecting Slip
- Keep one wheel still
- Find an area of the floor that's clean
- Spin one wheel to rotate the robot
- Compare counts of encoder wheel to integrating imu for angle
- Is the counts as expected?
- Find an area of the floor that is chalky (extra slippery)
- How do the counts compare now?
- Hint:
- Use button to start and stop motor,
then print values constantly so you can plug pico in to see them