tesseract-robotics / tesseract_ros2

22 stars 24 forks source link

Bug: `nullptr` returned by `loadLinkGeometry` not handled properly for unsupported shapes #113

Open marip8 opened 2 months ago

marip8 commented 2 months ago

The function loadLinkGeometry returns a nullptr for shape types it does not know how to render. This causes a segfault when parsing currently unsupported shapes, like planes. Instead of returning a nullptr, we should instead return an empty Ogre::Entity object (if possible) or check if the return of this function is a nullptr before adding it to the scene here and here.

marip8 commented 2 months ago

For the case of the plane, it seems like we might be able to support it with the following:

auto entity = entity_container.addUntrackedEntity(tesseract_gui::EntityContainer::RESOURCE_NS);
ogre_entity = scene.createEntity(entity.unique_name, Ogre::SceneManager::PrefabType::PT_PLANE);