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

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

#include <tesseract/common/macros.h>
#include <unordered_set>
#include <vector>
#include <Eigen/Geometry>
#include <tesseract/collision/types.h>
#include <tesseract/common/contact_allowed_validator.h>
#include <tesseract/common/types.h>

Functions

std::vector< tesseract::common::LinkIdPairtesseract::collision::getCollisionObjectPairs (const std::vector< tesseract::common::LinkId > &active_links, const std::vector< tesseract::common::LinkId > &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::unordered_set< tesseract::common::LinkId > &active, const tesseract::common::LinkId &id)
 This will check if a link is active provided a set. If the set is empty the link is considered active.
 
bool tesseract::collision::isContactAllowed (const tesseract::common::LinkIdPair &pair, const std::shared_ptr< const tesseract::common::ContactAllowedValidator > &validator, bool verbose=false)
 Determine if contact is allowed between two objects.
 
bool tesseract::collision::isContactAllowed (const tesseract::common::LinkId &id1, const tesseract::common::LinkId &id2, const std::shared_ptr< const tesseract::common::ContactAllowedValidator > &validator, bool verbose=false)
 Determine if contact is allowed between two objects (two-id overload; resolves the pair only when a validator decision requires it, and logs in caller argument order).
 
ContactResulttesseract::collision::processResult (ContactTestData &cdata, ContactResult &contact, const tesseract::common::LinkIdPair &key, double margin, 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< tesseract::common::LinkIdPair > tesseract::collision::getCollisionObjectPairs ( const std::vector< tesseract::common::LinkId > &  active_links,
const std::vector< tesseract::common::LinkId > &  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::unordered_set< tesseract::common::LinkId > &  active,
const tesseract::common::LinkId id 
)

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

Parameters
activeSet of active LinkIds
idThe LinkId to check if it is active.

◆ isContactAllowed() [1/2]

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

Determine if contact is allowed between two objects.

Parameters
pairThe LinkId pair
validatorThe contact allowed validator
verboseIf true print debug information
Returns
True if contact is allowed between the two object, otherwise false.

◆ isContactAllowed() [2/2]

bool tesseract::collision::isContactAllowed ( const tesseract::common::LinkId id1,
const tesseract::common::LinkId id2,
const std::shared_ptr< const tesseract::common::ContactAllowedValidator > &  validator,
bool  verbose = false 
)

Determine if contact is allowed between two objects (two-id overload; resolves the pair only when a validator decision requires it, and logs in caller argument order).

Parameters
id1The id of the first object
id2The id 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 tesseract::common::LinkIdPair key,
double  margin,
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
marginThe collision margin already resolved for key
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.