- Enable the webcam access in the Raspberry Pi configuration setting and run the main program, once the main program is started to execute all servos will be in its initial position.
- Real time object detection is performed on the tomatoes, to find its colour and shape.
- Once the object is read from the webcam, then it is compared with pre-defined mask values of red, green and yellow colour.
- If detected tomato is red then, robot locomotion is stopped, webcam is disabled, gripper servo will pluck the tomato and base servo will rotate its base to 0 to 90 degree and drop it in basket 1 and again all servos will reach to its initial position and again camera is enabled to detect the tomato.
- If detected tomato is yellow then, robot locomotion is stopped, webcam is disabled, gripper servo will pluck the tomato and base servo will rotate its base to 0 to 180 degree and drop it in basket 2 and again all servos will reach to its initial position and again camera is enabled to detect the tomato.
- If tomato is in green colour, then the robot locomotion will not be stopped, it is continued till it detects either red or yellow colour tomato.
fig: Interfacing servos with PCA9685

.png)
.png)
.png)