Closed SeanCurtis-TRI closed 2 years ago
cc @jwnimmer-tri
There should be run-time configurable parsing modes ...
IMO all we need is a good default (probably just drake::logging
), and an API-based way for a user to implement any of other the other options on their own (e.g., a callback settable on the Parser
object such as std::function<void, const drake::multibody::ParseError&> on_error
).
I don't think we need to provide sugar for any other error handling mechanisms, error consolidation, exceptions, etc. -- they will always be very application-specific.
We should also tie libsdformat's error reporting into this same channel (since we are wrapping it) per #9087.
FTR Sean, @azeey, @scpeters, and myself also discussed this via video chat after the Slack convo, but only for SDFormat (and the libsdformat parser).
@rpoyner-tri I'll add this one onto the project board as well.
How shall we subdivide this issue? We could certainly split by file type. Beyond that, are there distinct subtasks, other than just grinding through the implementation, piece by piece?
It depends a little bit on the implementation approach.
For SDFormat, it probably makes sense to split on "Known and not supported" vs "Unknown" since with the intermediate DOM those are going to be quite different.
For URDF, I'm not sure there's any difference.
Sounds right. I'm happy to defer splitting this one for a bit, since I'll claim neither of us is attacking it directly yet. If you have reason to split sooner, feel free.
Hmm, @rpoyner-tri is this just a duplicate of #16229 (and the 5 sub-issues it was split into)? If yes, please close it. If no, please clarify what we're missing beyond those 5 sub-issues.
For URDF, this is the only ticket that claims to care about emitting diagnostics for straight-up typos/bungling, (e.g. <transQQQmission>
). Given where we are, it may make sense to table that goal, since it will require a pretty comprehensive restructuring, and tinyxml2 maybe doesn't help as much as we might like.
In that case, could I ask you to write up that detail into a (new, 6th) sub-issue, and then we close this issue as a duplicate of those 6 more detailed ones? As it stands, this issue scope is unclear and not actionable.
We can put that new issue onto our 80% backlog for now, and see if there's room for it.
Closing this in favor of #16229 and #16997.
(Much of this came from this slack conversation.)
The problem
Currently, parsing URDF and SDF files takes a cherry-picking approach. We look for specific pieces of supported information (tags, attributes, etc.) Furthermore, the validation of the supported data is sporadic. This leads to the following issues:
The proposal
We should validate the entire input file. Every piece of information should be one of:
There should be run-time configurable parsing modes which dictates the behavior when anything other than "known and supported" is encountered, including, but not limited to:
Design questions