|
Search & Capture
- The code I wrote is intended to search for a ball using a rotational distance sensor, and, once found, capture it using a mechanical arm, with a servo.
- Searching:
- The robot searches, using an IR sensor attached to a servo in the front of the robot.
- The servo rotates left and right, allowing the IR sensor to scan a range of about 120 degrees.
- The servo stops at three intervals, left, front, and right. At each interval, the IR sensor is checked. The robot turns in the direction of the interval that had the highest IR sensor reading.
- Once an object is found and close enough to be captured, the robot beeps three times to indicate success.
- Capture:
- A mechanical arm, consisting of legos and popsicles sticks was made for the robot. It is attached to the back of the robot.
- Upon finding an object that is in range to be captures, the robot rotates. This is because the search sensor is in the front, while the claw is in the back.
- The robot rotates until the object is found is detected (using the rear distance sensor), or until it has spun 270 degrees.
- Once it detects the object, it closes in on it by moving backwards, until it is close enough, at which point the arm drops down and holds it in place.
- Check Ball:
- After capturing the ball, the robot must make sure that it actually did capture a ball, and did not attempt to capture the wall.
- To do this, the robot first drives forward a slight amount. It does this so that, if it actually attempted to capture the wall, there would not have been enough room for the arm to drop down. Driving forward makes sure that the arm is fully down.
- Then, it checks to see if there is a ball in custody using the distance sensor located on the back.
- If there is a high value, about 430, then there is a ball in custody, and the robot beeps in order to indicate that it has actually caught a ball.
- If there is no ball in custody, the arm lifts up, and the robot loops back to the beginning of the search program.
|
Back to Mark & Manan Planning Page
|