-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathex43_calculate_kinematic.py
32 lines (24 loc) · 1.29 KB
/
ex43_calculate_kinematic.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
from ex23_load_robot import robot
import math
from compas.geometry import Frame
from compas_fab.robots import Configuration
from compas_fab.backends import RosClient
robot.client = RosClient()
robot.client.run()
goal_frame = Frame([0.20, 0.38, 0.32], [0, 1, 0], [0, 0, 1])
start_configuration = Configuration.from_revolute_values((-0.042, -1.988, 2.174, -3.327, -1.528, -6.283))
group = "manipulator" # or robot.main_group_name
response = robot.motion_plan_goal_frame(goal_frame,
start_configuration,
tolerance_position=0.001,
tolerance_angle=math.radians(1),
group=group,
path_constraints=None,
planner_id='RRT',
num_planning_attempts=20,
allowed_planning_time=8.)
print("Computed kinematic path with %d configurations." % len(response.configurations))
print("Executing this path at full speed would take approx. %.3f seconds." % response.trajectory.joint_trajectory.points[-1].time_from_start.seconds())
for config in response.configurations:
print(config)
robot.client.terminate()