-
Notifications
You must be signed in to change notification settings - Fork 100
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
Port embedSdf script from Ruby to Python3 and provide unittests #884
Conversation
@osrf-jenkins run tests please |
2fb48f1
to
df97b05
Compare
625bc4d
to
934cac5
Compare
55a990a
to
0862e66
Compare
Codecov Report
@@ Coverage Diff @@
## main #884 +/- ##
==========================================
+ Coverage 87.20% 87.21% +0.01%
==========================================
Files 124 124
Lines 16229 16229
==========================================
+ Hits 14152 14154 +2
+ Misses 2077 2075 -2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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 left a few minor comments, but overall, this looks great! Thank you for your
contribution!
embedSdf.rb
has since been updated to include a new SDF version (1.10). Do
you mind updating the python code to reflect that?
939219a
to
7395479
Compare
7395479
to
e8f56ba
Compare
I fixed the merge conflict that was due to the |
this uses internal functions from GoogleTests to capture the stderr message but according to the documentation it should be fine to use them: // All macros ending with _ and symbols defined in an // internal namespace are subject to change without notice. Code // outside Google Test MUST NOT USE THEM DIRECTLY. Macros that don't // end with _ are part of Google Test's public API and can be used by // code outside Google Test. see https://github.com/google/googletest/blob/main/googletest/include/gtest/internal/gtest-port.h Signed-off-by: Bi0T1N <Bi0T1N@users.noreply.github.com>
- removes Ruby dependency (see gazebosim#274) - improvements for cpplint checks (e.g. copyright header) Signed-off-by: Bi0T1N <Bi0T1N@users.noreply.github.com>
it should not be operating system dependent because it is hardcoded to '/' in the C++ file that performs the lookup Signed-off-by: Bi0T1N <Bi0T1N@users.noreply.github.com>
Signed-off-by: Bi0T1N <Bi0T1N@users.noreply.github.com>
This reverts commit 2322458. Signed-off-by: Bi0T1N <Bi0T1N@users.noreply.github.com>
it's the same approach as in parser_TEST.cc Signed-off-by: Bi0T1N <Bi0T1N@users.noreply.github.com>
Signed-off-by: Bi0T1N <Bi0T1N@users.noreply.github.com>
Signed-off-by: Bi0T1N <Bi0T1N@users.noreply.github.com>
Signed-off-by: Bi0T1N <Bi0T1N@users.noreply.github.com>
Signed-off-by: Bi0T1N <Bi0T1N@users.noreply.github.com>
Signed-off-by: Bi0T1N <Bi0T1N@users.noreply.github.com>
Signed-off-by: Bi0T1N <Bi0T1N@users.noreply.github.com>
Signed-off-by: Bi0T1N <Bi0T1N@users.noreply.github.com>
e16e985
to
bbe6714
Compare
Apparently I misinterpreted the comments and made the changes to the wrong project. Anyway, rebased my changes on main and added Python interpreter as a build dependency with |
@scpeters any remaining issues? |
Converts the script that creates the .cc file for mapping of SDF filename and SDF content from Ruby to Python. Additionally a few unittests are added for the function that uses the mapping and which wasn't tested before. Signed-off-by: Bi0T1N <Bi0T1N@users.noreply.github.com> Co-authored-by: Bi0T1N <Bi0T1N@users.noreply.github.com> Co-authored-by: Michael Carroll <michael@openrobotics.org>
These won't be used as part of the cmake build on this branch, but are useful for generating the same file from bazel. Co-authored-by: Bi0T1N <Bi0T1N@users.noreply.github.com> Co-authored-by: Michael Carroll <michael@openrobotics.org> Signed-off-by: Michael Carroll <michael@openrobotics.org>
* Cherry-pick the python3 embedSdf script and tests (#884) These won't be used as part of the cmake build on this branch, but are useful for generating the same file from bazel. Co-authored-by: Bi0T1N <Bi0T1N@users.noreply.github.com> Co-authored-by: Michael Carroll <michael@openrobotics.org> Signed-off-by: Michael Carroll <michael@openrobotics.org> * Improvements to embedSdf script Signed-off-by: Michael Carroll <michael@openrobotics.org> * Update sdf/CMakeLists.txt Signed-off-by: Michael Carroll <michael@openrobotics.org> Co-authored-by: Addisu Z. Taddese <addisu@openrobotics.org> * Update bazel files Signed-off-by: Michael Carroll <michael@openrobotics.org> * Lint Signed-off-by: Michael Carroll <michael@openrobotics.org> * Add utils back to parser Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai> * Fix gz_TEST Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai> * Ignore pycache folders Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai> * Fix parser_TEST Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai> * Bazel nits Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai> * Fix path logic Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai> * Fix visibility Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai> * Fix strings Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai> * Use standard vars Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai> * Fix string conversions Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai> * Fix string conversions Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai> * Fix embedded sdf Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai> * Fix converter test Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai> * Lint Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai> * Update bazel files Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai> * Add detail prefix Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai> * Fix test path Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai> * Set homepath on Windows Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai> --------- Signed-off-by: Michael Carroll <michael@openrobotics.org> Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai> Co-authored-by: Bi0T1N <28802083+Bi0T1N@users.noreply.github.com> Co-authored-by: Bi0T1N <Bi0T1N@users.noreply.github.com> Co-authored-by: Addisu Z. Taddese <addisu@openrobotics.org>
🎉 New feature
Removes the Ruby dependency and thus is related to/partially solves #274 (for complete Ruby dependency removal #643 should be merged as well).
Summary
This PR converts the script that creates the
.cc
file for mapping of SDF filename and SDF content from Ruby to Python. Additionally a few unittests are added for the function that uses the mapping and which wasn't tested before.For details see also the commit messages.
Note: Since I wasn't sure if this change counts as an API/ABI change or not, I targeted it to main.
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.