In conclusion, it is possible to design, build, and program a robot to move objects out of an area without actually leaving the area. I tried to program Pusherbot to move around randomly. In order for that to be accomplished, I had to experiment by making it a function, then a task, and then I tried using a semaphore. In the end, I left it as a task. For future references, try tasks first because tasks can run at the same time unlike functions or subroutines. In addition, to keep the robot continuously checking for the black line, I put the sequence in every random case. So, when the robot was moving around, it would always back away when it sensed a black line.
Later, I added two more touch sensors. That way, Pusherbot could be more accurate in sensing the objects. Also, I programmed the robot to turn just a little to the right or left depending on which sensor on which side is touched.
As I was testing my robot, it kept going out of the black line. However, I fixed it by putting the instructions of not crossing the black line in all the cases. Also, I found out that if the robot is angled a certain way to the black line, it could go over when it turned and went straight trying to avoid the black line. In reality, it crossed the black line because it was instructed to keep going straight.
Some ideas that branch off from my project include making Pusherbot gather all the objects first, using a counter, and then hauling them all into one specific area. To do this, the robot would use another light sensor and a flashlight. The robot would scan to find the light then when it senses the light, it would go to the light, hit the black line, and deposit the objects there. Another idea is to make the robot scan the area first to sense where the objects are located. Then have Pusherbot pick them up and put the in a specified area.
|