11 import roslib;roslib.load_manifest(PKG)
13 from sensor_msgs.msg
import PointCloud2
18 global remain_polygon_msg
19 remain_polygon_msg = msg
21 global remain_coefficients_msg
22 remain_coefficients_msg = msg
24 global remain_polygon_msg, remain_coefficients_msg
25 if remain_polygon_msg
and remain_coefficients_msg:
26 remain_polygon_msg.header.stamp = msg.header.stamp
27 remain_polygon_msg.header.seq = msg.header.seq
28 remain_coefficients_msg.header.stamp = msg.header.stamp
29 remain_coefficients_msg.header.seq = msg.header.seq
30 polygons_pub.publish(remain_polygon_msg)
31 coefficients_pub.publish(remain_coefficients_msg)
32 remain_polygon_msg =
False 33 remain_coefficients_msg =
False 35 if __name__ ==
"__main__":
36 rospy.init_node(
'time_ensync', anonymous=
True)
37 polygons_pub = rospy.Publisher(
'ensynced_planes', PolygonArray)
38 coefficients_pub = rospy.Publisher(
'ensynced_planes_coefficients', ModelCoefficientsArray)
39 rospy.Subscriber(
"timer", PointCloud2, timer_cb)
40 rospy.Subscriber(
"planes", PolygonArray, input_polygons_cb)
41 rospy.Subscriber(
"planes_coefficients", ModelCoefficientsArray, input_coefficients_cb)
42 remain_polygon_msg =
False 43 remain_coefficients_msg =
False
def input_polygons_cb(msg)
def input_coefficients_cb(msg)