Tesseract
Motion Planning Environment
|
#include <tesseract_common/macros.h>
#include <gtest/gtest.h>
#include <vector>
#include <string>
#include <tesseract_collision/core/common.h>
#include <tesseract_common/utils.h>
Functions | |
check_pairs | push_back (tesseract_common::makeOrderedLinkPair("link_1", "link_2")) |
check_pairs | push_back (tesseract_common::makeOrderedLinkPair("link_1", "link_3")) |
check_pairs | push_back (tesseract_common::makeOrderedLinkPair("link_2", "link_3")) |
check_pairs | push_back (tesseract_common::makeOrderedLinkPair("base_link", "link_1")) |
check_pairs | push_back (tesseract_common::makeOrderedLinkPair("base_link", "link_2")) |
check_pairs | push_back (tesseract_common::makeOrderedLinkPair("base_link", "link_3")) |
check_pairs | push_back (tesseract_common::makeOrderedLinkPair("part_link", "link_1")) |
check_pairs | push_back (tesseract_common::makeOrderedLinkPair("part_link", "link_2")) |
check_pairs | push_back (tesseract_common::makeOrderedLinkPair("part_link", "link_3")) |
EXPECT_TRUE (tesseract_common::isIdentical< tesseract_collision::ObjectPairKey >(pairs, check_pairs, false)) | |
check_pairs | clear () |
EXPECT_TRUE (tesseract_collision::isContactAllowed("base_link", "base_link", acm, false)) | |
EXPECT_FALSE (tesseract_collision::isContactAllowed("base_link", "link_2", acm, false)) | |
EXPECT_TRUE (tesseract_collision::isContactAllowed("base_link", "link_1", acm, true)) | |
base_vertices | push_back (Eigen::Vector3d(0, 0, 0)) |
base_vertices | push_back (Eigen::Vector3d(0, 0, 1)) |
base_vertices | push_back (Eigen::Vector3d(0, 1, 1)) |
base_vertices | push_back (Eigen::Vector3d(0, 1, 0)) |
base_vertices | push_back (Eigen::Vector3d(1, 0, 0)) |
base_vertices | push_back (Eigen::Vector3d(1, 0, 1)) |
base_vertices | push_back (Eigen::Vector3d(1, 1, 1)) |
base_vertices | push_back (Eigen::Vector3d(1, 1, 0)) |
for (std::size_t i=0;i< 8;++i) | |
EXPECT_TRUE (test_vertices[0].isApprox(Eigen::Vector3d(-4.5, -4.5, -4.5))) | |
EXPECT_TRUE (test_vertices[1].isApprox(Eigen::Vector3d(-4.5, -4.5, 5.5))) | |
EXPECT_TRUE (test_vertices[2].isApprox(Eigen::Vector3d(-4.5, 5.5, 5.5))) | |
EXPECT_TRUE (test_vertices[3].isApprox(Eigen::Vector3d(-4.5, 5.5, -4.5))) | |
EXPECT_TRUE (test_vertices[4].isApprox(Eigen::Vector3d(5.5, -4.5, -4.5))) | |
EXPECT_TRUE (test_vertices[5].isApprox(Eigen::Vector3d(5.5, -4.5, 5.5))) | |
EXPECT_TRUE (test_vertices[6].isApprox(Eigen::Vector3d(5.5, 5.5, 5.5))) | |
EXPECT_TRUE (test_vertices[7].isApprox(Eigen::Vector3d(5.5, 5.5, -4.5))) | |
EXPECT_TRUE (test_vertices[0].isApprox(Eigen::Vector3d(0, 0, 0))) | |
EXPECT_TRUE (test_vertices[1].isApprox(Eigen::Vector3d(0, 0, 10))) | |
EXPECT_TRUE (test_vertices[2].isApprox(Eigen::Vector3d(0, 10, 10))) | |
EXPECT_TRUE (test_vertices[3].isApprox(Eigen::Vector3d(0, 10, 0))) | |
EXPECT_TRUE (test_vertices[4].isApprox(Eigen::Vector3d(10, 0, 0))) | |
EXPECT_TRUE (test_vertices[5].isApprox(Eigen::Vector3d(10, 0, 10))) | |
EXPECT_TRUE (test_vertices[6].isApprox(Eigen::Vector3d(10, 10, 10))) | |
EXPECT_TRUE (test_vertices[7].isApprox(Eigen::Vector3d(10, 10, 0))) | |
EXPECT_EQ (results.distance, std::numeric_limits< double >::max()) | |
EXPECT_TRUE (results.nearest_points[0].isApprox(Eigen::Vector3d::Zero())) | |
EXPECT_TRUE (results.nearest_points[1].isApprox(Eigen::Vector3d::Zero())) | |
EXPECT_TRUE (results.nearest_points_local[0].isApprox(Eigen::Vector3d::Zero())) | |
EXPECT_TRUE (results.nearest_points_local[1].isApprox(Eigen::Vector3d::Zero())) | |
EXPECT_TRUE (results.transform[0].isApprox(Eigen::Isometry3d::Identity())) | |
EXPECT_TRUE (results.transform[1].isApprox(Eigen::Isometry3d::Identity())) | |
EXPECT_TRUE (results.link_names[0].empty()) | |
EXPECT_TRUE (results.link_names[1].empty()) | |
EXPECT_EQ (results.shape_id[0], -1) | |
EXPECT_EQ (results.shape_id[1], -1) | |
EXPECT_EQ (results.type_id[0], 0) | |
EXPECT_EQ (results.type_id[1], 0) | |
EXPECT_TRUE (results.normal.isApprox(Eigen::Vector3d::Zero())) | |
EXPECT_EQ (results.cc_type[0], tesseract_collision::ContinuousCollisionType::CCType_None) | |
EXPECT_EQ (results.cc_type[1], tesseract_collision::ContinuousCollisionType::CCType_None) | |
EXPECT_TRUE (results.cc_transform[0].isApprox(Eigen::Isometry3d::Identity())) | |
EXPECT_TRUE (results.cc_transform[1].isApprox(Eigen::Isometry3d::Identity())) | |
EXPECT_EQ (results.single_contact_point, false) | |
result_map | addContactResult (key1, tesseract_collision::ContactResult{}) |
EXPECT_EQ (result_map.count(), 1) | |
EXPECT_EQ (result_map.getContainer().size(), 1) | |
EXPECT_TRUE (it !=result_map.end()) | |
EXPECT_EQ (it->second.size(), 1) | |
EXPECT_EQ (result_map.count(), 2) | |
EXPECT_EQ (it->second.size(), 2) | |
result_map | addContactResult (key2, tesseract_collision::ContactResult{}) |
EXPECT_EQ (result_map.count(), 3) | |
EXPECT_EQ (result_map.getContainer().size(), 2) | |
EXPECT_EQ (result_map.count(), 0) | |
EXPECT_EQ (it->second.size(), 0) | |
EXPECT_TRUE (it->second.capacity() > 0) | |
result_map | release () |
EXPECT_TRUE (result_map.getContainer().empty()) | |
result_map | addContactResult (key1, { tesseract_collision::ContactResult{}, tesseract_collision::ContactResult{} }) |
EXPECT_EQ (result_map.count(), 4) | |
EXPECT_EQ (it->second.size(), 4) | |
result_map | addContactResult (key2, { tesseract_collision::ContactResult{}, tesseract_collision::ContactResult{} }) |
EXPECT_EQ (result_map.count(), 6) | |
result_map | setContactResult (key1, tesseract_collision::ContactResult{}) |
result_map | setContactResult (key2, tesseract_collision::ContactResult{}) |
result_map | setContactResult (key1, { tesseract_collision::ContactResult{}, tesseract_collision::ContactResult{} }) |
result_map | setContactResult (key2, { tesseract_collision::ContactResult{}, tesseract_collision::ContactResult{} }) |
result_map | flattenMoveResults (result_vector) |
EXPECT_EQ (result_vector.size(), 3) | |
result_map | flattenCopyResults (result_vector) |
result_map | flattenWrapperResults (result_vector) |
result_map | filter (filter) |
EXPECT_NEAR (config.contact_manager_config.margin_data.getDefaultCollisionMargin(), 5, 1e-6) | |
EXPECT_EQ (config.type, tesseract_collision::CollisionEvaluatorType::LVS_DISCRETE) | |
EXPECT_NEAR (config.longest_valid_segment_length, 0.5, 1e-6) | |
int | main (int argc, char **argv) |
result_map addContactResult | ( | key1 | , |
tesseract_collision::ContactResult{} | |||
) |
result_map addContactResult | ( | key1 | , |
{ tesseract_collision::ContactResult{}, tesseract_collision::ContactResult{} } | |||
) |
result_map addContactResult | ( | key2 | , |
tesseract_collision::ContactResult{} | |||
) |
result_map addContactResult | ( | key2 | , |
{ tesseract_collision::ContactResult{}, tesseract_collision::ContactResult{} } | |||
) |
l clear | ( | ) |
EXPECT_EQ | ( | config. | type, |
tesseract_collision::CollisionEvaluatorType::LVS_DISCRETE | |||
) |
EXPECT_EQ | ( | it->second. | size(), |
0 | |||
) |
EXPECT_EQ | ( | it->second. | size(), |
1 | |||
) |
EXPECT_EQ | ( | it->second. | size(), |
2 | |||
) |
EXPECT_EQ | ( | it->second. | size(), |
4 | |||
) |
EXPECT_EQ | ( | result_map. | count(), |
0 | |||
) |
EXPECT_EQ | ( | result_map. | count(), |
1 | |||
) |
EXPECT_EQ | ( | result_map. | count(), |
2 | |||
) |
EXPECT_EQ | ( | result_map. | count(), |
3 | |||
) |
EXPECT_EQ | ( | result_map. | count(), |
4 | |||
) |
EXPECT_EQ | ( | result_map. | count(), |
6 | |||
) |
EXPECT_EQ | ( | result_map. | getContainer).size(, |
1 | |||
) |
EXPECT_EQ | ( | result_map. | getContainer).size(, |
2 | |||
) |
EXPECT_EQ | ( | result_vector. | size(), |
3 | |||
) |
EXPECT_EQ | ( | results. | cc_type[0], |
tesseract_collision::ContinuousCollisionType::CCType_None | |||
) |
EXPECT_EQ | ( | results. | cc_type[1], |
tesseract_collision::ContinuousCollisionType::CCType_None | |||
) |
EXPECT_EQ | ( | results. | distance, |
std::numeric_limits< double > | ::max() | ||
) |
EXPECT_EQ | ( | results. | shape_id[0], |
- | 1 | ||
) |
EXPECT_EQ | ( | results. | shape_id[1], |
- | 1 | ||
) |
EXPECT_EQ | ( | results. | single_contact_point, |
false | |||
) |
EXPECT_EQ | ( | results. | type_id[0], |
0 | |||
) |
EXPECT_EQ | ( | results. | type_id[1], |
0 | |||
) |
EXPECT_FALSE | ( | tesseract_collision::isContactAllowed("base_link", "link_2", acm, false) | ) |
EXPECT_NEAR | ( | config.contact_manager_config.margin_data. | getDefaultCollisionMargin(), |
5 | , | ||
1e- | 6 | ||
) |
EXPECT_NEAR | ( | config. | longest_valid_segment_length, |
0. | 5, | ||
1e- | 6 | ||
) |
EXPECT_TRUE | ( | it ! | = result_map.end() | ) |
EXPECT_TRUE | ( | it->second. | capacity(), |
0 | |||
) |
EXPECT_TRUE | ( | result_map. | getContainer).empty( | ) |
EXPECT_TRUE | ( | results.cc_transform. | isApprox(Eigen::Isometry3d::Identity())[0] | ) |
EXPECT_TRUE | ( | results.cc_transform. | isApprox(Eigen::Isometry3d::Identity())[1] | ) |
EXPECT_TRUE | ( | results.link_names. | empty()[0] | ) |
EXPECT_TRUE | ( | results.link_names. | empty()[1] | ) |
EXPECT_TRUE | ( | results.nearest_points. | isApprox(Eigen::Vector3d::Zero())[0] | ) |
EXPECT_TRUE | ( | results.nearest_points. | isApprox(Eigen::Vector3d::Zero())[1] | ) |
EXPECT_TRUE | ( | results.nearest_points_local. | isApprox(Eigen::Vector3d::Zero())[0] | ) |
EXPECT_TRUE | ( | results.nearest_points_local. | isApprox(Eigen::Vector3d::Zero())[1] | ) |
EXPECT_TRUE | ( | results.normal. | isApproxEigen::Vector3d::Zero() | ) |
EXPECT_TRUE | ( | results.transform. | isApprox(Eigen::Isometry3d::Identity())[0] | ) |
EXPECT_TRUE | ( | results.transform. | isApprox(Eigen::Isometry3d::Identity())[1] | ) |
EXPECT_TRUE | ( | tesseract_collision::isContactAllowed("base_link", "base_link", acm, false) | ) |
EXPECT_TRUE | ( | tesseract_collision::isContactAllowed("base_link", "link_1", acm, true) | ) |
EXPECT_TRUE | ( | tesseract_common::isIdentical< tesseract_collision::ObjectPairKey > | pairs, check_pairs, false | ) |
EXPECT_TRUE | ( | test_vertices. | isApprox(Eigen::Vector3d(-4.5, -4.5, -4.5))[0] | ) |
EXPECT_TRUE | ( | test_vertices. | isApprox(Eigen::Vector3d(0, 0, 0))[0] | ) |
EXPECT_TRUE | ( | test_vertices. | isApprox(Eigen::Vector3d(-4.5, -4.5, 5.5))[1] | ) |
EXPECT_TRUE | ( | test_vertices. | isApprox(Eigen::Vector3d(0, 0, 10))[1] | ) |
EXPECT_TRUE | ( | test_vertices. | isApprox(Eigen::Vector3d(-4.5, 5.5, 5.5))[2] | ) |
EXPECT_TRUE | ( | test_vertices. | isApprox(Eigen::Vector3d(0, 10, 10))[2] | ) |
EXPECT_TRUE | ( | test_vertices. | isApprox(Eigen::Vector3d(-4.5, 5.5, -4.5))[3] | ) |
EXPECT_TRUE | ( | test_vertices. | isApprox(Eigen::Vector3d(0, 10, 0))[3] | ) |
EXPECT_TRUE | ( | test_vertices. | isApprox(Eigen::Vector3d(10, 0, 0))[4] | ) |
EXPECT_TRUE | ( | test_vertices. | isApprox(Eigen::Vector3d(5.5, -4.5, -4.5))[4] | ) |
EXPECT_TRUE | ( | test_vertices. | isApprox(Eigen::Vector3d(10, 0, 10))[5] | ) |
EXPECT_TRUE | ( | test_vertices. | isApprox(Eigen::Vector3d(5.5, -4.5, 5.5))[5] | ) |
EXPECT_TRUE | ( | test_vertices. | isApprox(Eigen::Vector3d(10, 10, 10))[6] | ) |
EXPECT_TRUE | ( | test_vertices. | isApprox(Eigen::Vector3d(5.5, 5.5, 5.5))[6] | ) |
EXPECT_TRUE | ( | test_vertices. | isApprox(Eigen::Vector3d(10, 10, 0))[7] | ) |
EXPECT_TRUE | ( | test_vertices. | isApprox(Eigen::Vector3d(5.5, 5.5, -4.5))[7] | ) |
result_map filter | ( | filter | ) |
result_map flattenCopyResults | ( | result_vector | ) |
result_map flattenMoveResults | ( | result_vector | ) |
result_map flattenWrapperResults | ( | result_vector | ) |
for | ( | ) |
int main | ( | int | argc, |
char ** | argv | ||
) |
base_vertices push_back | ( | Eigen::Vector3d(0, 0, 0) | ) |
base_vertices push_back | ( | Eigen::Vector3d(0, 0, 1) | ) |
base_vertices push_back | ( | Eigen::Vector3d(0, 1, 0) | ) |
base_vertices push_back | ( | Eigen::Vector3d(0, 1, 1) | ) |
base_vertices push_back | ( | Eigen::Vector3d(1, 0, 0) | ) |
base_vertices push_back | ( | Eigen::Vector3d(1, 0, 1) | ) |
base_vertices push_back | ( | Eigen::Vector3d(1, 1, 0) | ) |
base_vertices push_back | ( | Eigen::Vector3d(1, 1, 1) | ) |
check_pairs push_back | ( | tesseract_common::makeOrderedLinkPair("base_link", "link_1") | ) |
check_pairs push_back | ( | tesseract_common::makeOrderedLinkPair("base_link", "link_2") | ) |
check_pairs push_back | ( | tesseract_common::makeOrderedLinkPair("base_link", "link_3") | ) |
check_pairs push_back | ( | tesseract_common::makeOrderedLinkPair("link_1", "link_2") | ) |
check_pairs push_back | ( | tesseract_common::makeOrderedLinkPair("link_1", "link_3") | ) |
check_pairs push_back | ( | tesseract_common::makeOrderedLinkPair("link_2", "link_3") | ) |
check_pairs push_back | ( | tesseract_common::makeOrderedLinkPair("part_link", "link_1") | ) |
check_pairs push_back | ( | tesseract_common::makeOrderedLinkPair("part_link", "link_2") | ) |
check_pairs push_back | ( | tesseract_common::makeOrderedLinkPair("part_link", "link_3") | ) |
result_map release | ( | ) |
result_map setContactResult | ( | key1 | , |
tesseract_collision::ContactResult{} | |||
) |
result_map setContactResult | ( | key1 | , |
{ tesseract_collision::ContactResult{}, tesseract_collision::ContactResult{} } | |||
) |
result_map setContactResult | ( | key2 | , |
tesseract_collision::ContactResult{} | |||
) |
result_map setContactResult | ( | key2 | , |
{ tesseract_collision::ContactResult{}, tesseract_collision::ContactResult{} } | |||
) |
results cc_time = 7 |
results cc_transform = Eigen::Isometry3d::Identity() * Eigen::Translation3d(1, 2, 3) |
results cc_type = tesseract_collision::ContinuousCollisionType::CCType_Between |
std::vector<tesseract_collision::ObjectPairKey> check_pairs |
plugin config | ( | 5 | , |
request | , | ||
tesseract_collision::CollisionEvaluatorType::LVS_DISCRETE | , | ||
0. | 5 | ||
) |
results distance = 10 |
auto filter |
auto it = result_map.find(key1) |
auto key2 = tesseract_common::makeOrderedLinkPair("link2", "link3") |
results link_names = "notempty" |
results nearest_points = Eigen::Vector3d(1, 2, 3) |
results nearest_points_local = Eigen::Vector3d(1, 2, 3) |
results normal = Eigen::Vector3d(1, 2, 3) |
pairs |
std::vector< std::reference_wrapper< const tesseract_collision::ContactResult > > result_vector |
results shape_id = 5 |
results single_contact_point = true |
std::vector<std::string> static_links { "base_link", "part_link" } |
results subshape_id = 10 |
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP |
test_vertices { base_vertices } |
results transform = Eigen::Isometry3d::Identity() * Eigen::Translation3d(1, 2, 3) |
results type_id = 3 |