34 from geometry_msgs.msg
import Point
40 __REQUIRED_API_VERSION__ =
"1"
43 robot_configs[
"prbt"] = {
44 "initJointPose": [0.0, 0.0, math.radians(-25), 0.0, -1.57, 0],
47 "planning_group":
"manipulator",
48 "target_link":
"prbt_tcp",
49 "reference_frame":
"prbt_base",
50 "default_or": from_euler(0, math.radians(180), math.radians(90)),
51 "P1_position": Point(0.3, 0.0, 0.5),
52 "P1_orientation": from_euler(0, math.radians(180), math.radians(135)),
55 robot_configs[
"panda"] = {
56 "initJointPose": [0.0, -0.785, 0.0, -2.356, 0.0, 1.571, 0.785],
59 "planning_group":
"panda_arm",
60 "target_link":
"panda_link8",
61 "reference_frame":
"panda_link0",
62 "default_or": Quaternion(0.924, -0.382, 0.000, 0.000),
63 "P1_position": Point(0.2, 0.0, 0.8),
68 print(
"Executing " + __file__)
84 r = Robot(__REQUIRED_API_VERSION__)
86 r.move(Ptp(goal=initJointPose, planning_group=planning_group))
88 P1 = Pose(position=P1_position, orientation=P1_orientation)
91 position=Point(P1.position.x + L, P1.position.y + L, P1.position.z - M),
92 orientation=default_or,
95 position=Point(P1.position.x, P1.position.y + 2 * L, P1.position.z - 2 * M),
96 orientation=default_or,
99 position=Point(P1.position.x, P1.position.y + L, P1.position.z - M),
100 orientation=default_or,
106 planning_group=planning_group,
107 target_link=target_link,
108 reference_frame=reference_frame,
113 planning_group=planning_group,
114 target_link=target_link,
115 reference_frame=reference_frame,
120 planning_group=planning_group,
121 target_link=target_link,
122 reference_frame=reference_frame,
127 planning_group=planning_group,
128 target_link=target_link,
129 reference_frame=reference_frame,
134 planning_group=planning_group,
135 target_link=target_link,
136 reference_frame=reference_frame,
141 planning_group=planning_group,
142 target_link=target_link,
143 reference_frame=reference_frame,
148 planning_group=planning_group,
149 target_link=target_link,
150 reference_frame=reference_frame,
155 planning_group=planning_group,
156 target_link=target_link,
157 reference_frame=reference_frame,
172 circ3_interim_2 = Circ(
176 planning_group=planning_group,
177 target_link=target_link,
178 reference_frame=reference_frame,
180 circ1_center_2 = Circ(
184 planning_group=planning_group,
185 target_link=target_link,
186 reference_frame=reference_frame,
189 for radius
in [0, 0.1]:
190 r.move(Ptp(goal=initJointPose, planning_group=planning_group))
193 seq.append(ptp1, blend_radius=radius)
194 seq.append(circ3_interim_2, blend_radius=radius)
195 seq.append(ptp2, blend_radius=radius)
196 seq.append(lin3, blend_radius=radius)
197 seq.append(circ1_center_2, blend_radius=radius)
198 seq.append(lin2, blend_radius=radius)
204 if __name__ ==
"__main__":
206 rospy.init_node(
"robot_program_node")
210 robots = list(robot_configs.keys())
212 if len(sys.argv) < 2:
214 "Please specify the robot you want to use."
215 +
", ".join(
'"{0}"'.format(r)
for r
in robots)
219 if sys.argv[1]
not in robots:
223 +
" not available. Use one of "
224 +
", ".join(
'"{0}"'.format(r)
for r
in robots)
def test_sequence(initJointPose, L, M, planning_group, target_link, reference_frame, default_or, P1_position, P1_orientation)
def start_program(robot_name)
void print(PropagationDistanceField &pdf, int numX, int numY, int numZ)