Garbage sorting

1. Garbage sorting instructions

The file path for robot arm position calibration is ~/jetcobot_ws/src/jetcobot_color_identify/scripts/XYT_config.txt.

After calibration, re-start the program and click the calibration mode to automatically read the file information, reducing repeated calibration actions.

2. About code

Code path:~/jetcobot_ws/src/jetcobot_garbage_yolov5/Garbage_sorting.ipynb

~/jetcobot_ws/src/jetcobot_utils/src/jetcobot_utils/grasp_controller.py

Since the camera may have deviations in the position of the building block, it is necessary to add deviation parameters to adjust the deviation value of the robotic arm to the recognition area.

The type corresponding to garbage sorting and garbage stacking is "garbage", so it is necessary to change the offset parameter under type == "garbage". The X offset controls the front and back offset, and the Y offset controls the left and right offset.

The coordinates of the garbage area.

If the coordinates of the garbage area are inaccurate, you can modify them appropriately.

 

3. About code

Start roscore

Start the program

Open the jupyterlab webpage and find the corresponding .ipynb program file.

Click the Run button to run the entire code.

202309010001

 

4. Experimental operation and results

After the program runs, the Jupyterlab webpage will display the control button.

Camera image on the left side, related buttons on the right side.

image-20240704194150915

Click the 【position_model】button, drag the joint angle above, update the position of the robot arm, and make the recognition area in the middle of the entire image.

Then, click 【calibration_model】 to enter the calibration mode, and adjust the robot arm joint slider and threshold slider above to make the displayed blue line overlap with the black line of the recognition area.

image-20240704194422514

Click 【calibration_ok】 to calibrate OK.

The camera screen will switch to the recognition area perspective.

image-20240704194548819

Place the block with the garbage category facing up into the recognition area.

Note: The view of the garbage image from the camera screen must be positive direction, not reversed.

image-20240704194740812

Click [target_detection] and wait for the model file to be loaded. After the model file is loaded, start identifying garbage names.

image-20240704195021279

Then click the [grap] button to start sorting.

The system will identify the garbage name and grab the building blocks into the corresponding garbage area according to the category.

image-20240704195845802

If you need to exit the program, please click the 【Exit】 button.