Skip to content

Commit

Permalink
write visual and collision name to xml
Browse files Browse the repository at this point in the history
Signed-off-by: brian soe <[email protected]>
  • Loading branch information
briansoe66 committed Jan 17, 2025
1 parent 3f6bf9a commit 74421b3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions urdf_parser/src/link.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,9 @@ bool exportVisual(Visual &vis, tinyxml2::XMLElement *xml)
// </visual>
tinyxml2::XMLElement * visual_xml = xml->GetDocument()->NewElement("visual");

if (!vis.name.empty())
visual_xml->SetAttribute("name", vis.name.c_str());

exportPose(vis.origin, visual_xml);

exportGeometry(vis.geometry, visual_xml);
Expand All @@ -639,6 +642,9 @@ bool exportCollision(Collision &col, tinyxml2::XMLElement* xml)
// </collision>
tinyxml2::XMLElement * collision_xml = xml->GetDocument()->NewElement("collision");

if (!col.name.empty())
collision_xml->SetAttribute("name", col.name.c_str());

exportPose(col.origin, collision_xml);

exportGeometry(col.geometry, collision_xml);
Expand Down

0 comments on commit 74421b3

Please sign in to comment.