test_annotation_collection.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 import rospy
00004 import copy
00005 
00006 import world_canvas_client
00007 
00008 from yocs_msgs.msg import *
00009 from world_canvas_msgs.msg import *
00010 
00011 if __name__ == '__main__':
00012     rospy.init_node('test_annotation_collection')
00013     topic_name  = rospy.get_param('~topic_name', 'annotations')
00014     topic_type  = rospy.get_param('~topic_type', None)
00015     pub_as_list = rospy.get_param('~pub_as_list', False)
00016     namespace   = rospy.get_param('~srv_namespace', '')
00017     world    = rospy.get_param('~world')
00018     uuids    = rospy.get_param('~uuids', [])
00019     names    = rospy.get_param('~names', [])
00020     types    = rospy.get_param('~types', [])
00021     keywords = rospy.get_param('~keywords', [])
00022     related  = rospy.get_param('~relationships', [])
00023 
00024     ac = world_canvas_client.AnnotationCollection(world, uuids, names, types, keywords, related, namespace)
00025     ac.load_data()
00026     walls = ac.get_data_of_type(yocs_msgs.msg.Wall)
00027     columns = ac.get_data_of_type(yocs_msgs.msg.Column)
00028 
00029     # Publish annotations' visual markers on client side
00030     ac.publish_markers('annotation_markers')
00031 
00032     # Publish annotations on client side
00033     ac.publish(topic_name + '_client', topic_type, False, pub_as_list)
00034 
00035     # Request server to also publish the same annotations
00036     ac.publish(topic_name,             topic_type, True,  pub_as_list)
00037     
00038     rospy.loginfo("Done")
00039     rospy.spin()


world_canvas_client_examples
Author(s): Jorge Santos
autogenerated on Thu Jun 6 2019 18:32:45