update teleop controller.

This commit is contained in:
zachary 2021-05-06 16:33:22 +08:00
parent 2581131bbe
commit e5f32081f6

View file

@ -17,11 +17,13 @@ roslib.load_manifest('mycobot_ros')
msg = """ msg = """
Mycobot Teleop Keyboard Controller Mycobot Teleop Keyboard Controller
--------------------------- ---------------------------
Movimg options(control coord [x,y,z,rx,ry,rz]): Movimg options(control coordinations [x,y,z,rx,ry,rz]):
w(x+) w(x+)
a(y-) s(x-) d(y+) a(y-) s(x-) d(y+)
z(z-) x(z+)
u(rx+) i(ry+) o(rz+) u(rx+) i(ry+) o(rz+)
j(rx-) k(ry-) l(rz-) j(rx-) k(ry-) l(rz-)
@ -31,8 +33,8 @@ Gripper control:
Other: Other:
1 - Go to init pose 1 - Go to init pose
2 - 2 - Go to home pose
3 - 3 - Resave home pose
q - Quit q - Quit
""" """
@ -88,7 +90,7 @@ def teleop_keyboard():
while True: while True:
res = get_coords() res = get_coords()
if res.x > 5: if res.x > 1:
break break
time.sleep(.1) time.sleep(.1)
@ -102,6 +104,7 @@ def teleop_keyboard():
print(vels(speed, change_size)) print(vels(speed, change_size))
while(1): while(1):
try: try:
print("\r current coords: %s" % record_coords, end="")
key = getKey(key_timeout) key = getKey(key_timeout)
if key == 'q': if key == 'q':
break break
@ -158,6 +161,7 @@ def teleop_keyboard():
home_pose[5] = rep.joint_5 home_pose[5] = rep.joint_5
else: else:
continue continue
except Exception as e: except Exception as e:
# print(e) # print(e)
continue continue