Know if a model exists in my Gazebo Simulation
Hi, is there a way to get all model names in my simulation ?
I need to check in a C++ node if a model is instanciated in my gazebo simulation.
Thanks for help
Asked by blevesque on 2017-07-12 10:48:46 UTC
Answers
You can write a world plugin. On that example, _parent
is a pointer to physics::World. So you can use _parent->GetModel("modelname")
, if it returns null there is no model with that name in the world.
Asked by chapulina on 2017-07-12 11:51:48 UTC
Comments
I will try this thanks:)
Asked by blevesque on 2017-07-12 11:55:13 UTC
But a world plugin is used only when I instanciate my gzserver/world right ? Can I check my models whenever I want even after simulation launch ?
Asked by blevesque on 2017-07-13 04:59:22 UTC
Comments