- Real-time image processing to apply a green mask and isolate the bottle.
- Calculation of the bottle's distance and angle based on the detected object size and camera field of view.
- Precise control of the robot's movements, including chassis rotation and linear motion, to navigate to the bottle's location.
- Coordination of the robotic arm and gripper to grasp and lift the bottle.
- Robomaster robot with necessary sensors and end-effectors (camera, chassis, gripper, robotic arm)
- OpenCV library for image processing
- Robomaster SDK for robot control
- The robot's camera captures a live video feed and processes each frame to detect the green bottle.
- A green color mask is applied to the image, isolating the bottle and turning everything else black.
- The size and position of the detected bottle are used to calculate its distance and angle relative to the robot.
- The robot's chassis is rotated to align with the bottle's angle, and the robot is then driven towards the bottle's location.
- The robotic arm extends to reach the bottle, and the gripper closes to grasp it.
- The robot then retracts the arm and drives back to the starting position, where the bottle is released.
- Connect the Robomaster robot and ensure all necessary components are properly configured.
- Run the Task2.py script, which will handle the object detection, distance/angle calculation, and robot control.
- The script will display the processed video feed, showing the green bottle isolated against a black background.
- The calculated distance and angle to the bottle will be printed in the console.
- The robot will then navigate to the bottle, pick it up, and return it to the starting position.