Simulating GPS outage due to tree foliage
Howdy folks,
I'd like to simulate GPS outage/degradation due to tree foliage in Gazebo. This is conceivably "relatively easy" to do if I knew where all the tree model objects are located in Gazebo. I am totally new to Gazebo and I have just started studying the code for ROS Gazebo plugins (like the gazebo ros imu, gps, etc.).
Can someone point me to a tutorial or some demonstration code for querying specific Gazebo models (i.e. the models that represent the trees) within a certain vicinity to the robot model?
In the mean time I'll keep on keepin' on with going through the published Gazebo tutorials and searching for answers, but any advice, pointers or clues that would speed up this process would be greatly appreciated :)
Thanks in advance
Galto
Asked by Galto2000 on 2017-09-03 09:58:37 UTC
Answers
you should be able to get models in the world in your plugin by doing world->GetModel("your_model_name")
from there, calling model->GetWorldPose()
will give you position and rotation of that model which should help you workout distance between the tree and your robot. Note that this assumes each tree is one single model.
Asked by iche033 on 2017-09-07 13:28:53 UTC
Comments
Thank you for the insight. That's a good start. I also discovered that there is world->getModels() which appears to enumerates all the models. So I don't need to know exactly what the tree models are called ahead of time, as long as I adhere to some naming convention in the world (e.g. making sure that tree models have a name that has "tree" in it). I think I am on my way now, thanks.
Asked by Galto2000 on 2017-09-09 11:06:51 UTC
Comments
Hello, I am looking on how to solve the same problem. Did you find a viable solution?
Asked by Roberto Z. on 2020-09-24 03:29:42 UTC