|
Explore TEAMS!
|
Student /
SeamusWimpModeDiscussionIn this lab, the assignment was to write a program so the create would mimic a demo that the robot does. Otherwise, this demo is known as wimp mode. In wimp mode the robot waits until it feels a push or pull from behind, it then drives 60 cm and stops. If the bumper sensors are initiated then the robot is to turn away from the ‘danger’ and drive 60 cm and stop. A major part of this program is that it has to be in safe mode at all times. This is to avoid drop offs and such, and so the robot is not damaged. My approach to writing this program was to use a while loop for safe mode and within use a bunch of if conditions. The easier ones were if the right bumper sensor was pushed to turn left and drive 60 cm, and if the left turn the opposite way and drive. Then the trickiest part for me was to get the robot to realize it is being pushed or pulled from behind while just sitting there. To do this I set it up so the robot checks for movement in the wheels without the robot moving itself. Other than line following this was one of my only pieces of coding. Mainly I learned how to use the if and while loops better and just become more familiar with how everything looks/works. I did not incorporate LEDS even though I should but that will be done in the future because I see how they can help you figure out what the robot is sensing and it can help you understand what is going wrong while debugging your program. |