Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Model states with Code Deviation for position Values

Hello Guys,

i used a ros gazebo code example to get on my model state data for my objects in the world.

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

class Tutorial:

    _blockListDict = {
        'block_a': Block('fire_hydrant', '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)
                print '\n'
                print 'Status.success = ', resp_coordinates.success
                print(blockName)
                print("fire_hydrant " + str(block._name))
                print("x Wert : " + str(resp_coordinates.pose.position.x))
                print("Y Wert : " + str(resp_coordinates.pose.position.y))

        except rospy.ServiceException as e:
            rospy.loginfo("Get Model State service call failed:  {0}".format(e))

So i get the x and y position for my fire hydrant. Now my problem is that there is a deviation for arround 0.5 for the x Value. And there are another deviations for the x and y data i got from my slam map.

I don´t think that this is normal or am i wrong ?

Model states with Code Deviation for position Values

Hello Guys,

i used a ros gazebo code example to get on my model state data for my objects in the world.

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

class Tutorial:

    _blockListDict = {
        'block_a': Block('fire_hydrant', '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)
                print '\n'
                print 'Status.success = ', resp_coordinates.success
                print(blockName)
                print("fire_hydrant " + str(block._name))
                print("x Wert : " + str(resp_coordinates.pose.position.x))
                print("Y Wert : " + str(resp_coordinates.pose.position.y))

        except rospy.ServiceException as e:
            rospy.loginfo("Get Model State service call failed:  {0}".format(e))

So i get the x and y position for my fire hydrant. Now my problem is that there is a deviation for arround 0.5 for the x Value. Value only the x value the y value and the z value are correct. And there are another deviations for the x and y data i got from my slam map.

I don´t think that this is normal or am i wrong ?

Model states with Code Deviation for position Values

Hello Guys,

i used a ros gazebo code example to get on my model state data for my objects in the world.

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

class Tutorial:

    _blockListDict = {
        'block_a': Block('fire_hydrant', '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)
                print '\n'
                print 'Status.success = ', resp_coordinates.success
                print(blockName)
                print("fire_hydrant " + str(block._name))
                print("x Wert : " + str(resp_coordinates.pose.position.x))
                print("Y Wert : " + str(resp_coordinates.pose.position.y))

        except rospy.ServiceException as e:
            rospy.loginfo("Get Model State service call failed:  {0}".format(e))

So i get the x and y position for my fire hydrant. Now my problem is that there is a deviation for arround 0.5 for the x Value only the x value the y value and the z value are correct. And there are another deviations for the x and y data i got from my slam map.

I don´t think that this is normal or am i wrong ?

Model states with Code Deviation for position Values

Hello Guys,

i used a ros gazebo code example to get on my model state data for my objects in the world.

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

class Tutorial:

    _blockListDict = {
        'block_a': Block('fire_hydrant', '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)
                print '\n'
                print 'Status.success = ', resp_coordinates.success
                print(blockName)
                print("fire_hydrant " + str(block._name))
                print("x Wert : " + str(resp_coordinates.pose.position.x))
                print("Y Wert : " + str(resp_coordinates.pose.position.y))

        except rospy.ServiceException as e:
            rospy.loginfo("Get Model State service call failed:  {0}".format(e))

So i get the x and y position for my fire hydrant. Now my problem is that there is a deviation for arround 0.5 for the x Value only the x value the y value and the z value are correct. And there are another deviations for the x and y data i got from my slam map.

I don´t use two different commands:

rosservice call gazebo/get_model_state '{model_name: first_2015_trash_can}'

There i get following result:

pose: 
  position: 
    x: 2.14281687169
    y: -0.00116752407381
    z: -4.58441595449e-05

When i use my own programm i got following results:

Status.success =  True
first_2015_trash_can
first_2015_trashcan first_2015_trash_can
x Wert : 1.64513587169
Y Wert : -0.00116752407381

Without moving the trash. So thats why i think that this one of the values is normal or am i wrong ?wrong...

Model states with Code Deviation for position Values

Hello Guys,

i used a ros gazebo code example to get on my model state data for my objects in the world.

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

class Tutorial:

    _blockListDict = {
        'block_a': Block('fire_hydrant', '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)
                print '\n'
                print 'Status.success = ', resp_coordinates.success
                print(blockName)
                print("fire_hydrant " + str(block._name))
                print("x Wert : " + str(resp_coordinates.pose.position.x))
                print("Y Wert : " + str(resp_coordinates.pose.position.y))

        except rospy.ServiceException as e:
            rospy.loginfo("Get Model State service call failed:  {0}".format(e))

So i get the x and y position for my fire hydrant. Now my problem is that there is a deviation for arround 0.5 for the x Value only the x value the y value and the z value are correct. And there are another deviations for the x and y data i got from my slam map.

I use two different commands:

rosservice call gazebo/get_model_state '{model_name: first_2015_trash_can}'

There i get following result:

pose: 
  position: 
    x: 2.14281687169
    y: -0.00116752407381
    z: -4.58441595449e-05

When i use my own programm i got following results:

Status.success =  True
first_2015_trash_can
first_2015_trashcan first_2015_trash_can
x Wert : 1.64513587169
Y Wert : -0.00116752407381

Without moving the trash. So thats why i think one of the values is wrong...wrong

Model states with Code Deviation for position Values

Hello Guys,

i used a ros gazebo code example to get on my model state data for my objects in the world.

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

class Tutorial:

    _blockListDict = {
        'block_a': Block('fire_hydrant', '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)
                print '\n'
                print 'Status.success = ', resp_coordinates.success
                print(blockName)
                print("fire_hydrant " + str(block._name))
                print("x Wert : " + str(resp_coordinates.pose.position.x))
                print("Y Wert : " + str(resp_coordinates.pose.position.y))

        except rospy.ServiceException as e:
            rospy.loginfo("Get Model State service call failed:  {0}".format(e))

So i get the x and y position for my fire hydrant. Now my problem is that there is a deviation for arround 0.5 for the x Value only the x value the y value and the z value are correct. And there are another deviations for the x and y data i got from my slam map.

I use two different commands:

rosservice call gazebo/get_model_state '{model_name: first_2015_trash_can}'

There i get following result:

pose: 
  position: 
    x: 2.14281687169
    y: -0.00116752407381
    z: -4.58441595449e-05

When i use my own programm i got following results:

Status.success =  True
first_2015_trash_can
first_2015_trashcan first_2015_trash_can
x Wert : 1.64513587169
Y Wert : -0.00116752407381

Without moving the trash. So thats why i think one of the values is wrong

i Updated the question a bit hope someone can help me why i get different values?