forked from MatthewVerbryke/rse_dam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_rotate
executable file
·62 lines (49 loc) · 1.74 KB
/
test_rotate
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env python
import sys
from deliberative.adapter import *
from deliberative.trajectories import *
from habitual.test_moveit import *
from habitual.reachability import *
REF_FRAME = "origin_point"
def rotate_test():
start_pose = Pose()
start_pose.position.x = 0.24
start_pose.position.y = 0.0
start_pose.position.z = 0.2659
start_pose.orientation.x = 0.707107
start_pose.orientation.y = 0.0
start_pose.orientation.z = 0.0
start_pose.orientation.w = 0.707107
goal_pose = Pose()
goal_pose.position.x = 0.24
goal_pose.position.y = 0.0
goal_pose.position.z = 0.2659
goal_pose.orientation.x = 0.0
goal_pose.orientation.y = -0.707107
goal_pose.orientation.z = 0.707107
goal_pose.orientation.w = 0.0
arm_pose = Pose()
arm_pose.position.x = 0.24
arm_pose.position.y = -0.128
arm_pose.position.z = 0.2659
arm_pose.orientation.x = -0.707107
arm_pose.orientation.y = 0.0
arm_pose.orientation.z = 0.0
arm_pose.orientation.w = 0.707107
speed = 0.05 #rad/s
lift_height = 0.1
trajectory, timestamps = create_in_place_rotation_trajectory(start_pose, goal_pose, speed, REF_FRAME)
offset = compute_eef_offset(start_pose, arm_pose)
poses = adapt_arm_poses(trajectory, offset)
interface = MoveItHabitualModule()
for pose in poses.poses:
pose_req = PoseStamped()
pose_req.header.seq = 1
pose_req.header.stamp.secs = 1
pose_req.header.stamp.nsecs = 1
pose_req.header.frame_id = REF_FRAME
pose_req.pose = pose
reachable = is_pose_reachable(pose, "right")
joint_state = interface.ik_solve(pose_req)
print joint_state
rotate_test()