Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading empty meshes as render geometry causes a hard crash. #25

Open
psigen opened this issue Apr 6, 2015 · 6 comments
Open

Loading empty meshes as render geometry causes a hard crash. #25

psigen opened this issue Apr 6, 2015 · 6 comments
Labels

Comments

@psigen
Copy link
Member

psigen commented Apr 6, 2015

The attached empty.iv file, when loaded in or_rviz, crashes OGRE when used as a render mesh. It works fine in OpenRAVE's qtcoin viewer.

https://gist.github.com/psigen/19d7fe6d9c8d5c824a3d

[LinkMarker.cpp:323 CreateVisualGeometry] Loaded one or more meshes OpenRAVE because this format is not supported by RViz. This may be slow for large files.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffbaed5700 (LWP 5789)]
0x00007fffd380a650 in Ogre::Material::getTechnique(unsigned short) ()
   from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.8.1
(gdb) bt
#0  0x00007fffd380a650 in Ogre::Material::getTechnique(unsigned short) ()
   from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.8.1
#1  0x00007fffd3f9f3dc in rviz::InteractiveMarkerControl::addHighlightPass(std::set<Ogre::MaterialPtr, std::less<Ogre::MaterialPtr>, std::allocator<Ogre::MaterialPtr> >) () from /opt/ros/indigo/lib/libdefault_plugin.so
#2  0x00007fffd3f9fc46 in rviz::InteractiveMarkerControl::makeMarkers(visualization_msgs::InteractiveMarkerControl_<std::allocator<void> > const&) ()
   from /opt/ros/indigo/lib/libdefault_plugin.so
#3  0x00007fffd3fa07f2 in rviz::InteractiveMarkerControl::processMessage(visualization_msgs::InteractiveMarkerControl_<std::allocator<void> > const&) ()
   from /opt/ros/indigo/lib/libdefault_plugin.so
#4  0x00007fffd3fa5ba3 in rviz::InteractiveMarker::processMessage(visualization_msgs::InteractiveMarker_<std::allocator<void> > const&) ()
   from /opt/ros/indigo/lib/libdefault_plugin.so
@psigen psigen changed the title Loading an empty.iv file as a render mesh causes a hard crash. Loading empty meshes as render geometry causes a hard crash. Apr 6, 2015
@psigen
Copy link
Member Author

psigen commented Apr 6, 2015

This issue also occurs with empty STL files, such as the following:

https://www.dropbox.com/s/whja8woux0xk4i8/empty.stl?dl=0

what():  OGRE EXCEPTION(2:InvalidParametersException): No data defined to convert to a mesh. in ManualObject::convertToMesh at /build/buildd/ogre-1.8-1.8.1+dfsg/OgreMain/src/OgreManualObject.cpp (line 782)

@psigen psigen added the bug label Apr 6, 2015
@mkoval
Copy link
Member

mkoval commented Apr 6, 2015

I can easily fix this for .iv files. These are not natively supported by RViz, so we load the mesh using OpenRAVE and convert it to a TRIANGLE_LIST type. I can simply skip the conversion if indices is empty. I will add this check.

Unfortunately, this isn't as easy for .stl files. We pass these directly to RViz using the MESH_RESOURCE type without ever loading them in OpenRAVE. We would have to load the model from disk in OpenRAVE just to do this check.

I'm not sure if it's worth it to add the .stl check for a few reasons:

  1. This is a bug in RViz, not or_rviz
  2. We have no way of checking for empty .dae files, which will also most likely crash RViz
  3. OpenRAVE now supports the none geometry type (Added support for the GT_None GeometryType rdiankov/openrave#306)

@psigen
Copy link
Member Author

psigen commented Apr 6, 2015

The none geometry type is pretty useless for the case of having collision-only trimesh geometry. It seems to only be useful for links that have no geometry at all.

I agree that fixing this for STLs might be something we have to send upstream.

@mkoval
Copy link
Member

mkoval commented Apr 6, 2015

You're right. none solves the opposite problem (render geometry, but no collision geometry).

My understanding was that qtcoin and or_rviz only rendered visual meshes and did not fall back on rendering primitive objects (e.g. personalrobotics/or_urdf#5). That doesn't seem to the case, so I need to look into that bug. Maybe we can use the same trick to avoid using empty mesh files. 😄

@mklingen
Copy link
Collaborator

mklingen commented Apr 6, 2015

when the user adds a "RobotModel" display, what happens in RVIZ when the URDF includes an empty .stl file as visual geometry?

@psigen
Copy link
Member Author

psigen commented Sep 17, 2015

@mklingen: I'm not sure, it either loads nothing or falls back on a collision mesh. I guess it makes sense to try and keep the same logic here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants