Pyniryo

Your first pick and place

In the second example, we are going to develop a pick and place algorithm.

from pyniryo import NiryoRobot, PoseObject

robot = NiryoRobot('<robot_ip_address>')

robot.calibrate_auto()
robot.update_tool()

robot.release_with_tool()
robot.move(PoseObject(0.19, -0.12, 0.24, -3.14, 0.01, -0.1))
robot.grasp_with_tool()

robot.move(PoseObject(0.2, 0.09, 0.25, -3.14, -0.0, -0.03))
robot.release_with_tool()

robot.close_connection()
 
Code Details - First Pick And Place

First of all, we import the library and start the connection between our computer and the robot. We also calibrate the robot.

from pyniryo import NiryoRobot, PoseObject

robot = NiryoRobot('<robot_ip_address>')

robot.calibrate_auto()

Then, we equip the tool with update_tool().

robot.update_tool()

Now that our initialization is done, we can open the gripper (or push air from the vacuum) with release_with_tool(), go to the picking pose via move() & then catch an object with grasp_with_tool()!

robot.release_with_tool()
robot.move(PoseObject(0.19, -0.12, 0.24, -3.14, 0.01, -0.1))
robot.grasp_with_tool()

We now get to the place pose, and place the object.

robot.move(PoseObject(0.2, 0.09, 0.25, -3.14, -0.0, -0.03))
robot.release_with_tool()

Our process is now over, we can close the connection.

robot.close_connection()