Skip to content

Commit

Permalink
Allowing relative paths in URDF (#1213)
Browse files Browse the repository at this point in the history
When parsing a URDF file, the `_source` parameter is set to "urdf file" which breaks relative path resolution downstream. This commit changes the call to `sdf::readDoc` to use `filename` as the `_source` parameter instead.

Signed-off-by: Robert Plante <RobertDPlante@gmail.com>
Co-authored-by: Addisu Z. Taddese <addisu@openrobotics.org>
  • Loading branch information
FracturedShader and azeey authored Feb 4, 2023
1 parent fb69269 commit 783818a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ bool readFileInternal(const std::string &_filename, SDFPtr _sdf,
{
URDF2SDF u2g;
TiXmlDocument doc = u2g.InitModelFile(filename);
if (sdf::readDoc(&doc, _sdf, "urdf file", _convert, _errors))
if (sdf::readDoc(&doc, _sdf, filename, _convert, _errors))
{
sdfdbg << "parse from urdf file [" << _filename << "].\n";
return true;
Expand Down

0 comments on commit 783818a

Please sign in to comment.