4 import move_base_msgs.msg
as move_base_msgs
5 import geometry_msgs.msg
as geometry_msgs
6 import visualization_msgs.msg
as viz_msgs
7 import std_msgs.msg
as std_msgs
12 with open(filename,
'r') as f: 15 return data[
'waypoints']
18 pose = geometry_msgs.Pose()
20 pose.position.x = p[
'pose'][
'position'][
'x']
21 pose.position.y = p[
'pose'][
'position'][
'y']
22 pose.position.z = p[
'pose'][
'position'][
'z']
23 pose.orientation.x = p[
'pose'][
'orientation'][
'x']
24 pose.orientation.y = p[
'pose'][
'orientation'][
'y']
25 pose.orientation.z = p[
'pose'][
'orientation'][
'z']
26 pose.orientation.w = p[
'pose'][
'orientation'][
'w']
30 target = geometry_msgs.PoseStamped()
31 target.header.frame_id = p[
'frame_id']
32 target.header.stamp = rospy.Time.now()
34 goal = move_base_msgs.MoveBaseGoal(target)
38 marray= viz_msgs.MarkerArray()
42 marray.markers.append(m_arrow)
43 marray.markers.append(m_text)
49 m.header.frame_id = w[
'frame_id']
52 m.action = viz_msgs.Marker.ADD
54 m.scale = geometry_msgs.Vector3(1.0,0.3,0.3)
55 m.color = std_msgs.ColorRGBA(0.0,1.0,0.0,1.0)
57 id_count = id_count + 1
62 m.type = viz_msgs.Marker.ARROW
63 m.color = std_msgs.ColorRGBA(0.0,1.0,0.0,1.0)
68 m.type = viz_msgs.Marker.TEXT_VIEW_FACING
69 m.pose.position.z = 2.5
def get_waypoints(filename)
def create_move_base_goal(p)
def create_viz_markers(waypoints)