test_detections_topic.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 # This script is designed to test the functionality of the object detections
00003 # topic
00004 
00005 import rospy
00006 from rail_object_detection_msgs.msg import Detections
00007 
00008 def detections_callback(data):
00009         rospy.loginfo("*****************New Message:*********************")
00010         rospy.loginfo(
00011                 "Frame@Timestamp: %s@%s" % (data.header.frame_id, data.header.stamp,)
00012         )
00013         rospy.loginfo("Objects: %s" % ",".join([x.label for x in data.objects]))
00014 
00015 def main():
00016         rospy.init_node('test_detections_topic')
00017         rospy.Subscriber('/darknet_node/detections', Detections, detections_callback)
00018         rospy.spin()
00019 
00020 if __name__ == '__main__':
00021         main()


rail_object_detector
Author(s):
autogenerated on Sat Jun 8 2019 20:26:31