From e4ace90980ae5b5a17502225b6063313bbe5a373 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Tue, 25 Apr 2017 21:37:04 -0700 Subject: [PATCH] fix some potentially uninitialized variable --- .../ImportMJCFDemo/BulletMJCFImporter.cpp | 5 +++++ examples/Importers/ImportURDFDemo/UrdfParser.h | 14 +++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/examples/Importers/ImportMJCFDemo/BulletMJCFImporter.cpp b/examples/Importers/ImportMJCFDemo/BulletMJCFImporter.cpp index 891c3c291..b7ca1f3b7 100644 --- a/examples/Importers/ImportMJCFDemo/BulletMJCFImporter.cpp +++ b/examples/Importers/ImportMJCFDemo/BulletMJCFImporter.cpp @@ -1741,6 +1741,11 @@ class btCompoundShape* BulletMJCFImporter::convertLinkCollisionShapes(int linkIn } break; } + case URDF_GEOM_UNKNOWN: + { + break; + } + } // switch geom if (childShape) diff --git a/examples/Importers/ImportURDFDemo/UrdfParser.h b/examples/Importers/ImportURDFDemo/UrdfParser.h index 680fbc1ca..3cdde368b 100644 --- a/examples/Importers/ImportURDFDemo/UrdfParser.h +++ b/examples/Importers/ImportURDFDemo/UrdfParser.h @@ -50,9 +50,9 @@ enum UrdfGeomTypes URDF_GEOM_BOX, URDF_GEOM_CYLINDER, URDF_GEOM_MESH, - URDF_GEOM_PLANE, - URDF_GEOM_CAPSULE//non-standard URDF? - + URDF_GEOM_PLANE, + URDF_GEOM_CAPSULE, //non-standard URDF? + URDF_GEOM_UNKNOWN, }; @@ -83,6 +83,14 @@ struct UrdfGeometry UrdfMaterial m_localMaterial; bool m_hasLocalMaterial; + + UrdfGeometry() + :m_type(URDF_GEOM_UNKNOWN), + m_hasFromTo(false), + m_hasLocalMaterial(false) + { + } + }; bool findExistingMeshFile(const std::string& urdf_path, std::string fn,