Commit 547e75e3 authored by Rohan Budhiraja's avatar Rohan Budhiraja
Browse files

[sdf][geometry] fix issue with parsing non-existing geometry elements

parent 25ab6af0
Pipeline #15389 passed with stage
in 151 minutes and 3 seconds
...@@ -65,10 +65,12 @@ namespace pinocchio ...@@ -65,10 +65,12 @@ namespace pinocchio
std::vector< ::sdf::ElementPtr> geometry_array; std::vector< ::sdf::ElementPtr> geometry_array;
::sdf::ElementPtr geomElement = link->GetElement("collision"); ::sdf::ElementPtr geomElement = link->GetElement("collision");
while (geomElement) while (geomElement)
{ {
//Inserting data in std::map //Inserting data in std::map
geometry_array.push_back(geomElement); if (geomElement->Get<std::string>("name") != "__default__") {
geomElement = link->GetNextElement("collision"); geometry_array.push_back(geomElement);
}
geomElement = link->GetNextElement("collision");
} }
return geometry_array; return geometry_array;
} }
...@@ -82,7 +84,9 @@ namespace pinocchio ...@@ -82,7 +84,9 @@ namespace pinocchio
while (geomElement) while (geomElement)
{ {
//Inserting data in std::map //Inserting data in std::map
geometry_array.push_back(geomElement); if (geomElement->Get<std::string>("name") != "__default__") {
geometry_array.push_back(geomElement);
}
geomElement = link->GetNextElement("visual"); geomElement = link->GetNextElement("visual");
} }
return geometry_array; return geometry_array;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment