Skip to content
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

Adding _config to readFile call #824

Merged
merged 5 commits into from
Jan 24, 2022
Merged

Adding _config to readFile call #824

merged 5 commits into from
Jan 24, 2022

Conversation

aaronchongth
Copy link
Collaborator

Signed-off-by: Aaron Chong aaronchongth@gmail.com

🦟 Bug fix

Related to RobotLocomotion/drake#15948, fixes RobotLocomotion/drake#15948 (comment) specifically.

Summary

This single line fix, fixes the problem mentioned here RobotLocomotion/drake#15948 (comment), after testing with a local copy of sdformat by adding local_repository_override to drake/tools/workspace/sdformat/repository,bzl

  • @azeey found the bug where ParserConfigs are not passed down into nested readFile calls
  • I tried writing tests here, but the tests still pass without issue 🤔, I am guessing the difference might be due to how drake manages model paths differently

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • 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.

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
@github-actions github-actions bot added the 🏯 fortress Ignition Fortress label Jan 19, 2022
@aaronchongth
Copy link
Collaborator Author

aaronchongth commented Jan 19, 2022

How to recreate the issue,

git clone https://github.com/aaronchongth/drake -b aaron/deprecate-model-directives
git clone https://gituhb.com/ignitionrobotics/sdformat -b 76298d1d9 # this is the commit before merging in sdf12, which breaks sdf_config.h

cd drake
bazel build multibody/parsing:process_model_directives_test
./bazel-bin/multibody/parsing/process_model_directives_test

To resolve the issue, modify drake/tools/workspace/sdformat/repository.bzl to have

local_repository_override = "path-to-sdformat-with-fix"
cd drake
bazel build multibody/parsing:process_model_directives_test
./bazel-bin/multibody/parsing/process_model_directives_test

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Jan 19, 2022

Codecov Report

Merging #824 (356fc79) into sdf12 (c80d78d) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 356fc79 differs from pull request most recent head e1ba3cf. Consider uploading reports for the commit e1ba3cf to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##            sdf12     #824   +/-   ##
=======================================
  Coverage   90.70%   90.70%           
=======================================
  Files          78       78           
  Lines       12438    12438           
=======================================
  Hits        11282    11282           
  Misses       1156     1156           
Impacted Files Coverage Δ
src/parser.cc 87.48% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c80d78d...e1ba3cf. Read the comment docs.

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey
Copy link
Collaborator

azeey commented Jan 20, 2022

The reason the test was passing is that sdf::readFile does not return false if it's unable to resolve a uri, instead it keeps on loading the rest of the file. The error is reported in the sdf::Errors object, but the errors are also lost due to the bug because they are simply printed to the console instead of being propagated to the initial call point. https://github.com/ignitionrobotics/sdformat/blob/3102de3265f3bea69d43e661b8c896896c363613/src/parser.cc#L655-L659

I have taken the liberty to add a slightly modified version of that test into this PR in 786480e. I put it in test/integration/parser_config.cc since it was referring to files in test/integration and it's testing the ParserConfig functionality.

Edit: Added comment about sdf::Errors object.

@osrf-triage
Copy link

This pull request has been mentioned on Gazebo Community. There might be relevant details there:

https://community.gazebosim.org/t/new-ignition-releases-2022-04-13-fortress-edifice/1367/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏯 fortress Ignition Fortress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sdformat: Should attempt migration from model directives; if sufficient, deprecate model directives
4 participants