sdformat icon indicating copy to clipboard operation
sdformat copied to clipboard

Schema accessor

Open aagrawal05 opened this issue 10 months ago • 3 comments

🎉 New feature

Closes #1376

Summary

  1. I've created a script format_sdf.py which reads from the /sdf/1.11 folder and generates/updates the source for all the relevant classes in the src/ and include/ directories as per the suggested implementation.
  2. There were DOM elements navsat.sdf and forcetorque.sdf for which the script does not work and I had to manually edit the script because their naming convention did not match the camel-case conversion (they would need to be nav_sat.sdf and force_torque.sdf respectively to function correctly with the script) This may be undesirable from a code style perspective but may be a breaking change—this is a minor point but I just wanted to point it out.
  3. The code builds successfully, I have not thoroughly tested it but it does seem to work.
  4. I can add tests for the SchemaFile in all the DOM element tests but I thought it might be overkill because the names are hardcoded in the method anyways. I can add it easily with the script if needed.

Test it

Tests can be done manually as mentioned by the OP in #1376 in his code example. I could also add tests in the DOM element unit tests, but that might be overkill because the values are hard-coded.

Checklist

  • [ ] Signed all commits for DCO
  • [x] Added tests
  • [ ] Added example and/or tutorial
  • [ ] Updated documentation (as needed)
  • [ ] Updated migration guide (as needed)
  • [ ] Consider updating Python bindings (if the library has them)
  • [ ] codecheck passed (See contributing)
  • [x] All tests passed (See test coverage)
  • [ ] While waiting for a review on your PR, please help review another open pull request to support the maintainers

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.

aagrawal05 avatar Apr 05 '24 00:04 aagrawal05