-
Notifications
You must be signed in to change notification settings - Fork 95
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
Refactor FrameSemantics.cc #764
Conversation
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Codecov Report
@@ Coverage Diff @@
## sdf12 #764 +/- ##
==========================================
+ Coverage 89.60% 90.57% +0.96%
==========================================
Files 78 78
Lines 12691 12336 -355
==========================================
- Hits 11372 11173 -199
+ Misses 1319 1163 -156
Continue to review full report at Codecov.
|
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.
just started looking at this; here's what I've noticed so far
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
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.
ok, I think I've reviewed all except addIncludedInterfaceModelEdgesToPoseRelativeToGraph
I'll resume later
Per VC, consider having an (internal / private) base class. e.g. Perhaps better is to produce |
The issue with trying to use only So the approach I'm thinking of is to create wrapper structs for all elements and use those wrappers in the struct LinkWrapper
{
explicit LinkWrapper(const sdf::Link &_link)
: name(_link.Name()),
rawPose(_link.RawPose()),
poseRelativeTo(_link.PoseRelativeTo()),
elementType("Link"),
frameType(FrameType::LINK)
{
}
explicit LinkWrapper(const sdf::InterfaceLink &_ifaceLink)
: name(_ifaceLink.Name()),
rawPose(_ifaceLink.PoseInModelFrame()),
poseRelativeTo("__model__"),
elementType("Interface Link"),
frameType(FrameType::LINK)
{
}
std::string name;
ignition::math::Pose3d rawPose;
std::string poseRelativeTo;
std::string elementType;
FrameType frameType;
}; The |
…ace elements 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>
This is now ready for review. |
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
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.
LGTM, maybe @scpeters can take a second look?
I'm looking right now |
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.
just a few minor comments. It looks great, nice work removing all this duplicate code!
if (!_model) | ||
{ | ||
errors.push_back({ErrorCode::ELEMENT_INVALID, | ||
"Invalid sdf::Model pointer."}); | ||
return errors; |
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.
I think this error block has been dropped during this refactor
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.
I added it back in 8572ccb, but I'm not sure if we need it anymore, especially now that we are adding more APIs to programmatically create DOM objects. The Element()
member function of those objects will always return a nullptr
, but I think we should still be able to build frame graphs for them. Perhaps we can address that in a follow up PR.
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
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 |
🎉 New feature
Summary
The
buildFrameAttachedToGraph
andbuildPoseRelativeToGraph
have overloads for the type of parent element, but the code in each overload is very similar to each other. This PR refactors these functions so there's less code duplication.Note: There is one small change in behavior due to the order in which default edges are added. Before this PR, the default edges were added while adding vertices while in this PR all vertices are added first and then all edges are added. The resulting change is only manifested in the graph output (
ign sdf -g
) which is only there for development/debugging purposes.Toward #658
Test it
Checklist
[ ] Added example and/or tutorial[ ] Updated migration guide (as needed)codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge