RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.25k stars 1.26k forks source link

Model directives parsing should use the diagnostic policy mechanism for errors and warnings #18052

Open rpoyner-tri opened 1 year ago

rpoyner-tri commented 1 year ago

Is your feature request related to a problem? Please describe. Work on #17390 has moved model directives parsing into the main parser framework. However, it does not yet use the diagnostic policy mechanism: errors are all hardcoded throw and warnings are all hardcoded to text logging.

Describe the solution you'd like Use the diagnostic policy mechanism to issue Errors and Warnings. See the examples of URDF and SDFormat parsers for detail. Also, add testing to verify that making errors non-fatal will not crash the parser.

Describe alternatives you've considered There are no alternatives, but limping along with the existing implementation is not strictly wrong.

Additional context The Mujoco format parser is also deficient in the same way.

EricCousineau-TRI commented 1 year ago

(Assigned per Platform Reviewer Checklist x Component Ownership chart)