forked from Mandelbr0t/UniversalRobot-Realtime-Control
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.py
30 lines (21 loc) · 978 Bytes
/
example.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
import URBasic
import time
host = '192.168.56.101' #E.g. a Universal Robot offline simulator, please adjust to match your IP
acc = 1.2
vel = 0.8
if __name__ == '__main__':
robot_model = URBasic.model.RobotModel()
robot = URBasic.scriptExt.UrScriptExt(host=host,robotModel=robot_model)
robot.robotConnector.DashboardClient.ur_close_popup()
robot.reset_error()
print('movel with pose specification')
robot.movel(pose=[0.3,-0.3,0.3, 0,3.14,0], a=acc, v=vel)
print('movej with joint specification')
robot.movej(q=[-3.14,-1.,0.5, -1.,-1.5,0], a=acc, v=vel)
print('movej with pose specification')
robot.movej(pose=[0.3,0.3,0.3, 0,3.14,0], a=acc, v=vel)
print('force_mode')
robot.force_mode(task_frame=[0., 0., 0., 0., 0., 0.], selection_vector=[0,0,1,0,0,0], wrench=[0., 0., -20., 0., 0., 0.], f_type=2, limits=[2, 2, 1.5, 1, 1, 1])
time.sleep(1)
robot.end_force_mode()
robot.close()