5 import roslib;roslib.load_manifest(
"jsk_rviz_plugins")
8 from sensor_msgs.msg
import PointCloud2
9 from std_msgs.msg
import ColorRGBA, Float32
12 text_pub = rospy.Publisher(
"output_text", OverlayText)
15 point_num = cloud.width * cloud.height
18 for field
in cloud.fields:
19 point_type +=field.name
20 frame_id = cloud.header.frame_id
29 text.font =
"DejaVu Sans Mono"
30 text.text =
"""Point Cloud Num : %d
33 """ % (point_num, point_type, frame_id)
34 text.fg_color = ColorRGBA(25 / 255.0, 1.0, 240.0 / 255.0, 1.0)
35 text.bg_color = ColorRGBA(0.0, 0.0, 0.0, 0.2)
36 text_pub.publish(text)
39 if __name__ ==
"__main__":
40 rospy.init_node(
"pointcloud_information_text")
41 rospy.Subscriber(
"input", PointCloud2, cloud_cb)