I added a check for has_texture from the MeshMaterial message so textureIndex would resolve false for enteringTexturedTriangleMesh to fix a segfault for non-textured, but colored materials. Otherwise, the textureIndex would be set to whatever value and Rviz would proceed to segfault since that textureIndex may not be a valid index (i.e. if there weren't any textures whatsoever). This was a problem with rospy since the automatic serialization would always associate a value to texture_index, and the boost::optional<uint32_t> would never evaluate false. I don't know if this occurs in roscpp as well.
Additionally I changed the cluster material association part of the material service request function so that each cluster would use the respective material from cluster_materials instead of the material with the identical index to the cluster. Since it also looked like a nearby line was not used for anything, I commented that out as well.
Since this was only a 3 line change, I combined it into one commit. Hopefully that isn't a problem!
I added a check for
has_texture
from theMeshMaterial
message sotextureIndex
would resolvefalse
forenteringTexturedTriangleMesh
to fix a segfault for non-textured, but colored materials. Otherwise, thetextureIndex
would be set to whatever value and Rviz would proceed to segfault since thattextureIndex
may not be a valid index (i.e. if there weren't any textures whatsoever). This was a problem withrospy
since the automatic serialization would always associate a value totexture_index
, and theboost::optional<uint32_t>
would never evaluatefalse
. I don't know if this occurs inroscpp
as well.Additionally I changed the cluster material association part of the material service request function so that each cluster would use the respective material from
cluster_materials
instead of the material with the identical index to the cluster. Since it also looked like a nearby line was not used for anything, I commented that out as well.Since this was only a 3 line change, I combined it into one commit. Hopefully that isn't a problem!