Manual

Table Of Contents
Arduino Kit Demo Description 10 DobotPixy Demo
Issue V2.1 (2019-12-05) Demo Description Copyright © Yuejiang Technology Co., Ltd
35
Critical Code Description
This demo uses Pixy vision sensor and Dobot Magician to pick and place cubes. The Dobot
library, SmartKit library, and Pixy library need to be called. Before debugging this Demo, please
select Dobot, SmartKit, and Pixy on the Sketch > Include Library menu.
NOTICE
Please long press the Key button on the back of base of Dobot Magician to operate the
homing procedure before debugging this Demo.
Initialization.
When setting the cube position, please connect Dobot Magician and DobotStudio.
And press the Unlock key on the Forearm and drag Dobot Magician to move to the
cube positions, then record their Cartesian coordinates from the operation panel
pane of DobotStudio page to write in this demo for picking and placing cube.
For details about the vision recognition initialization process, please see Appendix
D Vision Recognition Initialization Process.
Program 10.2 Initialization
SmartKit_VISSetAT(197.2155, 0.0679, 61.0561, 25.5385); //Set the Pixy position (Camera position)
SmartKit_VISSetPixyMatrix(11, 153, 44, 45, 135, 91, 45, 46, 260, 11, 47, 43); // Set the image coordinates
of the cubes
SmartKit_VISSetColorSignature(RED, 1); // Set the color signature of the cube
SmartKit_VISSetColorSignature(GREEN, 2);
SmartKit_VISSetColorSignature(BLUE, 3);
SmartKit_VISSetColorSignature(YELLOW, 4);
SmartKit_VISSetDobotMatrix(245.1905, -61.6963, 214.2730, 1.5698, 169.7256, 67.9938); //Set the
Cartesian coordinates of the cubes to obtain the rotation matrix based on the image coordinates and the Cartesian
coordinates.
SmartKit_VISSetGrapAreaZ(-65);
SmartKit_VISSetBlockTA(RED, 120, -135.9563, -66.9085, 0); // Set the placing position of the red
cube
SmartKit_VISSetBlockTA(GREEN, 160, -135.9563, -66.9085, 0);
SmartKit_VISSetBlockTA(BLUE, 200, -135.9563, -66.9085, 0);
SmartKit_VISSetBlockTA(YELLOW, 240, -135.9563, -66.9085, 0);
SmartKit_VISSetBlockHeight(RED, 26); // Set the cube height
SmartKit_VISSetBlockHeight(GREEN, 26);
SmartKit_VISSetBlockHeight(BLUE, 26);
SmartKit_VISSetBlockHeight(YELLOW, 26);
SmartKit_VISInit(); // Initial the Pixy
SmartKit_Init();