Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
Functions | Variables
tesseract_environment_utils.cpp File Reference
#include <tesseract_common/macros.h>
#include <gtest/gtest.h>
#include <algorithm>
#include <vector>
#include <tesseract_urdf/urdf_parser.h>
#include <tesseract_common/resource_locator.h>
#include <tesseract_common/utils.h>
#include <tesseract_environment/environment.h>
#include <tesseract_environment/utils.h>
#include <tesseract_support/tesseract_support_resource_locator.h>
Include dependency graph for tesseract_environment_utils.cpp:

Functions

SceneGraph::UPtr getSceneGraph ()
 
SRDFModel::Ptr getSRDFModel (const SceneGraph &scene_graph)
 
template<typename ManagerType >
void checkIsAllowedFnOverride (std::unique_ptr< ManagerType > manager)
 
 EXPECT_TRUE (scene_graph !=nullptr)
 
 EXPECT_TRUE (srdf !=nullptr)
 
 EXPECT_TRUE (success)
 
 checkIsAllowedFnOverride< DiscreteContactManager > (env->getDiscreteContactManager())
 
 checkIsAllowedFnOverride< ContinuousContactManager > (env->getContinuousContactManager())
 
manager setActiveCollisionObjects (active_links)
 
tmap["test_box_link"] translate (Eigen::Vector3d(0.9, 0, 0))
 
 checkTrajectoryState (contacts, *manager, tmap, config)
 
 EXPECT_FALSE (contacts.empty())
 
manager applyContactManagerConfig (config.contact_manager_config)
 
contacts clear ()
 
 EXPECT_TRUE (contacts.empty())
 
tmap1["test_box_link"] translate (Eigen::Vector3d(0.9, 2, 0))
 
tmap2["test_box_link"] translate (Eigen::Vector3d(0.9, -2, 0))
 
 checkTrajectorySegment (contacts, *manager, tmap1, tmap2, config.contact_request)
 
tmap["test_box_link"] translate (Eigen::Vector3d(1.05, 0, 0))
 
 checkTrajectoryState (contacts, *manager, tmap, config.contact_request)
 
tmap1["test_box_link"] translate (Eigen::Vector3d(1.05, 2, 0))
 
tmap2["test_box_link"] translate (Eigen::Vector3d(1.05, -2, 0))
 
 checkTrajectorySegment (contacts, *manager, tmap1, tmap2, config)
 
int main (int argc, char **argv)
 

Variables

auto srdf = getSRDFModel(*scene_graph)
 
auto env = std::make_shared<Environment>()
 
bool success = env->init(*scene_graph, srdf)
 
CollisionCheckConfig mCollisionCheckConfig
 
mCollisionCheckConfig longest_valid_segment_length = 0.1
 
mCollisionCheckConfig contact_request type = tesseract_collision::ContactTestType::FIRST
 
tesseract_collision::CollisionMarginData margin_data (0.0) = margin_data
 
CollisionCheckConfig default_config
 
default_config contact_manager_config margin_data_override_type
 
tesseract_collision::ContactResultMap contacts
 
DiscreteContactManager::Ptr manager = env->getDiscreteContactManager()
 
std::vector< std::string > active_links = { "boxbot_link", "test_box_link" }
 
tesseract_common::TransformMap tmap = Eigen::Isometry3d::Identity()
 
tesseract_common::TransformMap tmap1 = Eigen::Isometry3d::Identity()
 
tesseract_common::TransformMap tmap2 = Eigen::Isometry3d::Identity()
 

Function Documentation

◆ applyContactManagerConfig()

manager applyContactManagerConfig ( config.  contact_manager_config)
Initial value:
{
tesseract_collision::CollisionCheckConfig config(5, request, tesseract_collision::CollisionEvaluatorType::LVS_DISCRETE, 0.5)
Definition: tesseract_common_serialization_unit.cpp:154
ContactManagerConfig contact_manager_config
Used to configure the contact manager prior to a series of checks.
Definition: types.h:426
std::unordered_map< std::string, bool > modify_object_enabled
Each key is an object name. Objects will be enabled/disabled based on the value. Objects that aren't ...
Definition: types.h:410

◆ checkIsAllowedFnOverride()

template<typename ManagerType >
void checkIsAllowedFnOverride ( std::unique_ptr< ManagerType >  manager)

◆ checkIsAllowedFnOverride< ContinuousContactManager >()

checkIsAllowedFnOverride< ContinuousContactManager > ( env->  getContinuousContactManager())

◆ checkIsAllowedFnOverride< DiscreteContactManager >()

checkIsAllowedFnOverride< DiscreteContactManager > ( env->  getDiscreteContactManager())

◆ checkTrajectorySegment() [1/2]

checkTrajectorySegment ( contacts  ,
manager,
tmap1  ,
tmap2  ,
config   
)

◆ checkTrajectorySegment() [2/2]

checkTrajectorySegment ( contacts  ,
manager,
tmap1  ,
tmap2  ,
config.  contact_request 
)

◆ checkTrajectoryState() [1/2]

checkTrajectoryState ( contacts  ,
manager,
tmap  ,
config   
)

◆ checkTrajectoryState() [2/2]

checkTrajectoryState ( contacts  ,
manager,
tmap  ,
config.  contact_request 
)

◆ clear()

contacts clear ( )

◆ EXPECT_FALSE()

EXPECT_FALSE ( contacts.  empty())

◆ EXPECT_TRUE() [1/4]

EXPECT_TRUE ( contacts.  empty())

◆ EXPECT_TRUE() [2/4]

EXPECT_TRUE ( scene_graph = nullptr)

◆ EXPECT_TRUE() [3/4]

EXPECT_TRUE ( srdf = nullptr)

◆ EXPECT_TRUE() [4/4]

EXPECT_TRUE ( success  )

◆ getSceneGraph()

SceneGraph::UPtr getSceneGraph ( )

◆ getSRDFModel()

SRDFModel::Ptr getSRDFModel ( const SceneGraph scene_graph)

◆ main()

int main ( int  argc,
char **  argv 
)

◆ setActiveCollisionObjects()

manager setActiveCollisionObjects ( active_links  )

◆ translate() [1/6]

tmap2["test_box_link"] translate ( Eigen::Vector3d(0.9, -2, 0)  )

◆ translate() [2/6]

tmap["test_box_link"] translate ( Eigen::Vector3d(0.9, 0, 0)  )

◆ translate() [3/6]

tmap1["test_box_link"] translate ( Eigen::Vector3d(0.9, 2, 0)  )

◆ translate() [4/6]

tmap2["test_box_link"] translate ( Eigen::Vector3d(1.05, -2, 0)  )

◆ translate() [5/6]

tmap["test_box_link"] translate ( Eigen::Vector3d(1.05, 0, 0)  )

◆ translate() [6/6]

tmap1["test_box_link"] translate ( Eigen::Vector3d(1.05, 2, 0)  )

Variable Documentation

◆ active_links

std::vector<std::string> active_links = { "boxbot_link", "test_box_link" }

◆ contacts

◆ default_config

CollisionCheckConfig default_config

◆ env

auto env = std::make_shared<Environment>()

◆ longest_valid_segment_length

default_config longest_valid_segment_length = 0.1

◆ manager

ContinuousContactManager::Ptr manager = env->getDiscreteContactManager()

◆ margin_data

default_config contact_manager_config margin_data ( 0.  0) = margin_data

◆ margin_data_override_type

default_config contact_manager_config margin_data_override_type
Initial value:
=
tesseract_common::CollisionMarginOverrideType::REPLACE

◆ mCollisionCheckConfig

CollisionCheckConfig mCollisionCheckConfig

◆ srdf

◆ success

bool success = env->init(*scene_graph, srdf)

◆ tmap

tesseract_common::TransformMap tmap = Eigen::Isometry3d::Identity()

◆ tmap1

tesseract_common::TransformMap tmap1 = Eigen::Isometry3d::Identity()

◆ tmap2

tesseract_common::TransformMap tmap2 = Eigen::Isometry3d::Identity()

◆ type