6 from geometry_msgs.msg
import PoseStamped
7 from nav_msgs.msg
import Path
11 pub = rospy.Publisher(
'/test_optim_node/via_points', Path, queue_size=1)
12 rospy.init_node(
"test_via_points_msg")
15 via_points_msg = Path()
16 via_points_msg.header.stamp = rospy.Time.now()
17 via_points_msg.header.frame_id =
"odom" 20 point1 = PoseStamped()
21 point1.pose.position.x = 0.0;
22 point1.pose.position.y = 1.5;
24 point2 = PoseStamped()
25 point2.pose.position.x = 2.0;
26 point2.pose.position.y = -0.5;
29 via_points_msg.poses = [point1, point2]
33 while not rospy.is_shutdown():
35 pub.publish(via_points_msg)
41 if __name__ ==
'__main__':
44 except rospy.ROSInterruptException:
def publish_via_points_msg()