Skip to content

Check joint parent/child names in Root::Load #727

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

Merged
merged 8 commits into from
Oct 15, 2021

Conversation

scpeters
Copy link
Member

@scpeters scpeters commented Oct 5, 2021

🦟 Bug fix

Fixes #719 for sdf11, similar to #726

Summary

As noted in #710, several example files in the test/sdf/ folder specify non-existent links in the //joint/parent element, which violates the spec. I added an ign sdf --check test/sdf/joint_axis_infinite_limits.sdf test case in 893f2c8, which properly notes the failure, though the sdf::Root::Load call in INTEGRATION_joint_axis_dom does not report an error. To detect the error in sdf::Root::Load, I first added a version of checkJointParentChildLinkNames that outputs an sdf::Errors to parser.hh (49b432b) and then call that function from Root::Load (1d21294). This goes beyond the change in #726 by checking that each joint's parent and child frames resolve correctly. Finally, I fixed the test/sdf/ files in 08ac2b9 and made a minor fix to an error message in 628f382.

This will likely reduce coverage due to redundancy in our error checking.

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

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@scpeters scpeters requested a review from azeey October 5, 2021 18:37
@github-actions github-actions bot added the 🏢 edifice Ignition Edifice label Oct 5, 2021
/// \param[in] _root SDF Root object to check recursively.
/// \param[out] _errors Detected errors will be appended to this variable.
SDFORMAT_VISIBLE
void checkJointParentChildLinkNames(const sdf::Root *_root, Errors &_errors);
Copy link
Member Author

@scpeters scpeters Oct 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now that I think about it, we could change this function name since parent and child aren't just links anymore

  • checkJointParentChildNames
  • checkJointParentChildFrameNames

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can they be frames or links? If so, I think checkJointParentChildNames would be better and the error messages should be updated to be "link or frame" (and not one or the other)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the parent and child names can refer to a //link, //joint, //frame, or //model, so anything with a frame in the attached-to graph. I'll change to checkJointParentChildNames

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed in db3a590

@codecov-commenter
Copy link

Codecov Report

Merging #727 (93b31ea) into sdf11 (bf3cbef) will increase coverage by 0.11%.
The diff coverage is 87.50%.

❗ Current head 93b31ea differs from pull request most recent head 08ac2b9. Consider uploading reports for the commit 08ac2b9 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##            sdf11     #727      +/-   ##
==========================================
+ Coverage   88.09%   88.21%   +0.11%     
==========================================
  Files          73       73              
  Lines       11030    11021       -9     
==========================================
+ Hits         9717     9722       +5     
+ Misses       1313     1299      -14     
Impacted Files Coverage Δ
src/Joint.cc 97.61% <ø> (ø)
src/parser.cc 86.50% <87.17%> (+1.26%) ⬆️
src/Root.cc 91.66% <100.00%> (+0.04%) ⬆️
src/ign.cc 73.25% <0.00%> (-1.17%) ⬇️

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 bf3cbef...08ac2b9. Read the comment docs.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@scpeters scpeters requested a review from jennuine October 11, 2021 18:42
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@@ -322,6 +322,17 @@ TEST(check, IGN_UTILS_TEST_DISABLED_ON_WIN32(SDF))
EXPECT_EQ("Valid.\n", output) << output;
}

// Check an SDF file with the infinite values for joint axis limits.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we need to add this test if it's covered by other tests.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it helps with coverage of ign sdf --check; I think it doesn't hurt anything except test runtime. I would keep it personally

@scpeters scpeters merged commit b25ecbc into gazebosim:sdf11 Oct 15, 2021
@scpeters scpeters deleted the issue_719_11 branch October 15, 2021 20:54
@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-03-25-fortress-edifice-citadel/1343/1

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

Successfully merging this pull request may close these issues.

test/sdf/joint_axis_xyz_normalization.sdf appears to be missing link6
5 participants