You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clearly I crafted this example to make it explicitly tricky to spot (see https://gist.github.com/StevenACoffman/a5f6f682d94e38ed804182dc2693ed4b if you want to have fun), but in general it would be convenient if the URDF --> SDF parser detected <gazebo reference=".."> that referenced to non-existing elements, and printed at least a warning, to help in case of typos.
Alternatives considered
Continue not to print any warning if a <gazebo> tag refers to a non existing element.
Implementation suggestion
I checked the code, and indeed first the parser parsers all the <gazebo> tags in
Probably we should add a boolean flag or similar to each SDF extension, that is set to true once a SDF extension is consumed. If an SDF extension is not used at the end of the parsing, a warning should be printed.
Hi, I have attempted an implementation on my personal fork aagrawal05/sdformat on the parser_ref_warning_message branch.
Currently it only checks in the InsertSDFExtensionJoint method, but similar functionality can be easily implemented for the other functions (namely InsertSDFExtensionRobot, InsertSDFExtensionCollision, InsertSDFExtensionVisual, and InsertSDFExtensionJoint).
My solution currently works by adding a boolean check in the linear search of the extensions in the insertion function and adding the warning if not found.
I've also written a test ParseGazeboRefDoesntExistWarningMessage that ensures the functionality of this check.
Please let me know if this approach is suitable and if any changes would need to be made. If not, I'd be happy to open the pull request.
Desired behavior
If I try to convert the following URDF model, saved in a file called
oneLink.urdf
:to SDF with sdformat 14.0.0 (i.e. via
gz sdf -p ./oneLink.urdf > oneLink.sdf
), I obtaine the following result, without any additional output:Note how the
imu
sensors is completely ignored, without any warning message or error. Why is this happening? Because, despite the apperance, thelink1
string in<link name='link1'>
is not the same string aslіnk1
in<gazebo reference="lіnk1">
. The second letter of the string in the first case isi
, i.e. unicode character U+0069 (Latin Small Letter I), while in the second case is unicode character U+0456 (Cyrillic Small Letter Byelorussian-Ukrainian I).Clearly I crafted this example to make it explicitly tricky to spot (see https://gist.github.com/StevenACoffman/a5f6f682d94e38ed804182dc2693ed4b if you want to have fun), but in general it would be convenient if the URDF --> SDF parser detected
<gazebo reference="..">
that referenced to non-existing elements, and printed at least a warning, to help in case of typos.Alternatives considered
Continue not to print any warning if a
<gazebo>
tag refers to a non existing element.Implementation suggestion
I checked the code, and indeed first the parser parsers all the
<gazebo>
tags insdformat/src/parser_urdf.cc
Line 3372 in f360776
sdformat/src/parser_urdf.cc
Line 3182 in f360776
Probably we should add a boolean flag or similar to each SDF extension, that is set to true once a SDF extension is consumed. If an SDF extension is not used at the end of the parsing, a warning should be printed.
Additional context
We experienced this with @Gio-DS .
The text was updated successfully, but these errors were encountered: