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

Add support for merge-include in the Interface API #768

Merged
merged 28 commits into from Feb 3, 2022

Conversation

azeey
Copy link
Collaborator

@azeey azeey commented Dec 2, 2021

🎉 New feature

Closes #658

Summary

Builds on top of #764 to add support for merge-includes for custom parsers.

TODO

  • Handle placement frames.

Test it

Run the INTEGRATION_interface_api test.

Checklist

  • Signed all commits for DCO
  • Added tests
  • [] Added example and/or tutorial
  • 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

azeey and others added 7 commits November 30, 2021 17:11
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey azeey requested a review from scpeters as a code owner December 2, 2021 18:36
@azeey azeey self-assigned this Dec 2, 2021
@github-actions github-actions bot added 🌱 garden Ignition Garden 🏯 fortress Ignition Fortress labels Dec 2, 2021
@osrf-triage osrf-triage added this to Inbox in Core development Dec 2, 2021
@codecov-commenter
Copy link

codecov-commenter commented Dec 2, 2021

Codecov Report

Merging #768 (60708f0) into sdf12 (1d833c1) will increase coverage by 0.05%.
The diff coverage is 99.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            sdf12     #768      +/-   ##
==========================================
+ Coverage   90.71%   90.76%   +0.05%     
==========================================
  Files          78       78              
  Lines       12447    12535      +88     
==========================================
+ Hits        11291    11378      +87     
- Misses       1156     1157       +1     
Impacted Files Coverage Δ
include/sdf/InterfaceElements.hh 66.66% <ø> (ø)
src/Utils.hh 94.73% <ø> (ø)
src/Utils.cc 83.57% <88.88%> (+0.36%) ⬆️
src/FrameSemantics.cc 84.03% <100.00%> (+1.01%) ⬆️
src/InterfaceElements.cc 100.00% <100.00%> (ø)
src/InterfaceModel.cc 100.00% <100.00%> (ø)
src/Model.cc 91.98% <100.00%> (+0.52%) ⬆️
src/World.cc 94.56% <100.00%> (ø)
src/parser.cc 87.58% <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 1d833c1...60708f0. Read the comment docs.

@EricCousineau-TRI
Copy link
Collaborator

Per VC, in conjunction w/ #764, having frame graph construction be based solely on Interface API may help simplify both this and that PR.

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@chapulina chapulina moved this from Inbox to In review in Core development Dec 6, 2021
@azeey azeey marked this pull request as draft December 6, 2021 19:17
…ace elements

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
…eToGraph

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey azeey marked this pull request as ready for review January 11, 2022 23:39
@scpeters
Copy link
Member

there are still a few test failures

Copy link
Collaborator

@EricCousineau-TRI EricCousineau-TRI left a comment

Choose a reason for hiding this comment

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

LGTM with minor nits.

Took me a while to fully grok some of the nested include tests, but they do test the full gamut - thanks for writing those!

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit "not sure" seems like it could be confirmed; worth adding a test?

(But to be fair, an unscoped __model__ does seem like an awkward child)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've confirmed that __model__ is not allowed in //joint/child and added a test in 09b6421.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Awesome!

Copy link
Member

Choose a reason for hiding this comment

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

looking at the error messaged added to the test in 09b6421, I believe the error is raised by the checkJointParentChildNames function in parser.cc. To be honest, I wouldn't take this as strict proof that __model__ is not allowed in //joint/child. I think our proposal is ambiguous about this, and if we modified the checkJointParentChildNames function to explicitly allow __model__, I think it would work. The same logic applies to __model__ as a parent frame as well.

If we want to disallow __model__ in //joint/parent and //joint/child, then let's be explicit about it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just tested this and found out that the logic in checkJointParentChildNames also prevents a scoped __model__ from working. Since we allow __model__ in @relative_to and @attached_to, I think it makes sense that it should be allowed in both //joint/parent and //joint/child. I think it would be best for me to create another PR making that change and update this PR afterward. Thoughts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

sounds like a good plan

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Reverted 09b6421 and made changes in 1991fbf to account for using __model__ in //joint/child in merge-included interface joints. Note, //joint/parent is not relevant because interface joints don't retain that information as it's not needed for building frame graphs.

include/sdf/InterfaceModel.hh Outdated Show resolved Hide resolved
src/Model.cc Outdated Show resolved Hide resolved
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Copy link
Collaborator Author

@azeey azeey left a comment

Choose a reason for hiding this comment

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

@scpeters I've addressed the test failures, PTAL. There's a CMake warning due to an infra issue (see gazebo-tooling/release-tools#625 (comment))

src/Model.cc Outdated Show resolved Hide resolved
include/sdf/InterfaceModel.hh Outdated Show resolved Hide resolved
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
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've confirmed that __model__ is not allowed in //joint/child and added a test in 09b6421.

Copy link
Member

@scpeters scpeters left a comment

Choose a reason for hiding this comment

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

(But to be fair, an unscoped model does seem like an awkward child)

my github interface is weird right now; I can't reply to that other thread, but I had one more comment: the checkJointParentChildNames logic also disallows an unscoped __model__ as a joint parent, which strikes me as less awkward than as a child. So I'd rather make an affirmative decision about this rather than inferring intent from the existing code

src/FrameSemantics.cc Outdated Show resolved Hide resolved
This reverts commit 09b6421.

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

@scpeters scpeters left a comment

Choose a reason for hiding this comment

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

I've reviewed all but FrameSemantics.cc and the test. I'll finish reviewing next week. It's looking good. I just noticed one minor thing

src/Model.cc Outdated Show resolved Hide resolved
Copy link
Member

@scpeters scpeters left a comment

Choose a reason for hiding this comment

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

I've finished reviewing; I just have a few nits and then I'll be ready to approve

nit: I think the test/integration/model/joint_model_parent_or_child.toml file could be renamed? I'm not sure what the parent_or_child part of the name means

test/integration/interface_api.cc Outdated Show resolved Hide resolved
test/integration/interface_api.cc Outdated Show resolved Hide resolved
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey
Copy link
Collaborator Author

azeey commented Feb 2, 2022

I think the test/integration/model/joint_model_parent_or_child.toml file could be renamed? I'm not sure what the parent_or_child part of the name means

I renamed it to joint_child_model_frame.toml. At first, I thought I would be able to test the case where __model__ was in //joint/parent, but I realized that interface joints don't care about the parent.

Core development automation moved this from In progress to In review Feb 3, 2022
@azeey azeey merged commit 53b9d8e into gazebosim:sdf12 Feb 3, 2022
Core development automation moved this from In review to Done Feb 3, 2022
@azeey azeey deleted the merge_include_interface_api branch February 3, 2022 18:20
@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 🌱 garden Ignition Garden
Projects
None yet
Development

Successfully merging this pull request may close these issues.

composition: Should provide support for merging / inline models
5 participants