Quantcast
Channel: Gazebo: Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 7017

Getting model state via rospy

$
0
0
Hello there, In my reinforcement learning simulation I am trying to get the pose of one of the models to use it for some calculations. Although I think I am using correct methods, the results are not what I want. Here is what the data for the model looks like in Gazebo: ![gazebo model description](/upfiles/15167859909090446.png) Here what interests me is the model pose. And when I use the rosservice call on this model to get the state, [same as in the tutorial](http://gazebosim.org/tutorials?tut=ros_comm&cat=connect_ros#GetModelStateExample) it returns the correct pose. But when I am trying to use rospy, I get the pose of a link, which stays the same. Here is the code that I use to do this: self.model_coordinates = rospy.ServiceProxy( '/gazebo/get_model_state', GetModelState) self.object_coordinates = self.model_coordinates("8115RC_V2", "8115RC_V2") z_position = self.object_coordinates.pose.position.z y_position = self.object_coordinates.pose.position.y x_position = self.object_coordinates.pose.position.x

Viewing all articles
Browse latest Browse all 7017