Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gzweb
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Neurorobotics Platform
gzweb
Commits
0f77410c
Commit
0f77410c
authored
8 years ago
by
Kenny Sharma
Browse files
Options
Downloads
Patches
Plain Diff
[NRRPLT-3964] Prevent segfault in gzcoarse.
Change-Id: I26b3d4ecd663f8b49a7e3789b0e7789351fc6991
parent
aad27efb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/gzcoarse.cc
+21
-1
21 additions, 1 deletion
tools/gzcoarse.cc
with
21 additions
and
1 deletion
tools/gzcoarse.cc
+
21
−
1
View file @
0f77410c
...
...
@@ -1180,7 +1180,8 @@ void ConvertGzToGts(const gazebo::common::SubMesh *_subMesh,
}
else
{
std
::
cout
<<
": Ignoring degenerate facet!
\n
"
;
// HBP: removed spamming debug that provides little information
//std::cout << ": Ignoring degenerate facet!\n";
}
}
gts_surface_merge
(
_surface
,
subSurface
);
...
...
@@ -1233,6 +1234,25 @@ int main(int argc, char **argv)
{
const
gazebo
::
common
::
SubMesh
*
inSubMesh
=
inGz
->
GetSubMesh
(
s
);
// HBP: VALIDATE COLLADA FILE
//
// If a dae file does not have the proper TEXCOORD tags in it, the gazebo
// collada import will succeed, but the resulting mesh will not have any
// texCoord. This will cause a segfault in ExportTextureSource which does
// all of its calculations on vertices and then attempts to index into
// TexCoord, which will cause a segfault.
//
// We cannot try to generate an arbitrary mapping between vertices and
// the missing texture coordinates, nor can we try to run something like
// meshlab or blender since they cannot generate those values to export
// unless they were in the original collada to begin with.
if
(
inSubMesh
->
GetTexCoordCount
()
==
0
)
{
std
::
cout
<<
"Collada file does not contain valid texture coordinate "
<<
"mapping. Not simplifying."
<<
std
::
endl
;
return
-
1
;
}
// GAZEBO to GTS
GtsSurface
*
inOutGts
;
inOutGts
=
gts_surface_new
(
gts_surface_class
(),
gts_face_class
(),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment