Skip to content

Commit

Permalink
Slightly cleanup link.cpp.
Browse files Browse the repository at this point in the history
Just make the code flow easier to understand.

Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette committed Nov 20, 2017
1 parent 9549c51 commit 23225af
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions urdf_parser/src/link.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,16 +485,14 @@ bool parseLink(Link &link, TiXmlElement* config)

VisualSharedPtr vis;
vis.reset(new Visual());
if (parseVisual(*vis, vis_xml))
{
link.visual_array.push_back(vis);
}
else
if (!parseVisual(*vis, vis_xml))
{
vis.reset();
CONSOLE_BRIDGE_logError("Could not parse visual element for Link [%s]", link.name.c_str());
return false;
}

link.visual_array.push_back(vis);
}

// Visual (optional)
Expand All @@ -507,16 +505,13 @@ bool parseLink(Link &link, TiXmlElement* config)
{
CollisionSharedPtr col;
col.reset(new Collision());
if (parseCollision(*col, col_xml))
{
link.collision_array.push_back(col);
}
else
if (!parseCollision(*col, col_xml))
{
col.reset();
CONSOLE_BRIDGE_logError("Could not parse collision element for Link [%s]", link.name.c_str());
return false;
}
link.collision_array.push_back(col);
}

// Collision (optional)
Expand Down

0 comments on commit 23225af

Please sign in to comment.