forked from facebookresearch/pyrobot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ee_xyz_control.py
36 lines (29 loc) · 928 Bytes
/
ee_xyz_control.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
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Example for moving the end effector along x,y,z axis
"""
import time
import numpy as np
from pyrobot import Robot
def main():
np.set_printoptions(precision=4, suppress=True)
bot = Robot(
"sawyer", use_arm=True, use_base=False, use_camera=False, use_gripper=True
)
plan = False
bot.arm.move_to_neutral()
time.sleep(1)
displacement = np.array([0.15, 0, 0])
bot.arm.move_ee_xyz(displacement, plan=plan)
time.sleep(1)
displacement = np.array([0.0, 0.15, 0])
bot.arm.move_ee_xyz(displacement, plan=plan)
time.sleep(1)
displacement = np.array([0.0, 0.0, 0.15])
bot.arm.move_ee_xyz(displacement, plan=plan)
time.sleep(1)
bot.arm.go_home()
if __name__ == "__main__":
main()