#! /usr/bin/env python
from gazebo_msgs.srv import GetModelState
from geometry_msgs.msg import PoseStamped
from std_msgs.msg import Float64
from rospy_tutorials.msg import Floats
from rospy.numpy_msg import numpy_msg
import rospy

class Block:
    def __init__(self, name, relative_entity_name):
        self._name = name
        self._relative_entity_name = relative_entity_name

class Tutorial:
    rospy.init_node("initial_position")
    _blockListDict = {
        'block_a': Block('iris_1', 'base_link'),
	'block_b': Block('iris_2', 'base_link'),
        'block_c': Block('iris_3', 'base_link')
    }

    def show_gazebo_models(self):
	try:
    		model_coordinates = rospy.ServiceProxy('/gazebo/get_model_state', GetModelState)
		for block in self._blockListDict.itervalues():
			blockName = str(block._name)
			resp_coordinates = model_coordinates(blockName, block._relative_entity_name)
			
        except rospy.ServiceException as e:
    		       rospy.loginfo("Get Model State service call failed:  {0}".format(e))
	

if __name__ == '__main__':
		tuto = Tutorial()
        	tuto.show_gazebo_models()

