tesseract_robotics.tesseract_common
Introduction
tesseract_common contains functionality that is common to all tesseract modules. This includes general types,
container templates, utility functions, and more. The Python wrappers contain additional functionality for
using with Eigen Geometry, Boost Filesystem, Boost Uuid, console_bridge, and TinyXML2.
Eigen Geometry
Matrix and vector types for Eigen are automatically converted to NumPy arrays when returned from a function, and
NumPy arrays are automatically converted to Eigen types when passed into a function. This works for matrices and
vectors, but does not work well for the Eigen geometry types used by Tesseract. The following Eigen classes are
available in tesseract_common:
Quaterniond- Represents a Quaternion in (w,x,y,z) formatAngleAxisd- Represents a rotation as an angle around an axisTranslation3d- Represents a translation in 3D spaceIsometry3d- Represents a rotation and translation in 3D space. This is used by Tesseract to represent transforms and poses.
Resource Locators
Resource locators are used by Tesseract to locate resources such as meshes, urdfs, srdfs, etc. The
tesseract_common.GeneralResourceLocator class is available to locate resources in Python. This
class searches paths in the environmental variable TESSERACT_RESOURCE_PATH to find resources. Each package://<dir>/
will search for the subdirectory <dir> in each path in TESSERACT_RESOURCE_PATH.
Auto-configuration: When you import tesseract_robotics, the following environment variables are automatically
set to point to bundled data (if not already set):
TESSERACT_RESOURCE_PATH- Path to bundled resources forpackage://URL resolutionTESSERACT_SUPPORT_DIR- Path to bundled tesseract_support directoryTESSERACT_TASK_COMPOSER_CONFIG_FILE- Path to bundled task composer config
This means package://tesseract_support/urdf/... URLs work out of the box without manual configuration.
Boost Filesystem
boost::filesystem::path is used by Tesseract to represent file paths. Because of function overloads, it is not
possible to use strings for filesystems. The FileSystem path class is used as a container for paths
to allow the correct function overloads to be selected.
Boost Uuid
The boost::uuids::uuid is used by Tesseract to represent unique identifiers. The Uuid class is available
to represent boost::uuids::uuid in Python.
The newRandomUuid function is available to generate a random Uuid in Python.
Console Bridge
The console_bridge package is used by Tesseract to provide logging functionality. Several functions are available
to modify the logging level and to log messages:
The following module level functions are available to modify the logging behavior:
getLogLevel()setLogLevel()useOutputHandler()noOutputHandler()
The following module level constants are available for setting the logging level:
CONSOLE_BRIDGE_LOG_NONECONSOLE_BRIDGE_LOG_ERRORCONSOLE_BRIDGE_LOG_WARNCONSOLE_BRIDGE_LOG_INFOCONSOLE_BRIDGE_LOG_DEBUG
The useOutputHandler() function can be used with the OutputHandler class to capture logging messages in Python:
class MyOutputHandler(tesseract_common.OutputHandler):
def __init__(self):
super().__init__()
def log(self, text, level, filename, line):
# Do something with the logging message
print(text)
output_handler = MyOutputHandler()
tesseract_common.useOutputHandler(output_handler)
# Always restore the original output handler when done to avoid segfaults on exit
tesseract_common.restorePreviousOutputHandler()
TinyXML2 Support
The tinyxml2 package is used to serialize and deserialize Tesseract types. The tinyxml2 wrappers are included in the tesseract_common package to allow for serialization and deserialization of Tesseract types in Python.
Classes
AllowedCollisionMatrix Class
AngleAxisd Class
AnyPoly Class
BytesResource Class
CollisionMarginData Class
FilesystemPath Class
GeneralResourceLocator Class
Isometry3d Class
JointState Class
JointStates Class
JointTrajectory Class
KinematicLimits Class
ManipulatorInfo Class
OutputHandler Class
PairHash Class
Quaterniond Class
Resource Class
ResourceLocator Class
SimpleLocatedResource Class
SimpleResourceLocatorFn Class
SimpleResourceLocatorFnBase Class
Timer Class
Translation3d Class
TypeErasureInterface Class
Uuid Class
VectorFilesystemPath Class
XMLAttribute Class
XMLComment Class
XMLConstHandle Class
XMLDeclaration Class
XMLDocument Class
XMLElement Class
XMLHandle Class
XMLNode Class
XMLPrinter Class
XMLText Class
XMLUnknown Class
XMLUtil Class
XMLVisitor Class
type_index Class
Functions
AnyPoly_as_double Function
AnyPoly_as_string Function
AnyPoly_is_double Function
AnyPoly_is_string Function
AnyPoly_wrap_double Function
AnyPoly_wrap_string Function
getLogLevel Function
isWithinLimits Function
log Function
makeOrderedLinkPair Function
newRandomUuid Function
noOutputHandler Function
restorePreviousOutputHandler Function
satisfiesLimits Function
setLogLevel Function
useOutputHandler Function
Constants
COLLAPSE_WHITESPACECONSOLE_BRIDGE_LOG_DEBUGCONSOLE_BRIDGE_LOG_ERRORCONSOLE_BRIDGE_LOG_INFOCONSOLE_BRIDGE_LOG_NONECONSOLE_BRIDGE_LOG_WARNCollisionMarginOverrideType_MODIFYCollisionMarginOverrideType_MODIFY_PAIR_MARGINCollisionMarginOverrideType_NONECollisionMarginOverrideType_OVERRIDE_DEFAULT_MARGINCollisionMarginOverrideType_OVERRIDE_PAIR_MARGINCollisionMarginOverrideType_REPLACEPEDANTIC_WHITESPACEPRESERVE_WHITESPACETINYXML2_MAJOR_VERSIONTINYXML2_MAX_ELEMENT_DEPTHTINYXML2_MINOR_VERSIONTINYXML2_PATCH_VERSIONTIXML2_MAJOR_VERSIONTIXML2_MINOR_VERSIONTIXML2_PATCH_VERSIONXML_CAN_NOT_CONVERT_TEXTXML_ELEMENT_DEPTH_EXCEEDEDXML_ERROR_COUNTXML_ERROR_EMPTY_DOCUMENTXML_ERROR_FILE_COULD_NOT_BE_OPENEDXML_ERROR_FILE_NOT_FOUNDXML_ERROR_FILE_READ_ERRORXML_ERROR_MISMATCHED_ELEMENTXML_ERROR_PARSINGXML_ERROR_PARSING_ATTRIBUTEXML_ERROR_PARSING_CDATAXML_ERROR_PARSING_COMMENTXML_ERROR_PARSING_DECLARATIONXML_ERROR_PARSING_ELEMENTXML_ERROR_PARSING_TEXTXML_ERROR_PARSING_UNKNOWNXML_NO_ATTRIBUTEXML_NO_TEXT_NODEXML_SUCCESSXML_WRONG_ATTRIBUTE_TYPE
Container Templates
AllowedCollisionEntries->std::unordered_map<std::pair<std::string,std::string>, std::string, tesseract_common::PairHash>Array2Double->std::array<double,2>Array2Int->std::array<int,2>Array2Isometry3d->std::array<Eigen::Isometry3d,2>Array2String->std::array<std::string,2>Array2Vector3d->std::array<Eigen::Vector3d,2>MapStringDouble->std::unordered_map<std::string, double>MapStringMapStringDouble->std::unordered_map<std::string, std::unordered_map<std::string, double> >MapStringMapStringMapStringDouble->std::unordered_map<std::string, std::unordered_map<std::string, std::unordered_map<std::string, double> > >MapStringMapStringString->std::unordered_map<std::string, std::unordered_map<std::string, std::string> >MapStringString->std::unordered_map<std::string, std::string>MapStringString2->std::map<std::string, std::string>MapStringVectorDouble->std::unordered_map<std::string, std::vector<double> >MapStringVectorPairString->std::unordered_map<std::string, std::vector<std::pair<std::string, std::string>>>MapStringVectorString->std::unordered_map<std::string, std::vector<std::string>>PairString->std::pair<std::string, std::string>PairVectorString->std::pair<std::vector<std::string>, std::vector<std::string>>PluginInfoMap->std::map<std::string, tesseract_common::PluginInfo>SetString->std::set<std::string>VectorDouble->std::vector<double>VectorEigenIndex->std::vector<Eigen::Index>VectorPairString->std::vector<std::pair<std::string, std::string> >VectorSizet->std::vector<std::size_t>VectorString->std::vector<std::string>VectorUInt8->std::vector<uint8_t>VectorUuid->std::vector<boost::uuids::uuid>VectorVector3d->std::vector<Eigen::Vector3d>VectorVectorXd->std::vector<Eigen::VectorXd>TransformMap->tesseract_common::AlignedMap< std::string, Eigen::Isometry3d>VectorIsometry3d->tesseract_common::AlignedVector< Eigen::Isometry3d>VectorVector2d->tesseract_common::AlignedVector< Eigen::Vector2d>VectorVector4d->tesseract_common::AlignedVector< Eigen::Vector4d>