def __init__(self): # Define CameraTransormation Matrix self.camera = RealCamera() self.Rmain_camera = np.load('calib/CalibrationRotation.npy') self.Tmain_camera = np.load('calib/CalibrationTranslation.npy') # Connection to gripper self.grip = RobotiqGripper("/dev/ttyUSB0") self.grip.reset() self.grip.activate() self.grip.closeGripper() # Connection to robot ip = '172.31.1.148' self.iiwa = sunrisePy(ip) self.iiwa.setBlueOn() time.sleep(2) self.iiwa.setBlueOff() self.relVel = 0.1 self.vel = 10 self.iiwa.attachToolToFlange([-1.5, 1.54, 252.8, 0, 0, 0]) self.z_min = 12.3 # Z mousse self.z_min = -18 # Z table
def connectFun(self): message = "Connecting to robot at ip: " + self.IP_of_robot.get() self.printMessage(message) self.iiwa = sunrisePy(self.IP_of_robot.get()) jpos = self.iiwa.getJointsPos() for i in range(7): self.jText[i].set(str(jpos[i])) print("value of joint " + str(i)) print(self.jText[i].get())
def __init__(self): ip = '172.31.1.148' self.iiwa = sunrisePy(ip) self.grip = RobotiqGripper("/dev/ttyUSB0") self.iiwa.setBlueOn() self.grip.reset() self.grip.activate() time.sleep(2) self.iiwa.setBlueOff() self.relVel = 0.1 self.vel = 10 # Define Flange self.iiwa.attachToolToFlange([-1.5, 1.54, 152.8, 0, 0, 0])
# -*- coding: utf-8 -*- """ Created on Mon Mar 26 17:03:26 2018 @author: Mohammad SAFEEA Test script of iiwaPy class. """ from iiwaPy.sunrisePy import sunrisePy import time ip = '172.31.1.148' #ip='localhost' iiwa = sunrisePy(ip) iiwa.setBlueOff() time.sleep(2) iiwa.setBlueOn() # read some data from the robot try: print('End effector position and orientation is:') print(iiwa.getEEFPos()) time.sleep(0.1) print('Forces acting at end effector are') print(iiwa.getEEF_Force()) time.sleep(0.1) print('Cartesian position (X,Y,Z) of end effector') print(iiwa.getEEFCartesianPosition()) time.sleep(0.1) print('Moment at end effector') print(iiwa.getEEF_Moment()) time.sleep(0.1)