-
-
Notifications
You must be signed in to change notification settings - Fork 469
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
seg fault when visualizing some mesh markers with materials #659
Comments
It would be great if you could build rviz with debugging symbols, i.e. On Thu, Jul 25, 2013 at 9:02 AM, Benjamin Cohen notifications@github.comwrote:
|
Just did it....line 549 Program received signal SIGSEGV, Segmentation fault. Also, I added some debug output in case it helps: for (uint32_t i = 0; i < mesh->getNumSubMeshes(); ++i) This is what it gave me: [ERROR][loadMaterialsForMesh][549]: [submesh 0] name: package://pviz/kitchen2/models/kitchen2.daeMaterial0 Program received signal SIGSEGV, Segmentation fault. Also notice that the seg fault occurred on my debug statement. Notice the weird concatenation of Material to the resource name.....is that normal? |
The concatenation of "Material10" etc to the resource name is normal, you can see it happen around line 427. Ogre wants everything in the system to have a unique name, which is quite a hassle sometimes. Strategies like this are common, take something that's unique to the thing in question (the resource) and add a type and incrementing number tag to it. Often in rviz you just see a static int variable and a label string. This one seems marginally more sophisticated. |
aiScene class from assimp uses unprotected pointers for its array implementation. We are reading off the end of the scene->mMeshes[] array for some reason. Investigating... |
Thanks for looking into it. I wonder what's unique to the approximately 10 meshes that I've been looking at that trigger this problem as opposed to the tons of collada files that everyone's been using without a problem until now. |
The bug I'm seeing is that assimp supports having submeshes which are So it's pretty plausible to me that some authoring tool uses that feature, On Fri, Jul 26, 2013 at 11:31 AM, Benjamin Cohen
|
Looks to me like google products are putting out these files on 3D warehouse. (Although Trimble bought Sketchup from Google last year.) authoring_tool>Google 3D Warehouse 1.0</authoring_tool authoring_tool>Google SketchUp 6.0.1099</authoring_tool authoring_tool>Google SketchUp 6.0.515</authoring_tool authoring_tool>Google SketchUp 6.4.112</authoring_tool |
Turns out rviz was assuming that submeshes were not re-used, but assimp does allow for it. With this change, that is supported and no longer causes a seg-fault.
I think the change I just committed fixes the bug. It worked on the one model from your list that I tried (which previously failed). Please re-open if it doesn't work. Thanks! |
Thanks! I'll try it out right now. I noticed that you committed it to hydro-devel.....should I be able to also compile this code under groovy? |
I'm not sure. I'm cherry-picking this change into groovy-devel now. On Fri, Jul 26, 2013 at 2:28 PM, Benjamin Cohen notifications@github.comwrote:
|
Turns out rviz was assuming that submeshes were not re-used, but assimp does allow for it. With this change, that is supported and no longer causes a seg-fault.
OK, tested and pushed the cherry-picked change into groovy-devel. If you have any idea why some meshes are inside-out (texture-wise), I would On Fri, Jul 26, 2013 at 2:32 PM, Dave Hershberger hersh@willowgarage.comwrote:
|
Thanks! I confirmed that it's working in groovy. I'm seeing the same behavior with the inside-out textures. I have no idea about this stuff in general, but I would guess the normals are in the wrong direction? pure guess. Thanks again for the super quick fix. |
BTW - I'm working on a team and I'm trying to figure out if I should tell them to build rviz with the fix from source or wait for the next ubuntu package... approximately how often do you push updates to the ubuntu package? |
I do releases whenever it seems like a good idea or when someone really If it would really help you out, I can start one today. On Fri, Jul 26, 2013 at 3:44 PM, Benjamin Cohen notifications@github.comwrote:
|
That would be sweet if it wouldn't cause any problems for you. BTW - I'm obviously biased but I think this fix allows people to view much large scenes now from 3D Warehouse and thus do some cool stuff in rviz. This is awesome! Do you think it's possible that the normals can have an effect on the materials? or is that insane? |
I don't know much about the normals. It does seem like that might be On Fri, Jul 26, 2013 at 3:58 PM, Benjamin Cohen notifications@github.comwrote:
|
ok, pushed releases for groovy and hydro rviz with the fix. Hope it is all On Fri, Jul 26, 2013 at 4:15 PM, Dave Hershberger hersh@willowgarage.comwrote:
|
Thanks a lot. I appreciate it. My new viz markers of full homes look awesome with the pr2 driving around inside of it. I'm determined to figure out the inside-out textures problem. I'll let you know when I figure out some clues. |
Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
(This is similar to this bug: #507 but it seems to still be a problem and might merit another ticket?)
I'm finding that sometimes when I try to visualize large collada meshes with materials using visualization markers (with mesh_use_embedded_materials = true), rviz seg faults (see below). The funny thing is that it happens on some meshes and not others and I'm not sure what the difference is between them. I have a feeling that it could be the relative paths to the image files in the .dae but I'm not sure.
All of the meshes that I've tested with were pulled from 3D warehouse and I opened them in Meshlab to confirm that they work OK.
The following 3 meshes of kitchens result in the same seg fault:
I'm on Ubuntu 11.10 64-bit w/ Groovy.
Let me know if there is anyway I can help (i.e. more debug output). Thanks in advance.
[ INFO][VisualizerApp::init][106]: rviz version 1.9.30
[ INFO][VisualizerApp::init][109]: compiled against OGRE version 1.7.3 (Cthugha)
[ INFO][RenderSystem::detectGlVersion][176]: OpenGl version: 3.3 (GLSL 3.3).
[ WARN][MessageFilter::testMessage][361]: Message from [/viz_mesh] has a non-fully-qualified frame_id [map]. Resolved locally to [/map]. This is will likely not work in multi-robot systems. This message will only print once.
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7a758bf in rviz::loadMaterialsForMesh(std::string const&, aiScene const*, Ogre::MeshPtr const&) ()
from /opt/ros/groovy/lib/librviz.so
(gdb) bt
#0 0x00007ffff7a758bf in rviz::loadMaterialsForMesh(std::string const&, aiScene const*, Ogre::MeshPtr const&) ()
from /opt/ros/groovy/lib/librviz.so
#1 0x00007ffff7a75f71 in rviz::meshFromAssimpScene(std::string const&, aiScene const*) ()
from /opt/ros/groovy/lib/librviz.so
#2 0x00007ffff7a768d8 in rviz::loadMeshFromResource(std::string const&) () from /opt/ros/groovy/lib/librviz.so
#3 0x00007fffca2817fc in rviz::MeshResourceMarker::onNewMessage(boost::shared_ptr<visualization_msgs::Marker_<std::allocator > const> const&, boost::shared_ptr<visualization_msgs::Marker_<std::allocator > const> const&) ()
from /opt/ros/groovy/lib/libdefault_plugin.so
#4 0x00007fffca27fcee in rviz::MarkerBase::setMessage(boost::shared_ptr<visualization_msgs::Marker_<std::allocator > const> const&) () from /opt/ros/groovy/lib/libdefault_plugin.so
#5 0x00007fffca26f3b3 in rviz::MarkerDisplay::processAdd(boost::shared_ptr<visualization_msgs::Marker_<std::allocator > const> const&) () from /opt/ros/groovy/lib/libdefault_plugin.so
#6 0x00007fffca26f9fe in rviz::MarkerDisplay::processMessage(boost::shared_ptr<visualization_msgs::Marker_<std::allocator > const> const&) () from /opt/ros/groovy/lib/libdefault_plugin.so
#7 0x00007fffca26fc23 in rviz::MarkerDisplay::update(float, float) () from /opt/ros/groovy/lib/libdefault_plugin.so
#8 0x00007ffff7a48633 in rviz::DisplayGroup::update(float, float) () from /opt/ros/groovy/lib/librviz.so
#9 0x00007ffff7aef3a9 in rviz::VisualizationManager::onUpdate() () from /opt/ros/groovy/lib/librviz.so
#10 0x00007ffff7b03154 in rviz::VisualizationManager::qt_metacall(QMetaObject::Call, int, void**) ()
from /opt/ros/groovy/lib/librviz.so
The text was updated successfully, but these errors were encountered: