Tesseract
Motion Planning Environment
|
#include <tesseract_common/macros.h>
#include <gtest/gtest.h>
#include <numeric>
#include <tesseract_collision/core/types.h>
Functions | |
EXPECT_NEAR (data.getDefaultCollisionMargin(), 0, tol) | |
EXPECT_NEAR (data.getPairCollisionMargin("link_1", "link_2"), 0, tol) | |
EXPECT_EQ (data.getPairCollisionMargins().size(), 0) | |
EXPECT_NEAR (data.getDefaultCollisionMargin(), default_margin, tol) | |
EXPECT_NEAR (data.getPairCollisionMargin("link_1", "link_2"), default_margin, tol) | |
data | setDefaultCollisionMargin (default_margin) |
data | setPairCollisionMargin ("link_1", "link_2", pair_margin) |
EXPECT_NEAR (data.getMaxCollisionMargin(), pair_margin, tol) | |
EXPECT_NEAR (data.getPairCollisionMargin("link_1", "link_2"), pair_margin, tol) | |
EXPECT_EQ (data.getPairCollisionMargins().size(), 1) | |
data | setPairCollisionMargin ("link_1", "link_2", default_margin) |
data | incrementMargins (increment) |
EXPECT_NEAR (data.getDefaultCollisionMargin(), default_margin+increment, tol) | |
EXPECT_NEAR (data.getMaxCollisionMargin(), pair_margin+increment, tol) | |
EXPECT_NEAR (data.getPairCollisionMargin("link_1", "link_2"), pair_margin+increment, tol) | |
data | scaleMargins (scale) |
EXPECT_NEAR (data.getDefaultCollisionMargin(), default_margin *scale, tol) | |
EXPECT_NEAR (data.getMaxCollisionMargin(), pair_margin *scale, tol) | |
EXPECT_NEAR (data.getPairCollisionMargin("link_1", "link_2"), pair_margin *scale, tol) | |
data | apply (override_data, CollisionMarginOverrideType::OVERRIDE_DEFAULT_MARGIN) |
CollisionMarginData | override_data (default_margin *3) |
data | apply (override_data, CollisionMarginOverrideType::OVERRIDE_PAIR_MARGIN) |
data | apply (override_data, CollisionMarginOverrideType::REPLACE) |
override_data | setPairCollisionMargin ("link_1", "link_2", pair_margin *3) |
data | apply (override_data, CollisionMarginOverrideType::NONE) |
override_data | setPairCollisionMargin ("link_1", "link_3", pair_margin *3) |
data | apply (override_data, CollisionMarginOverrideType::MODIFY) |
EXPECT_NEAR (data.getPairCollisionMargin("link_1", "link_3"), pair_margin *3, tol) | |
EXPECT_EQ (data.getPairCollisionMargins().size(), 2) | |
data | apply (override_data, CollisionMarginOverrideType::MODIFY_PAIR_MARGIN) |
int | main (int argc, char **argv) |
Variables | |
CollisionMarginData | data (default_margin) |
double | pair_margin = 0.5 |
default_margin = 2 * pair_margin | |
double | increment = 0.01 |
double | scale = 1.5 |
CollisionMarginData | override_data (default_margin) |
data apply | ( | override_data | , |
CollisionMarginOverrideType::MODIFY | |||
) |
data apply | ( | override_data | , |
CollisionMarginOverrideType::MODIFY_PAIR_MARGIN | |||
) |
data apply | ( | override_data | , |
CollisionMarginOverrideType::NONE | |||
) |
data apply | ( | override_data | , |
CollisionMarginOverrideType::OVERRIDE_DEFAULT_MARGIN | |||
) |
data apply | ( | override_data | , |
CollisionMarginOverrideType::OVERRIDE_PAIR_MARGIN | |||
) |
data apply | ( | override_data | , |
CollisionMarginOverrideType::REPLACE | |||
) |
EXPECT_EQ | ( | data. | getPairCollisionMargins).size(, |
0 | |||
) |
EXPECT_EQ | ( | data. | getPairCollisionMargins).size(, |
1 | |||
) |
EXPECT_EQ | ( | data. | getPairCollisionMargins).size(, |
2 | |||
) |
EXPECT_NEAR | ( | data. | getDefaultCollisionMargin(), |
0 | , | ||
tol | |||
) |
EXPECT_NEAR | ( | data. | getDefaultCollisionMargin(), |
default_margin * | scale, | ||
tol | |||
) |
EXPECT_NEAR | ( | data. | getDefaultCollisionMargin(), |
default_margin+ | increment, | ||
tol | |||
) |
EXPECT_NEAR | ( | data. | getDefaultCollisionMargin(), |
default_margin | , | ||
tol | |||
) |
EXPECT_NEAR | ( | data. | getMaxCollisionMargin(), |
pair_margin * | scale, | ||
tol | |||
) |
EXPECT_NEAR | ( | data. | getMaxCollisionMargin(), |
pair_margin+ | increment, | ||
tol | |||
) |
EXPECT_NEAR | ( | data. | getMaxCollisionMargin(), |
pair_margin | , | ||
tol | |||
) |
EXPECT_NEAR | ( | data. | getPairCollisionMargin"link_1", "link_2", |
0 | , | ||
tol | |||
) |
EXPECT_NEAR | ( | data. | getPairCollisionMargin"link_1", "link_2", |
default_margin | , | ||
tol | |||
) |
EXPECT_NEAR | ( | data. | getPairCollisionMargin"link_1", "link_2", |
pair_margin * | scale, | ||
tol | |||
) |
EXPECT_NEAR | ( | data. | getPairCollisionMargin"link_1", "link_2", |
pair_margin+ | increment, | ||
tol | |||
) |
EXPECT_NEAR | ( | data. | getPairCollisionMargin"link_1", "link_2", |
pair_margin | , | ||
tol | |||
) |
EXPECT_NEAR | ( | data. | getPairCollisionMargin"link_1", "link_3", |
pair_margin * | 3, | ||
tol | |||
) |
int main | ( | int | argc, |
char ** | argv | ||
) |
CollisionMarginData override_data | ( | default_margin * | 3 | ) |
data setDefaultCollisionMargin | ( | default_margin | ) |
data setPairCollisionMargin | ( | "link_1" | , |
"link_2" | , | ||
default_margin | |||
) |
override_data setPairCollisionMargin | ( | "link_1" | , |
"link_2" | , | ||
pair_margin * | 3 | ||
) |
override_data setPairCollisionMargin | ( | "link_1" | , |
"link_2" | , | ||
pair_margin | |||
) |
override_data setPairCollisionMargin | ( | "link_1" | , |
"link_3" | , | ||
pair_margin * | 3 | ||
) |
CollisionMarginData data | ( | default_margin | ) |
default_margin = 2 * pair_margin |
double increment = 0.01 |
CollisionMarginData override_data | ( | default_margin | ) |
double pair_margin = 0.5 |
double scale = 1.5 |