-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[parsing] Slightly improve joint parsing diagnostics #17054
[parsing] Slightly improve joint parsing diagnostics #17054
Conversation
+@sammy-tri for feature review, please. |
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.
+@xuchenhan-tri for platform review by rotation (Monday)
Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: LGTM missing from assignee xuchenhan-tri(platform) (waiting on @xuchenhan-tri)
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.
Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: 1 unresolved discussion, LGTM missing from assignee xuchenhan-tri(platform) (waiting on @jwnimmer-tri)
-- commits
line 5 at r1:
BTW, why is switch enum warning preferred to the default throw approach used before?
multibody/parsing/detail_sdf_parser.cc
line 621 at r1 (raw file):
case sdf::JointType::CONTINUOUS: { // TODO(#14747) Use an unlimited multibody::RevoluteJoint here. diagnostic.Error(fmt::format(
nit, are these covered by unit tests?
Mostly, just clarify our plans for future work, and be sure to notice when SDFormat adds new joint types (via C++ switch-enum warnings).
e71cbbe
to
c8bf4e6
Compare
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.
Reviewable status: LGTM missing from assignee xuchenhan-tri(platform) (waiting on @sammy-tri and @xuchenhan-tri)
Previously, xuchenhan-tri wrote…
BTW, why is switch enum warning preferred to the default throw approach used before?
When code uses a switch()
statement over an enum and the switch does not contain a default:
case, then the compiler will emit a warning about any enum values that have not been mentioned as cases. In Drake's build settings, we promote that warning to an error.
This means that is upstream libsdformat ever adds a new enumeration value, Drake developers will be forced to explicitly consider what we should do about it, because CI will bark during the libsdformat pin upgrade.
multibody/parsing/detail_sdf_parser.cc
line 621 at r1 (raw file):
Previously, xuchenhan-tri wrote…
nit, are these covered by unit tests?
Done.
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.
Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: complete! all discussions resolved, LGTM from assignees sammy-tri(platform),xuchenhan-tri(platform) (waiting on @jwnimmer-tri)
Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
When code uses a
switch()
statement over an enum and the switch does not contain adefault:
case, then the compiler will emit a warning about any enum values that have not been mentioned as cases. In Drake's build settings, we promote that warning to an error.This means that is upstream libsdformat ever adds a new enumeration value, Drake developers will be forced to explicitly consider what we should do about it, because CI will bark during the libsdformat pin upgrade.
Nice, thanks for the explanation
…#17054) * [parsing] Slightly improve joint parsing diagnostics Mostly, just clarify our plans for future work, and be sure to notice when SDFormat adds new joint types (via C++ switch-enum warnings).
…#17054) * [parsing] Slightly improve joint parsing diagnostics Mostly, just clarify our plans for future work, and be sure to notice when SDFormat adds new joint types (via C++ switch-enum warnings).
Mostly, just clarify our plans for future work, and be sure to notice when SDFormat adds new joint types (via C++ switch-enum warnings).
To provide more context for the TODOs -- as discussed in slack, to the extent that we can best-effort deal with unimplemented features (while warning about it to the user), that is probably the best UX. It will allow the user to actually create a MbP and play with it, resolving the warnings later in due course.
Closes #16784.
This change is