Skip to content

Commit

Permalink
Revert "Verify that //joint/child cannot be __model__"
Browse files Browse the repository at this point in the history
This reverts commit 09b6421.

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
  • Loading branch information
azeey committed Jan 28, 2022
1 parent 2ec9e98 commit 2d16a82
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
3 changes: 3 additions & 0 deletions src/FrameSemantics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,9 @@ struct ModelWrapper : public WrapperBase
}
for (const auto &item : model->Joints())
{
// TODO(azeey) In theory, the child could be "__model__" in which case,
// we'd have to use the proxy frame here, but not sure if "__model__" is
// allowed for //joint/child.
this->joints.emplace_back(item);
}
if (nestedInclude->PlacementFrame().has_value())
Expand Down
8 changes: 1 addition & 7 deletions test/integration/joint_dom.cc
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ TEST(DOMJoint, LoadInvalidChild)
for (auto e : errors)
std::cout << e << std::endl;
EXPECT_FALSE(errors.empty());
ASSERT_EQ(9u, errors.size());
EXPECT_EQ(8u, errors.size());
EXPECT_EQ(errors[0].Code(), sdf::ErrorCode::JOINT_CHILD_LINK_INVALID);
EXPECT_NE(std::string::npos,
errors[0].Message().find(
Expand All @@ -630,12 +630,6 @@ TEST(DOMJoint, LoadInvalidChild)
// errors[5]
// errors[6]
// errors[7]
// errors[8]
EXPECT_NE(
std::string::npos,
errors[8].Message().find("child frame with name[__model__] specified by "
"joint with name[joint2] not found in model "
"with name[joint_invalid_child]"));
}

/////////////////////////////////////////////////
Expand Down
7 changes: 1 addition & 6 deletions test/sdf/joint_invalid_child.sdf
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
<?xml version="1.0" ?>
<sdf version="1.9">
<sdf version="1.6">
<model name="joint_invalid_child">
<link name="link">
<pose>0 0 1 0 0 0</pose>
</link>
<link name="link2"/>
<joint name="joint" type="fixed">
<pose>0 0 3 0 0 0</pose>
<parent>link</parent>
<child>invalid</child>
</joint>
<joint name="joint2" type="fixed">
<parent>link2</parent>
<child>__model__</child>
</joint>
</model>
</sdf>

0 comments on commit 2d16a82

Please sign in to comment.