sample_camera_info_and_pointcloud_publisher.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 import rospy
4 from sensor_msgs.msg import CameraInfo, PointCloud2
5 
6 if __name__ == "__main__":
7  rospy.init_node("sample_camera_info_and_pointcloud_publisher")
8  pub_info = rospy.Publisher("~info", CameraInfo, queue_size=1)
9  pub_cloud = rospy.Publisher("~cloud", PointCloud2, queue_size=1)
10  rate = rospy.Rate(1)
11  while not rospy.is_shutdown():
12  info = CameraInfo()
13  info.header.stamp = rospy.Time.now()
14  info.header.frame_id = "origin"
15  info.height = 544
16  info.width = 1024
17  info.D = [-0.20831339061260223, 0.11341656744480133,
18  -0.00035378438769839704, -1.746419547998812e-05,
19  0.013720948249101639, 0.0, 0.0, 0.0]
20  info.K = [598.6097412109375, 0.0, 515.5960693359375,
21  0.0, 600.0813598632812, 255.42999267578125,
22  0.0, 0.0, 1.0]
23  info.R = [0.999993085861206, 0.0022128731943666935, -0.0029819998890161514,
24  -0.0022144035901874304, 0.9999974370002747, -0.0005100672133266926,
25  0.002980863442644477, 0.0005166670307517052, 0.9999954104423523]
26  info.P = [575.3445434570312, 0.0, 519.5, 0.0,
27  0.0, 575.3445434570312, 259.5, 0.0,
28  0.0, 0.0, 1.0, 0.0]
29  pub_info.publish(info)
30  cloud = PointCloud2()
31  cloud.header.frame_id = "origin"
32  pub_cloud.publish(cloud)
33  rate.sleep()


jsk_pcl_ros_utils
Author(s): Yohei Kakiuchi
autogenerated on Mon May 3 2021 03:03:15