Go to the documentation of this file.00001
00002 import rospy
00003 from array import array
00004 from nav_msgs.msg import OccupancyGrid
00005 from std_msgs.msg import String
00006 import operator
00007
00008 class MapListener:
00009 def __init__(self,topic):
00010 self.sub_topic = topic
00011 rospy.Subscriber(self.sub_topic,OccupancyGrid,self.callback)
00012 def callback(self,data):
00013 _frame_id = data.header.frame_id
00014 rospy.loginfo(_frame_id)
00015
00016
00017 if __name__ == '__main__':
00018 rospy.loginfo("started my node")
00019 rospy.init_node('map_listener_simple',anonymous=True)
00020 listener = MapListener("map")
00021 rospy.spin()