18 from sr_robot_msgs.srv
import PlanTrajectoryFromList
as PlanFromList
19 from sr_robot_msgs.srv
import PlanTrajectoryFromPrefix
as PlanFromPrefix
20 from sr_robot_msgs.srv
import ExecutePlannedTrajectory
as ExecutePlan
21 from sr_robot_msgs.srv
import PlanNamedTrajectory
as PlanNamed
22 from sr_robot_msgs.srv
import ListNamedTrajectories
as ListNamed
23 from functools
import partial
24 from copy
import deepcopy
30 rospy.init_node(
'waypoint_named_services')
32 rospy.loginfo(
"Waiting for planning services...")
33 rospy.wait_for_service(
'plan_trajectory_from_list')
34 rospy.wait_for_service(
'plan_trajectory_from_prefix')
35 rospy.wait_for_service(
'execute_planned_trajectory')
38 'plan_trajectory_from_list', PlanFromList)
40 'plan_trajectory_from_prefix', PlanFromPrefix)
42 'execute_planned_trajectory', PlanFromPrefix)
43 rospy.loginfo(
"Service proxies connected.")
53 rospy.logfatal(
"Trajectory name is not unique")
54 elif len(mapping)
is 0:
55 rospy.logfatal(
"Trajectory name does not exist")
59 if "list" not in m.keys()
and "prefix" not in m.keys():
60 rospy.logfatal(
"Service must specify either prefix " +
61 "or list for choosing waypoints")
62 elif "list" in m.keys()
and "prefix" in m.keys():
63 rospy.logfatal(
"Service mapping has both list and " +
64 "prefix specified. Can only be one.")
66 if "list" in m.keys():
77 plan_service_name = rospy.get_param(
"~plan_named_trajectory_service")
78 list_service_name = rospy.get_param(
"~list_named_trajectories_service")
85 if __name__ ==
"__main__":
def define_services(self)
def __plan_named_trajectory(self, req)
def __list_named_trajectories(self, req)