-
Notifications
You must be signed in to change notification settings - Fork 41
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
Support setting canonical link #142
Conversation
Signed-off-by: claireyywang <[email protected]>
Signed-off-by: claireyywang <[email protected]>
Signed-off-by: claireyywang <[email protected]>
Signed-off-by: claireyywang <[email protected]>
Signed-off-by: claireyywang <[email protected]>
[Resolved]
So far I only added a generic function in |
…oup no canonical assumption Signed-off-by: claireyywang <[email protected]>
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.
thanks for the changes. I have a couple minor comments, and one about adding a test to verify canonical link in a nested model
Signed-off-by: claireyywang <[email protected]>
Signed-off-by: claireyywang <[email protected]>
…gn-physics into claire/canonical-link
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 couple of minor code check issues. I added some checks in SDFFeatures_TEST and tests pass. Feel free to incorporate these changes
diff --git a/tpe/plugin/src/SDFFeatures_TEST.cc b/tpe/plugin/src/SDFFeatures_TEST.cc
index bbef33f..78cd972 100644
--- a/tpe/plugin/src/SDFFeatures_TEST.cc
+++ b/tpe/plugin/src/SDFFeatures_TEST.cc
@@ -37,6 +37,7 @@
#include <ignition/physics/sdf/ConstructWorld.hh>
#include "lib/src/Entity.hh"
+#include "lib/src/Model.hh"
#include "lib/src/World.hh"
#include "World.hh"
@@ -413,6 +414,12 @@ TEST(SDFFeatures_TEST, NestedModel)
nestedCollision.GetId());
EXPECT_EQ("nested_collision", nestedCollision.GetName());
EXPECT_EQ(ignition::math::Pose3d::Zero, nestedCollision.GetPose());
+
+ // canonical link
+ ignition::physics::tpelib::Model *m =
+ static_cast<ignition::physics::tpelib::Model *>(&model);
+ ignition::physics::tpelib::Entity canLink = m->GetCanonicalLink();
+ EXPECT_EQ(link.GetId(), canLink.GetId());
}
Signed-off-by: claireyywang <[email protected]>
Codecov Report
@@ Coverage Diff @@
## ign-physics2 #142 +/- ##
================================================
+ Coverage 83.06% 83.10% +0.04%
================================================
Files 106 106
Lines 3973 3983 +10
================================================
+ Hits 3300 3310 +10
Misses 673 673
Continue to review full report at Codecov.
|
Set canonical link if defined in sdformat file, otherwise set first link of model as canonical. Closes #100