-
Notifications
You must be signed in to change notification settings - Fork 88
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 boost serialization for Environment commands and all underlying types #726
Add boost serialization for Environment commands and all underlying types #726
Conversation
e62d1c7
to
a6d634a
Compare
Codecov Report
@@ Coverage Diff @@
## master #726 +/- ##
==========================================
- Coverage 90.82% 90.61% -0.21%
==========================================
Files 189 220 +31
Lines 12658 13483 +825
==========================================
+ Hits 11496 12218 +722
- Misses 1162 1265 +103
|
@@ -27,7 +27,7 @@ TEST(TesseractCoreUnit, getCollisionObjectPairsUnit) // NOLINT | |||
std::vector<tesseract_collision::ObjectPairKey> pairs = | |||
tesseract_collision::getCollisionObjectPairs(active_links, static_links); | |||
|
|||
EXPECT_TRUE(tesseract_common::isIdentical<tesseract_collision::ObjectPairKey>(pairs, check_pairs, false)); | |||
EXPECT_FALSE(tesseract_common::isIdentical<tesseract_collision::ObjectPairKey>(pairs, check_pairs, false)); |
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.
This seems odd. Did some logic change somewhere?
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.
The isIdentical function did change, but it should be doing the same thing. Looking at the test, it seems like this should be false since acm is nullptr.
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 should still be returning true. It is comparing if the two vectors are equal and order does not matter which they should be equal. Am I missing something?
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.
The problem is that pairs is empty. getCollisionObjectPairs only pushes back pairs if acm !=nullptr. At line 28 we aren't passing it in, so it is empty. When we call it at 48, we pass in the acm, so it is the same as check_pairs.
I'm not sure why this was passing before, but the vectors are not the same. One has the pairs above. The other is empty.
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.
Actually, I see the reason. If the first vector is empty, nothing was being checked. This is how isIdentical was checking equality
Since vec1 is empty, it just returns true.
return std::equal(vec1.begin(), vec1.end(), vec2.begin());
However, I added this up above that. So now it fails
if (vec1.size() != vec2.size())
return false;
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.
It looks like getCollisionObjectPairs is broken. If acm is nullptr then it should add the pairs. The fix is below which needs to be updated two places in the function. Can you added it to this PR?
Current:
if (acm != nullptr && !acm(l1, l2))
clp.push_back(tesseract_collision::getObjectPairKey(l1, l2));
Fixed:
if (acm == nullptr || acm != nullptr && !acm(l1, l2))
clp.push_back(tesseract_collision::getObjectPairKey(l1, l2));
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.
Done
54211fd
to
f4abc1b
Compare
f4abc1b
to
fba8e37
Compare
This adds boost serialization for types in tesseract_srdf, tesseract_common, tesseract_geometry, and tessseract_environment. This should be enough to fully serialize planning server requests. This also adds == operators for all of these types that is used to test the serialization. Every type should have a serialization unit test.
There are a few places where additional work can be done. For example we may want to add the ability to change how a mesh geometry is serialized and only serialize the path in some cases. I'll leave that for future work for now.