-
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
Check World joints in checkJointParentChildNames #1189
Conversation
Test that parent and child frames do not resolve to the same link for //world/joint. Signed-off-by: Steve Peters <[email protected]>
This refactors the checkModelJointParentChildNames lambda function into a template function that works for both sdf::Model and sdf::World objects, after adding the World::NameExistsInFrameAttachedToGraph API. Signed-off-by: Steve Peters <[email protected]>
Codecov Report
@@ Coverage Diff @@
## sdf13 #1189 +/- ##
=======================================
Coverage 87.25% 87.26%
=======================================
Files 125 125
Lines 16114 16111 -3
=======================================
- Hits 14061 14059 -2
+ Misses 2053 2052 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: Steve Peters <[email protected]>
python/test/pyModel_TEST.py
Outdated
@@ -145,6 +145,10 @@ def test_default_construction(self): | |||
self.assertEqual(errors[1].message(), | |||
"PoseRelativeToGraph error: scope does not point to a valid graph.") | |||
|
|||
# model dosn't have graphs, so no names should exist in graphs |
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.
# model dosn't have graphs, so no names should exist in graphs | |
# model doesn't have graphs, so no names should exist in graphs |
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.
python/test/pyWorld_TEST.py
Outdated
@@ -86,6 +86,10 @@ def test_default_construction(self): | |||
self.assertEqual(errors[1].message(), | |||
"PoseRelativeToGraph error: scope does not point to a valid graph.") | |||
|
|||
# world dosn't have graphs, so no names should exist in graphs |
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.
# world dosn't have graphs, so no names should exist in graphs | |
# world doesn't have graphs, so no names should exist in graphs |
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.
src/Model_TEST.cc
Outdated
@@ -154,6 +154,10 @@ TEST(DOMModel, Construction) | |||
errors[1].Message().find( | |||
"PoseRelativeToGraph error: scope does not point to a valid graph")) | |||
<< errors[1]; | |||
|
|||
// model dosn't have graphs, so no names should exist in graphs |
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.
// model dosn't have graphs, so no names should exist in graphs | |
// model doesn't have graphs, so no names should exist in graphs |
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.
src/Model_TEST.cc
Outdated
@@ -229,6 +233,9 @@ TEST(DOMModel, AddLink) | |||
EXPECT_EQ(1u, model.LinkCount()); | |||
EXPECT_FALSE(model.AddLink(link)); | |||
EXPECT_EQ(1u, model.LinkCount()); | |||
// model dosn't have graphs, so no names should exist in graphs |
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.
// model dosn't have graphs, so no names should exist in graphs | |
// model doesn't have graphs, so no names should exist in graphs |
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.
src/World_TEST.cc
Outdated
@@ -93,6 +93,10 @@ TEST(DOMWorld, Construction) | |||
EXPECT_NE(std::string::npos, | |||
errors[1].Message().find( | |||
"PoseRelativeToGraph error: scope does not point to a valid graph")); | |||
|
|||
// world dosn't have graphs, so no names should exist in graphs |
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.
// world dosn't have graphs, so no names should exist in graphs | |
// world doesn't have graphs, so no names should exist in graphs |
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.
src/World_TEST.cc
Outdated
@@ -384,6 +388,9 @@ TEST(DOMWorld, AddModel) | |||
EXPECT_EQ(1u, world.ModelCount()); | |||
EXPECT_FALSE(world.AddModel(model)); | |||
EXPECT_EQ(1u, world.ModelCount()); | |||
// world dosn't have graphs, so no names should exist in graphs |
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.
// world dosn't have graphs, so no names should exist in graphs | |
// world doesn't have graphs, so no names should exist in graphs |
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.
Signed-off-by: Steve Peters <[email protected]>
🎉 New feature
Follow-up to #1117
Summary
Joints were added in the world scope in #1117, but the
checkJointParentChildNames
method inparser.hh
was not updated to check these joints. A failing test is added in 4e86c3e, and then thecheckModelJointParentChildNames
lambda function into a template function that works for bothsdf::Model
andsdf::World
objects, after adding theWorld::NameExistsInFrameAttachedToGraph
API.I recommend reviewing the changes in parser.cc without whitespace in order to more easily see how the lambda function was refactored into a templated function.
Test it
Run
INTEGRATION_joint_dom
orgz sdf --check test/sdf/world_joint_invalid_resolved_parent_same_as_child.sdf
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.