What is the `/gazebo/model_state` topic?

asked 2020-03-26 21:10:26 -0500

kane_choigo gravatar image

updated 2020-03-27 09:06:47 -0500

Hello, I'm working on the ROS melodic of Ubuntu 18.04.

I'm in the setting of a simulation environment with gazebo, and I need to get all the objects' pose data every time so I'm going to adopt /gazebo/model_states which includes all the pose information in that gazebo environment. (Just so you know, /gazebo/model_states comes from /gazebo node and its type is gazebo_msgs/ModelStates. And the object literally means the model which is spawned on the gazebo field, like walking_person or SUV car and anything.)

However, I just noticed that not all objects are in /gazebo/model_state at the beginning, although /gazebo/model_state gets all the objects after a few seconds.

I have this kind of feeling that this issue is related to gazebo-spawn probably.

Anyone who've been ever seen this kind of error or familiar with /gazebo/model_states, would you please give me helpful advice?

Thanks in advance. :)

edit retag flag offensive close merge delete

Comments

Just to be clear, what do you mean by objects? Are links missing in your model when you access the model_state message?

christophecricket gravatar image christophecricket  ( 2020-03-27 03:38:42 -0500 )edit

@christophecricket Sorry for my poor description, I just modified my text. The issue is /gazebo/model_states doesn't include all the objects (the model of gazebo field like walking_person or SUV_car and so on.) , although it gets all the state data wrt gazebo's model.

kane_choigo gravatar image kane_choigo  ( 2020-03-27 09:06:15 -0500 )edit

And you're sure that all these object are individual models in gazebo, and not just individual links in one model? Because then maybe /gazebo/link_states has the poses you want

christophecricket gravatar image christophecricket  ( 2020-03-27 10:25:50 -0500 )edit

@christophecricket yes, they are all independent of each other. I'll also check /gazebo/link_states too.

kane_choigo gravatar image kane_choigo  ( 2020-03-27 21:13:50 -0500 )edit