-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offer an API option to display new warnings on problems with URDF to SDF conversions #1171
Conversation
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
Codecov Report
@@ Coverage Diff @@
## sdf9 #1171 +/- ##
=======================================
Coverage 87.82% 87.82%
=======================================
Files 64 65 +1
Lines 10095 10112 +17
=======================================
+ Hits 8866 8881 +15
- Misses 1229 1231 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
/// while providing an option to increase the warnings with new | ||
/// relevant issues. | ||
/// \return True if successful. | ||
bool readFile(const std::string &_filename, SDFPtr _sdf, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I think this is super helpful, I'm not sure adding a new overload is the best option. In Citadel, we only have two existing overloads, so this adds a third. In Garden, we have 6 overloads already! and how this will interact with all of them when forward ported is not clear. Starting from Fortress, these functions take a ParserConfig
object, so adding it to that makes sense, but for citadel, I would prefer if we could use a different approach. Perhaps an env variable? Or backport ParserConfig
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before handling sdf9
, I'd like to review a pull request that targets sdf12
and uses ParserConfig
. Once we have completed that review, we can decide how we want to backport it to sdf9
. Does that sound ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, I'll try to create it in the next days.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @azeey, @j-rivero, @scpeters! Circling back to this discussion, I've implemented the ideas for sdf12
, #1238,
- changing
sdfdbg
tosdfwarn
whenever links are ignored during urdf->sdf conversion - adding a setting in
ParserConfig
to convert urdf links with no inertia or masses smaller than 1e-6 to frames
I found that using warnings directly do not trigger any regressions, users will however start seeing them in their workflows without any change in behavior (might be a good thing, since these links are most likely mistakes)
Let me know what yall think!
Edit: I've previously opened a similar PR targeting sdf9
accidentally, and it seems to pass all the CIs as well. #1230
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think converting the debug messages to warnings (without any config flags) is reasonable since my expectation is that users generally do not rely on this behavior being the normal, i.e, we want to avoid spamming users who expect links to be ignored and they're okay with it, but I don't think that's most users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We just got #1238 merged into sdf12
, changing debug messages to warnings, with more explicit information if links or joints were ignored, and suggestions to resolve those issues. There's no behavior change (but with 1 bug fix), and ParserConfig
was not used. If it looks ok, we can probably try to cherry pick that back to sdf9
for gazebo11 and citadel?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 New feature
Should help providing an API option to have explicit warnings for #199 and #1007.
Summary
The PR tries to address the lack of the explicit information on decisions made that end up ignoring some link definitions in the user input which can lead to many problems see #199 and #1007.
For keeping backwards compatibility, no new warning is raised unless the consumer of sdformat readFile
The PR implements a new API function:
that allows users of sdf to enable new extra warnings.
If the parameter is enabled, the problems with links being ignored silently (not really, but the issues were stored in the logs) are promoted to warnings using
gzwarn
in theCreateSDF
function.Test it
Should be fairly trivial to change Gazebo or other consumer of the
readFile
API to use the new parameter. Examples of code that triggers problems can be found in #199 and #1007. Simple patch for gazebo9:Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.