-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathTutorial_getters.py
56 lines (49 loc) · 1.4 KB
/
Tutorial_getters.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 26 17:03:26 2018
@author: Mohammad SAFEEA
Test script of iiwaPy class.
"""
from iiwaPy import iiwaPy
import time
ip='172.31.1.147'
#ip='localhost'
iiwa=iiwaPy(ip)
iiwa.setBlueOn()
time.sleep(2)
iiwa.setBlueOff()
# 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('Cartezian position (X,Y,Z) of end effector')
print(iiwa.getEEFCartizianPosition())
time.sleep(0.1)
print('Moment at end effector')
print(iiwa.getEEF_Moment())
time.sleep(0.1)
print('Joints positions')
print(iiwa.getJointsPos())
time.sleep(0.1)
print('External torques at the joitns')
print(iiwa.getJointsExternalTorques())
time.sleep(0.1)
print('Measured torques at the joints')
print(iiwa.getJointsMeasuredTorques())
time.sleep(0.1)
print('Measured torque at joint 5')
print(iiwa.getMeasuredTorqueAtJoint(5))
time.sleep(0.1)
print('Rotation of EEF, fixed rotation angles (X,Y,Z)')
print(iiwa.getEEFCartizianOrientation())
time.sleep(0.1)
print('Joints positions has been streamed external torques are:')
print(iiwa.getEEFCartizianOrientation())
time.sleep(0.1)
except:
print('an error happened')
iiwa.close()