Driving toward the wall
Links and useful resources
Concept summary and lesson
- sensor-based control
Examples/demo
Just like our differential-steering-bot, our tanks need to start using their sensors to control their movement. In this case, we have the Radar, which can tell us the direction and distance to a target (so far, the only target is the wall). This assignment is about using that sensor data to drive toward the first spot on the wall that your radar detects. There are a few parts to this:
- Keeping track of which direction you need to be moving - you should be moving toward the actual spot on the wall that your radar detected, not just anywhere on the wall
- Keeping track of how far you need to go. The idea is to stop before you hit the wall, so that your distance is as close as possible to 30 (again, in the direction the radar specified).
You can either just take note of the direction and distance and move directly there, or you can keep the radar aimed at its spot and just drive until you're the right distance away. You can decide which way to do it, or you could try both.