Today we tackled the mission of determining the can color and what to do when the wrong color is detected. In the video, the robot is looking for a red can. It finds a green can and attempts to remove the can from its path. After watching the robot in action, we see that the robot is not turning around enough when dropping the can. This will need to be changed in the code. Also the robot is continuing to drop the can so we need to get out of that loop to proceed with the search of the correct can.
For additional accuracy, we will have the color sensor read the can at least two times to confirm the correct color. Once both readings are the same then the robot will be able to continue its mission.
In this test you will see the robot find a green can a reject it. As you can see if the can is not directly in the center of the arms, the sonar value will never read the limit for the arms to close. We will add a function that will close the arms a little each time to force the can into the sonars range. We also added the black line detection in the trial. At the end of the video you can see the robot get stuck once the line sensor is over the black tape line. We will have to write some code to tell what the robot to do when the black line is reached.
No comments:
Post a Comment