5 from sensor_msgs.msg
import PointCloud2
9 out_msg = PointStamped()
10 out_msg.header = msg.header
11 out_msg.point.x = pt_x
12 out_msg.point.y = pt_y
13 out_msg.point.z = pt_z
17 if __name__ ==
'__main__':
18 rospy.init_node(
'sample_point_publisher_from_pointcloud')
19 pt_x = rospy.get_param(
'~x', 0.0)
20 pt_y = rospy.get_param(
'~y', 0.0)
21 pt_z = rospy.get_param(
'~z', 0.0)
22 pub = rospy.Publisher(
'~output', PointStamped, queue_size=1)
23 sub = rospy.Subscriber(
'~input', PointCloud2, cb, queue_size=1)