Robot with infrared sensors #1

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
3,295
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Dec 31, 2006

Joe Khodari, Miles Hogan, and Shahrad Shahrooz
Real World Interfacing
Programming Challenge 5

UCLA Honors 69: ALiCE
Professor Gessler

All thanks to Prof. Gessler's help, we were able to make a robot that responded it its' environment. While Prof. Gessler built the robot, we added on the infrared sensors and did much of the coding for the robot's functionality.

We resolved to add buttons to the form allowing the user to make the robot move forward, back, right, and left. This was a simple task since we already had the code for "Opposite" and "Together," which coded for forward and reverse. Creating a right and left function were straightforward, no pun intended. However, when finished with this we still weren't satisfied. We decided we wanted the user to be able to control the robot using the arrow keys.

The user was now able to either control the robot using the buttons on the form or the arrow keys on the keyboard. We now had a fully operating and controllable robot.

We also added sound clips that correspond to the movements of the robot. When the user presses the forward button or up key, a clip of an engine revving plays. When the reverse button or down key is pressed, a clip of a truck reversing plays. When the pivot button is clicked, a funny clip sounding like cartoon character running/slipping plays.

After having success with getting the robot to respond well to computer input we decided to allow the robot to respond to its environment. Using infrared sensors, we enabled the robot to take in data from its surroundings and act upon it. Our ultimate goal was to allow the robot to rove around the classroom and respond to objects it approached.

First, we attached one infrared sensor to the robot. By adding some code from another program we were able to get a reading for the sensor.
Next, we added a function that allowed the robot to stop once it got too close to an object, preventing a collision. Whenever the reading was over a certain number (voltage), the program would "break" and the rover would stop. We had successfully enabled the robot to respond to its surroundings!

However, we didn't stop there. We decided that adding a second sensor would be useful if we wanted the robot to be able to turn and continue roving if it approached a wall. We tried this but had some trouble getting the robot to make a sharp enough turn to avoid hitting the wall and get jammed. To ameliorate our problem, we angled our sensors outward. This worked beautifully and our robot was able to approach a wall and make a turn. It could still rove even after approaching objects!

Once this was all complete, we played around with the roving function and found some interesting results.

After pointing the sensors slightly outwards, we tested the robot to see how it would react to obstacles. With this minor alteration, the robot worked very well. We previously thought that with this setup, if the robot ended up in a corner, it would not know be able to get out of the corner, and instead would keep turning while still turning side to side since the readings would be too high causing the robot to turn back the other way. The robot though was able to figure out on its own how to deal with this problem. The robot bounced from side to side, never hitting the wall, and eventually managed to make a complete turn out of the corner. One possible explanation for this is that since the IR sensors only take readings every half second, one IR sensor might be at the perfect distance from the wall between readings allowing it to turn out of the corner. Or maybe the loop that codes for the IR movement might have finished, thus allowing the robot to completely turn and continue in a different direction.

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 2 dislikes

Link to this comment:

Share to:
see all

All Comments (3)

Sign In or Sign Up now to post a comment!
  • Come on you cat do better then that!!

  • Come you c

  • hey, khod....  peopl....¡¡¡

    jk.. nice job

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more