publish_viapoints.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 # Author: christoph.roesmann@tu-dortmund.de
4 
5 import rospy, math
6 from geometry_msgs.msg import PoseStamped
7 from nav_msgs.msg import Path
8 
9 
11  pub = rospy.Publisher('/test_optim_node/via_points', Path, queue_size=1)
12  rospy.init_node("test_via_points_msg")
13 
14 
15  via_points_msg = Path()
16  via_points_msg.header.stamp = rospy.Time.now()
17  via_points_msg.header.frame_id = "odom" # CHANGE HERE: odom/map
18 
19  # Add via-points
20  point1 = PoseStamped()
21  point1.pose.position.x = 0.0;
22  point1.pose.position.y = 1.5;
23 
24  point2 = PoseStamped()
25  point2.pose.position.x = 2.0;
26  point2.pose.position.y = -0.5;
27 
28 
29  via_points_msg.poses = [point1, point2]
30 
31  r = rospy.Rate(5) # 10hz
32  t = 0.0
33  while not rospy.is_shutdown():
34 
35  pub.publish(via_points_msg)
36 
37  r.sleep()
38 
39 
40 
41 if __name__ == '__main__':
42  try:
44  except rospy.ROSInterruptException:
45  pass
46 


teb_local_planner
Author(s): Christoph Rösmann
autogenerated on Wed Jun 5 2019 19:25:10