forked from arthurrichards77/farscope_group_project
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_pickup.py
executable file
·33 lines (30 loc) · 870 Bytes
/
test_pickup.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
#!/usr/bin/env python
import rospy
from move_arm import ArmMover
from move_base import BaseDriver
from move_gripper import GripperController
rospy.init_node("test_pickup")
base_driver = BaseDriver()
arm_mover = ArmMover()
gripper_controller = GripperController()
# open gripper ready
gripper_controller.open()
# lift arm to what seems to be right height
arm_mover.move(shoulder_lift_cmd_in=-0.6, elbow_cmd_in=1.0)
# drive on to the target
base_driver.move(0.3, -0.1)
base_driver.move(0.3, -0.05)
# grab it
gripper_controller.close()
# lift it off shelf
arm_mover.move(shoulder_lift_cmd_in=-0.7, elbow_cmd_in=1.0)
# back away
base_driver.move(-0.3,0,0,2)
# turn base to get target over the receptacle
base_driver.move(0,0,0.2,6)
# forward a bit
base_driver.move(0.1)
# release gripper
gripper_controller.open()
# little nudge to drop it
base_driver.move(-0.5,0,0,0.1)