t1.start()

# Send trajectory here

# Set base and tool frame
kuka.set_base(np.array([0, 0, 0, 0, 0, 0]))
kuka.set_tool(np.array([0, 0, 0, 0, 0, 0]))

# Read base and tool frame to confirm
kuka.read_base()
kuka.read_tool()
print("Base Frame: ", kuka.base_frame)
print("Tool Frame: ", kuka.tool_frame)

# Set tcp velocity (mm/s)
kuka.set_tool_velocity(0.001)

# Set the advance parameter to 5. Parameters tells the KUKA controller how many
# steps in advance it can process. It is needed for continuous movement
kuka.set_advance(5)

# Set the $APO.CDIS > 0 for continuous movement. It is the parameter telling
# the kuka controller when it is allowed to deviate from given path (mm).
kuka.robot.write("$APO.CDIS", str(100))
kuka.read_APO()

# Read current cartessian position and orientation of end-effector
kuka.read_cartessian()

# Start logging thread
t1 = threading.Thread(target=log_end_effector_cartessian, args=(60, ))
Esempio n. 2
0
#Connect to robot
robot = openshowvar(ip = '192.168.100.147', port = 7000)
kuka = Kuka(robot)

# Set base and tool frame
kuka.set_base(np.array([0, 0, 0, 0, 0, 0]))
kuka.set_tool(np.array([0, 0, 0, 0, 0, 0]))

# Read base and tool frame to confirm
kuka.read_base()
kuka.read_tool()
print("Base Frame: ", kuka.base_frame)
print("Tool Frame: ", kuka.tool_frame)

# Set tcp velocity (mm/s)
kuka.set_tool_velocity(10)

# Set the advance parameter to 5. Parameters tells the KUKA controller how many
# steps in advance it can process. It is needed for continuous movement
kuka.set_advance(5)

# Set the $APO.CDIS > 0 for continuous movement. It is the parameter telling
# the kuka controller when it is allowed to deviate from given path (mm).
kuka.robot.write("$APO.CDIS", str(100))
kuka.read_APO()

# Read current cartessian position and orientation of end-effector
kuka.read_cartessian()

# Construct trajectory
trajectory_arr = []