Tesseract 0.28.4
Loading...
Searching...
No Matches
common.cpp File Reference

This is a collection of common methods. More...

#include <tesseract/common/macros.h>
#include <cstdio>
#include <console_bridge/console.h>
#include <tesseract/common/utils.h>
#include <tesseract/common/types.h>
#include <tesseract/collision/common.h>
#include <tesseract/collision/contact_result_validator.h>

Functions

std::vector< ObjectPairKey > tesseract::collision::getCollisionObjectPairs (const std::vector< std::string > &active_links, const std::vector< std::string > &static_links, const std::shared_ptr< const tesseract::common::ContactAllowedValidator > &validator=nullptr)
 Get a vector of possible collision object pairs.
 
bool tesseract::collision::isLinkActive (const std::vector< std::string > &active, const std::string &name)
 This will check if a link is active provided a list. If the list is empty the link is considered active.
 
bool tesseract::collision::isContactAllowed (const std::string &name1, const std::string &name2, const std::shared_ptr< const tesseract::common::ContactAllowedValidator > &validator, bool verbose=false)
 Determine if contact is allowed between two objects.
 
ContactResulttesseract::collision::processResult (ContactTestData &cdata, ContactResult &contact, const std::pair< std::string, std::string > &key, bool found)
 processResult Processes the ContactResult based on the information in the ContactTestData
 
void tesseract::collision::scaleVertices (tesseract::common::VectorVector3d &vertices, const Eigen::Vector3d &center, const Eigen::Vector3d &scale)
 Apply scaling to the geometry coordinates.
 
void tesseract::collision::scaleVertices (tesseract::common::VectorVector3d &vertices, const Eigen::Vector3d &scale)
 Apply scaling to the geometry coordinates.
 

Detailed Description

This is a collection of common methods.

Author
Levi Armstrong
Date
Dec 18, 2017
License
Software License Agreement (Apache License)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ getCollisionObjectPairs()

std::vector< ObjectPairKey > tesseract::collision::getCollisionObjectPairs ( const std::vector< std::string > &  active_links,
const std::vector< std::string > &  static_links,
const std::shared_ptr< const tesseract::common::ContactAllowedValidator > &  validator = nullptr 
)

Get a vector of possible collision object pairs.

Todo:
Should this also filter out links without geometry?
Parameters
active_linksThe active link names
static_linksThe static link names
validatorThe is contact allowed validator
Returns
A vector of collision object pairs

◆ isLinkActive()

bool tesseract::collision::isLinkActive ( const std::vector< std::string > &  active,
const std::string &  name 
)

This will check if a link is active provided a list. If the list is empty the link is considered active.

Parameters
activeList of active link names
nameThe name of link to check if it is active.

◆ isContactAllowed()

bool tesseract::collision::isContactAllowed ( const std::string &  name1,
const std::string &  name2,
const std::shared_ptr< const tesseract::common::ContactAllowedValidator > &  validator,
bool  verbose = false 
)

Determine if contact is allowed between two objects.

Parameters
name1The name of the first object
name2The name of the second object
validatorThe contact allowed validator
verboseIf true print debug information
Returns
True if contact is allowed between the two object, otherwise false.

◆ processResult()

ContactResult * tesseract::collision::processResult ( ContactTestData cdata,
ContactResult contact,
const std::pair< std::string, std::string > &  key,
bool  found 
)

processResult Processes the ContactResult based on the information in the ContactTestData

Parameters
cdataInformation used to process the results
contactContacts from the collision checkers that will be processed
keyLink pair used as a key to look up pair specific settings
foundSpecifies whether or not a collision has already been found
Returns
Pointer to the ContactResult.

◆ scaleVertices() [1/2]

void tesseract::collision::scaleVertices ( tesseract::common::VectorVector3d &  vertices,
const Eigen::Vector3d &  center,
const Eigen::Vector3d &  scale 
)

Apply scaling to the geometry coordinates.

Given a scaling factor s, and center c, a given vertice v is transformed according to s (v - c) + c.

Parameters
verticesThe vertices to scale
centerThe point at which to scale the data about
scaleThe scale factor to apply to the vertices.

◆ scaleVertices() [2/2]

void tesseract::collision::scaleVertices ( tesseract::common::VectorVector3d &  vertices,
const Eigen::Vector3d &  scale 
)

Apply scaling to the geometry coordinates.

Given a scaling factor s, and center c, a given vertice v is transformed according to s (v - c) + c.

Parameters
verticesThe vertices to scale
scaleThe scale factor to apply to the vertices.