Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
Functions | Variables
collision_margin_data_unit.cpp File Reference
#include <tesseract_common/macros.h>
#include <gtest/gtest.h>
#include <numeric>
#include <tesseract_collision/core/types.h>
Include dependency graph for collision_margin_data_unit.cpp:

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)
 

Function Documentation

◆ apply() [1/6]

data apply ( override_data  ,
CollisionMarginOverrideType::MODIFY   
)

◆ apply() [2/6]

data apply ( override_data  ,
CollisionMarginOverrideType::MODIFY_PAIR_MARGIN   
)

◆ apply() [3/6]

data apply ( override_data  ,
CollisionMarginOverrideType::NONE   
)

◆ apply() [4/6]

data apply ( override_data  ,
CollisionMarginOverrideType::OVERRIDE_DEFAULT_MARGIN   
)

◆ apply() [5/6]

data apply ( override_data  ,
CollisionMarginOverrideType::OVERRIDE_PAIR_MARGIN   
)

◆ apply() [6/6]

data apply ( override_data  ,
CollisionMarginOverrideType::REPLACE   
)

◆ EXPECT_EQ() [1/3]

EXPECT_EQ ( data.  getPairCollisionMargins).size(,
 
)

◆ EXPECT_EQ() [2/3]

EXPECT_EQ ( data.  getPairCollisionMargins).size(,
 
)

◆ EXPECT_EQ() [3/3]

EXPECT_EQ ( data.  getPairCollisionMargins).size(,
 
)

◆ EXPECT_NEAR() [1/13]

EXPECT_NEAR ( data.  getDefaultCollisionMargin(),
,
tol   
)

◆ EXPECT_NEAR() [2/13]

EXPECT_NEAR ( data.  getDefaultCollisionMargin(),
default_margin scale,
tol   
)

◆ EXPECT_NEAR() [3/13]

EXPECT_NEAR ( data.  getDefaultCollisionMargin(),
default_margin increment,
tol   
)

◆ EXPECT_NEAR() [4/13]

EXPECT_NEAR ( data.  getDefaultCollisionMargin(),
default_margin  ,
tol   
)

◆ EXPECT_NEAR() [5/13]

EXPECT_NEAR ( data.  getMaxCollisionMargin(),
pair_margin scale,
tol   
)

◆ EXPECT_NEAR() [6/13]

EXPECT_NEAR ( data.  getMaxCollisionMargin(),
pair_margin increment,
tol   
)

◆ EXPECT_NEAR() [7/13]

EXPECT_NEAR ( data.  getMaxCollisionMargin(),
pair_margin  ,
tol   
)

◆ EXPECT_NEAR() [8/13]

EXPECT_NEAR ( data.  getPairCollisionMargin"link_1", "link_2",
,
tol   
)

◆ EXPECT_NEAR() [9/13]

EXPECT_NEAR ( data.  getPairCollisionMargin"link_1", "link_2",
default_margin  ,
tol   
)

◆ EXPECT_NEAR() [10/13]

EXPECT_NEAR ( data.  getPairCollisionMargin"link_1", "link_2",
pair_margin scale,
tol   
)

◆ EXPECT_NEAR() [11/13]

EXPECT_NEAR ( data.  getPairCollisionMargin"link_1", "link_2",
pair_margin increment,
tol   
)

◆ EXPECT_NEAR() [12/13]

EXPECT_NEAR ( data.  getPairCollisionMargin"link_1", "link_2",
pair_margin  ,
tol   
)

◆ EXPECT_NEAR() [13/13]

EXPECT_NEAR ( data.  getPairCollisionMargin"link_1", "link_3",
pair_margin 3,
tol   
)

◆ incrementMargins()

data incrementMargins ( increment  )

◆ main()

int main ( int  argc,
char **  argv 
)

◆ override_data()

CollisionMarginData override_data ( default_margin 3)

◆ scaleMargins()

data scaleMargins ( scale  )

◆ setDefaultCollisionMargin()

data setDefaultCollisionMargin ( default_margin  )

◆ setPairCollisionMargin() [1/4]

data setPairCollisionMargin ( "link_1"  ,
"link_2"  ,
default_margin   
)

◆ setPairCollisionMargin() [2/4]

override_data setPairCollisionMargin ( "link_1"  ,
"link_2"  ,
pair_margin 3 
)

◆ setPairCollisionMargin() [3/4]

override_data setPairCollisionMargin ( "link_1"  ,
"link_2"  ,
pair_margin   
)

◆ setPairCollisionMargin() [4/4]

override_data setPairCollisionMargin ( "link_1"  ,
"link_3"  ,
pair_margin 3 
)

Variable Documentation

◆ data

Initial value:
{
double default_margin = 0.0254
default_margin
Definition: collision_margin_data_unit.cpp:70

◆ default_margin

default_margin = 2 * pair_margin

◆ increment

double increment = 0.01

◆ override_data

CollisionMarginData override_data ( default_margin  )

◆ pair_margin

double pair_margin = 0.5

◆ scale

double scale = 1.5