-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_set_two_robot_joints.py
31 lines (26 loc) · 1.21 KB
/
get_set_two_robot_joints.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
import urx
import time
if __name__ == '__main__':
robot_left = urx.Robot("192.10.0.11")
joints_left = robot_left.getj()
print('Left robot joints: ', joints_left)
time.sleep(1)
robot_right = urx.Robot("192.10.0.12")
joints_right = robot_right.getj()
print('Right robot joints: ', joints_right)
# starting states for our robots in GELLO and real-world experiments
starting_robot_joints_left = [1.3780459778509433, -1.523749890442781, -1.5899893346228173, -1.523211104456275, 1.722199931031265, -0.20266514321065365]
starting_robot_joints_right = [-1.6545815648737472, -1.6381940802802397, 1.795800360316563, -1.7138684258221923, -1.7362808437379504, -0.01120622072583366]
for i in range(100):
robot_left.servoj(
starting_robot_joints_left, vel=0.1, acc=0.3, t=0.35, lookahead_time=0.2, gain=100, wait=False
)
time.sleep(1)
print('Finished moving the left arm to starting states.')
for i in range(100):
robot_right.servoj(
starting_robot_joints_right, vel=0.1, acc=0.3, t=0.35, lookahead_time=0.2, gain=100, wait=False
)
time.sleep(1)
print('Finished moving the right arm to starting states.')
print('Done')