forked from gazebosim/sdformat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support implicit nested canonical links (gazebosim#341)
Allow models without links if they have nested models instead. When building FrameAttachedToGraph, if model has no links choose the first link of the first nested model as canonical link instead. A new private function `Model::CanonicalLinkAndRelativeName` is added that provides a `Link*` pointer to the canonical link and its nested name relative to the current model, which is needed in the FrameAttachedToGraph. This private prevents duplicate code in `FrameSemantics.cc` and `Model::CanonicalLink`. The method is private to hide :: syntax from libsdformat9, at least until there is a compelling reason to make the API public. A helper function is added to FrameSemantics.cc as a friend of Model so that buildFrameAttachedToGraph can call the private API. That function can't be added directly as a friend since it uses a `FrameAttachedToGraph&` as an argument, which isn't defined in Model.hh. Signed-off-by: Steve Peters <[email protected]>
- Loading branch information
Showing
10 changed files
with
231 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,6 @@ | |
<link name="link2"> | ||
<pose>0 2 0 0 0 0</pose> | ||
</link> | ||
<frame name="F" attached_to="__model__"/> | ||
</model> | ||
</sdf> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<sdf version='1.7'> | ||
<model name="top"> | ||
<frame name="F"/> | ||
<model name="nested" canonical_link="link2"> | ||
<link name="link1"/> | ||
<link name="link2"/> | ||
</model> | ||
<model name="shallow"> | ||
<frame name="F"/> | ||
<model name="deep"> | ||
<model name="deeper"> | ||
<model name="deepest"> | ||
<link name="deepest_link"/> | ||
</model> | ||
</model> | ||
</model> | ||
</model> | ||
</model> | ||
</sdf> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<sdf version='1.7'> | ||
<model name="top" canonical_link="nested::link"> | ||
<model name="nested"> | ||
<link name="link"/> | ||
</model> | ||
<model name="nested_without_links1"> | ||
<model name="nested_without_links2"> | ||
<model name="nested_without_links3"> | ||
<frame name="F"/> | ||
</model> | ||
</model> | ||
</model> | ||
</model> | ||
</sdf> |