def __init__(self, topics): # Flags self.need_rgb = True self.need_depth = True # RGB Subscribers sub_rgb = message_filters.Subscriber(topics['rgb'], numpy_msg(Image)) sub_rgb_info = message_filters.Subscriber(topics['rgb_info'], CameraInfo) ts_rgb = message_filters.TimeSynchronizer([sub_rgb, sub_rgb_info], 100) ts_rgb.registerCallback(self.rgb_callback) # Depth Subscribers sub_depth = message_filters.Subscriber(topics['depth'], numpy_msg(Image)) sub_depth_info = message_filters.Subscriber(topics['depth_info'], CameraInfo) ts_depth = message_filters.TimeSynchronizer([sub_depth, sub_depth_info], 100) ts_depth.registerCallback(self.depth_callback) self.pub_cloud = rospy.Publisher('/camera/xyz_rgb/points', numpy_msg(PointCloud2))
def __init__(self, topics): # Flags self.need_rgb = True self.need_depth = True # RGB Subscribers sub_rgb = message_filters.Subscriber(topics['rgb'], numpy_msg(Image)) sub_rgb_info = message_filters.Subscriber(topics['rgb_info'], CameraInfo) ts_rgb = message_filters.TimeSynchronizer([sub_rgb, sub_rgb_info], 100) ts_rgb.registerCallback(self.rgb_callback) # Depth Subscribers sub_depth = message_filters.Subscriber(topics['depth'], numpy_msg(Image)) sub_depth_info = message_filters.Subscriber(topics['depth_info'], CameraInfo) ts_depth = message_filters.TimeSynchronizer( [sub_depth, sub_depth_info], 100) ts_depth.registerCallback(self.depth_callback) self.pub_cloud = rospy.Publisher('/camera/xyz_rgb/points', numpy_msg(PointCloud2))
def __init__(self): self.pub = rospy.Publisher('/cloud_out', numpy_msg(PointCloud2)) self.sub = rospy.Subscriber('/cloud_in', numpy_msg(PointCloud2), self.cloud_callback, queue_size=1)