random_point.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 import roslib
4 import rospy
5 from geometry_msgs.msg import PointStamped
6 from random import random
7 def main():
8  rospy.init_node("random_point")
9  pub = rospy.Publisher("/random_point", PointStamped, queue_size=1)
10  while not rospy.is_shutdown():
11  msg = PointStamped()
12  msg.header.stamp = rospy.Time.now()
13  msg.point.x = random() * 100;
14  msg.point.y = random() * 100 + 100;
15  msg.point.z = random() * 100 + 200;
16  pub.publish(msg)
17  rospy.sleep(0.01)
18 
19 
20 if __name__ == "__main__":
21  main()
22 
random_point.main
def main()
Definition: random_point.py:7


rwt_plot
Author(s): Ryohei Ueda
autogenerated on Sat Jun 3 2023 02:43:57