10. Visual 3D Grasping#
A step-by-step method for picking and placing objects on a table with an AIRBOT arm and vision system.
Note
Contact the technical-support team to obtain the required source file Stacking_Bricks.zip.
Prerequisites:
-
Click here to learn how to install the AIRBOT Play driver and Python SDK
-
Click here to learn how to perform automated camera-intrinsic and -extrinsic calibration.
Note
MUST perform camera intrinsic and extrinsic calibration before any visual grasping task!!!
10.1 Environment Setup#
10.1.1 Python Environment#
The vision hardware used in this article is the Intel RealSense camera family.
| Dependency | Version |
|---|---|
| pyrealsense2 | 2.55.1.6486 |
10.1.2 RealSense Camera Driver#
| Dependency | Version |
|---|---|
| Intel RealSense SDK 2.0 | 2.0 |
10.1.3 Physical Setup#
Choose a desktop with a white background whenever possible. This demo uses color-space segmentation to detect small wooden blocks; blue, green, or red backgrounds may cause recognition to fail.
10.1.4 Environment Installation Steps#
Install RealSense camera driver. On Ubuntu you can skip manually downloading the SDK—just run:
Activate the conda virtual environment
Install pyrealsense2:
10.2 Launch the Robot Arm Control Service#
Open a terminal and start the arm control service:
or<INTERFACE>interface name shown byip link; default device names arecanX(X starts at 0), e.g. can0, can1.<PORT>– gRPC server listen port. Use a unique port for each device, e.g. 50000, 50001, 50010. Key points: Example:
10.3 Run stacking_bricks.py – the arm-vision vertical-grasp demo.#
10.3.1 Download and extract Stacking_Bricks.zip:#
#Must match the `<PORT>` used in the previous step (`airbot_fsm -i can0 -p 50051`).
python3 -m stacking_bricks -p 50051
Package contents explained
-
brick_detect_realsense.py – Performs brick detection with the RealSense camera.
-
arm_kdl.py – AIRBOT_Play kinematics
-
airbot_realsense.py – RealSense configuration
-
configs – camera parameters & calibration data
10.3.2 Intrinsic & extrinsic parameter configuration#
For details on obtaining the intrinsic and extrinsic parameters, please refer to Automated Camera Intrinsic & Extrinsic Calibration
Save the .txt file obtained from Automated Camera Intrinsic & Extrinsic Calibration in this directory; the program will automatically read the camera's intrinsic and extrinsic parameters from it.
10.3.3 Program Execution & Demonstration#
Open a terminal in the package directory.
Once the program is running, the screen will show:
- Green rectangles mark the detected small bricks, with parameters for brick color and its coordinates in the camera frame
- This demo can detect blue, green, and red bricks
Press q to close the window and start stacking; a darker background is recommended for higher recognition accuracy.