Closed scpeters closed 2 years ago
The heightmap will never be visited because it isn't part of
visuals
.
it should be fixed by https://github.com/osrf/gazebo/commit/e497d4d41ae87ba5c2c613f684b1d14b480a60c7
Thank you for fixing this as it's a functionality I need for a project. I might've spotted a bug however: When using ROS for:
For some reason it uses the old visual representation (of the old heightmap) but the collisions work as intended (they're based on the new heightmap). A dirty work around that I'm using now is just to spawn the same new heightmap, delete it, then spawn it again, so that "buffer"-like anomaly disappears.
Seems my previously described issue was caused by the cache problems with heightmaps similar to the comments in #2604. Deleting the ~/.gazebo/paging/MODELNAME
folder within my script, each time I spawn a new heightmap fixed the problem without needing the workaround of double spawning (which didn't work that great after further testing).
@tekfr34k can you open an issue describing how to reproduce the problem?
thanks!
@scpeters I couldn't narrow down what exactly the problem is yet. The issue is very inconsistent, depending on if I start Gazebo from my launch scripts or just without any configuration at all it behaves differently. Maybe it has something to do with defining multiple model paths (even if the models are named differently in the SDF/config). Adding a model path in the "Insert" tab which contains the heightmap SDF gives an issue of not showing the model in the overview. Maybe that's something to start with...
As noted in #3159, removing a model containing a heightmap causes its collision shape to be remove from the physics subsystem in
gzserver
, but the heightmap visual remains ingzclient
. This pull request fixes that so that height map visuals should now disappear fromgzclient
when a heightmap model is deleted. The sequence of commits is described below:Scene::RemoveVisual
to delete the terrain object when a visual matchingterrainVisualId
is removed. This didn't actually work.dataPtr::visuals
vector. This code was already present elsewhere inProcessVisualMsg
, so I duplicated it to apply to the heightmap codepath. I didn't like this code duplication, so I worked to eliminate that in the following two commits.Visual::LoadFromMsg
for consistency with the latter parts ofProcessVisualMsg
. It requires construction of an extraboost::shared_ptr
but I think the consistency is worth it.ProcessVisualMsg
so it can share the existing portions that it had duplicated. This commit has a net reduction of 25 lines.