Tesseract 0.28.4
Loading...
Searching...
No Matches
tesseract::common Namespace Reference

Namespace owning boost's hash_is_avalanching, and defined iff boost has the trait at all. More...

Classes

class  AllowedCollisionMatrix
class  AnyWrapper
class  AnyInterface
class  AnyPoly
struct  CalibrationInfo
 The CalibrationInfo struct. More...
class  CloneCache
 Used to create a cache of objects. More...
class  CollisionMarginPairData
class  CollisionMarginData
 Stores information about how the margins allowed between collision objects. More...
class  ContactAllowedValidator
 Should return true if links are allowed to be in collision, otherwise false. More...
class  ACMContactAllowedValidator
class  CombinedContactAllowedValidator
struct  NameId
 Tagged integer identity type for links and joints. More...
struct  OrderedIdPair
 Canonically ordered pair of ids with cached combined hash — the key type for pair-keyed maps (ACM, collision margins, collision coefficients). More...
class  JointState
class  JointTrajectory
 Represents a joint trajectory. More...
struct  KinematicLimits
 Store kinematic limits. More...
struct  LogRecord
 Structured representation of a Tesseract log event. More...
struct  ManipulatorInfo
 Contains information about a robot manipulator. More...
struct  PluginInfo
 The Plugin Information struct. More...
struct  PluginInfoContainer
struct  PluginDiscoveryInfo
 Plugin library discovery information used before loading plugin-specific schemas. More...
struct  ProfilesPluginInfo
 The profile plugin information structure. More...
struct  KinematicsPluginInfo
 The kinematics plugin information structure. More...
struct  ContactManagersPluginInfo
 The contact managers plugin information structure. More...
struct  TaskComposerPluginInfo
 The task composer plugin information structure. More...
class  Profile
 The Profile class. More...
class  ProfileDictionary
 This class is used to store profiles used by various tasks. More...
struct  ProfileFactoryData
 This is a base class used to store data need by the profiles This may contain the environment, scene graph, etc. More...
class  ProfileFactory
 Profile Factory class used for loading profile to be called by name. More...
class  ProfilePluginFactory
class  PropertyTreeValidationError
 Exception containing all configuration validation diagnostics. More...
class  PropertyTree
 Represents a node in a hierarchical property tree. More...
class  PropertyTreeBuilder
 Fluent builder for constructing PropertyTree schemas with minimal boilerplate. More...
class  ResourceLocator
 Abstract class for resource loaders. More...
class  GeneralResourceLocator
 A general resource loaders using environment variable. More...
class  Resource
 Represents resource data available from a file or url. More...
class  SimpleLocatedResource
 Resource implementation for a local file. More...
class  BytesResource
class  SchemaRegistry
 A global registry of named schemas for PropertyTree. More...
struct  Serialization
struct  ambiguate
struct  got_type
struct  got_type< A >
struct  sig_check
struct  has_member
class  Stopwatch
 A simple stopwatch class leveraging chrono high resolution clock. More...
class  Timer
 A timer which calls a callback every interval on a separate thread. More...
struct  LinkTag
struct  JointTag
class  TestPluginBase
class  TestPluginMultiply
class  TestProfile
struct  NameIdTestAccess
 Test-only access to NameId internals; NameId declares this a friend. More...

Typedefs

using AllowedCollisionEntries = std::unordered_map<LinkIdPair, std::string>
using BoolAnyPoly = AnyWrapper<bool>
using IntAnyPoly = AnyWrapper<int>
using UnsignedAnyPoly = AnyWrapper<unsigned>
using DoubleAnyPoly = AnyWrapper<double>
using FloatAnyPoly = AnyWrapper<float>
using StringAnyPoly = AnyWrapper<std::string>
using SizeTAnyPoly = AnyWrapper<std::size_t>
using VectorStringAnyPoly = AnyWrapper<std::vector<std::string>>
using VectorBoolAnyPoly = AnyWrapper<std::vector<bool>>
using VectorIntAnyPoly = AnyWrapper<std::vector<int>>
using VectorUnsignedAnyPoly = AnyWrapper<std::vector<unsigned>>
using VectorDoubleAnyPoly = AnyWrapper<std::vector<double>>
using VectorFloatAnyPoly = AnyWrapper<std::vector<float>>
using VectorSizeTAnyPoly = AnyWrapper<std::vector<std::size_t>>
using UMapStringStringAnyPoly = AnyWrapper<std::unordered_map<std::string, std::string>>
using UMapStringBoolAnyPoly = AnyWrapper<std::unordered_map<std::string, bool>>
using UMapStringIntAnyPoly = AnyWrapper<std::unordered_map<std::string, int>>
using UMapStringUnsignedAnyPoly = AnyWrapper<std::unordered_map<std::string, unsigned>>
using UMapStringDoubleAnyPoly = AnyWrapper<std::unordered_map<std::string, double>>
using UMapStringFloatAnyPoly = AnyWrapper<std::unordered_map<std::string, float>>
using UMapStringSizeTAnyPoly = AnyWrapper<std::unordered_map<std::string, std::size_t>>
using PairsCollisionMarginData = std::unordered_map<LinkIdPair, double>
template<typename T>
using AlignedVector = std::vector<T, Eigen::aligned_allocator<T>>
template<typename Key, typename Value>
using AlignedMap = std::map<Key, Value, std::less<Key>, Eigen::aligned_allocator<std::pair<const Key, Value>>>
template<typename Key, typename Value>
using AlignedUnorderedMap
using VectorIsometry3d = AlignedVector<Eigen::Isometry3d>
using VectorVector4d = AlignedVector<Eigen::Vector4d>
using VectorVector3d = std::vector<Eigen::Vector3d>
using VectorVector2d = AlignedVector<Eigen::Vector2d>
using LinkIdTransformMap = AlignedUnorderedMap<LinkId, Eigen::Isometry3d>
using JointIdTransformMap = AlignedUnorderedMap<JointId, Eigen::Isometry3d>
using Toolpath = AlignedVector<VectorIsometry3d>
using TrajArray = Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>
using LinkId = NameId<LinkTag>
using JointId = NameId<JointTag>
using LinkIdPair = OrderedIdPair<LinkTag>
using JointStateAnyPoly = AnyWrapper<JointState>
using JointStatePtrAnyPoly = AnyWrapper<std::shared_ptr<JointState>>
using LogAttribute = std::variant<bool, std::int64_t, std::uint64_t, double, std::string>
 Scalar value supported by a structured log-record attribute.
using LogAttributes = std::unordered_map<std::string, LogAttribute>
 Collection of structured attributes indexed by attribute name.
using LogRecordHandler = std::function<void(const LogRecord&)>
 Callback invoked for each structured record that passes spdlog filtering.
using LogRecordHandlerId = std::uint64_t
 Opaque identifier assigned to a registered structured-record handler.
using ManipulatorInfoAnyPoly = AnyWrapper<ManipulatorInfo>
using PluginInfoMap = std::map<std::string, PluginInfo>
 A map of PluginInfo to user defined name.
using ProfileDictionaryPtrAnyPoly = tesseract::common::AnyWrapper<std::shared_ptr<ProfileDictionary>>
using SimpleResourceLocatorFn = std::function<std::string(const std::string&)>
template<typename SerializableType>
using TestSerializationCompareFn = std::function<bool(const SerializableType&, const SerializableType&)>

Enumerations

enum class  CollisionMarginPairOverrideType : std::uint8_t { NONE , REPLACE , MODIFY }
 Identifies how the provided contact margin data should be applied. More...
enum class  CombinedContactAllowedValidatorType : std::uint8_t { AND , OR }
 Identify how the two should be combined. More...

Functions

bool operator== (const AllowedCollisionEntries &entries_1, const AllowedCollisionEntries &entries_2)
template<class Archive>
void serialize (Archive &ar, AllowedCollisionMatrix &obj)
std::ostream & operator<< (std::ostream &os, const AllowedCollisionMatrix &acm)
template<class Archive, class T>
void serialize (Archive &ar, AnyWrapper< T > &obj)
template<class Archive>
void serialize (Archive &ar, AnyPoly &obj)
template<class Archive>
void serialize (Archive &ar, CalibrationInfo &obj)
template<class Archive, typename Tag>
std::string save_minimal (const Archive &, const NameId< Tag > &id)
template<class Archive, typename Tag>
void load_minimal (const Archive &, NameId< Tag > &id, const std::string &value)
template<class Archive, typename Tag>
void save (Archive &ar, const OrderedIdPair< Tag > &pair)
 OrderedIdPair archives as its two names, under the same NVPs cereal gives std::pair.
template<class Archive, typename Tag>
void load (Archive &ar, OrderedIdPair< Tag > &pair)
template<class Archive>
void serialize (Archive &ar, CollisionMarginPairData &obj)
template<class Archive>
void serialize (Archive &ar, CollisionMarginData &obj)
template<class Archive>
void serialize (Archive &ar, ACMContactAllowedValidator &obj)
template<class Archive>
void serialize (Archive &ar, CombinedContactAllowedValidator &obj)
template<class Archive>
void serialize (Archive &ar, JointState &obj)
template<class Archive>
void serialize (Archive &ar, JointTrajectory &obj)
template<class Archive>
void serialize (Archive &ar, ManipulatorInfo &obj)
template<class Archive>
void serialize (Archive &ar, KinematicLimits &obj)
template<class Archive>
void serialize (Archive &, Resource &)
template<class Archive>
void serialize (Archive &, GeneralResourceLocator &)
template<class Archive>
void serialize (Archive &ar, SimpleLocatedResource &obj)
template<class Archive>
void serialize (Archive &ar, BytesResource &obj)
template<class Archive>
void save (Archive &ar, const PluginInfo &obj)
template<class Archive>
void load (Archive &ar, PluginInfo &obj)
template<class Archive>
void serialize (Archive &ar, PluginInfoContainer &obj)
template<class Archive>
void serialize (Archive &ar, PluginDiscoveryInfo &obj)
template<class Archive>
void serialize (Archive &ar, ProfilesPluginInfo &obj)
template<class Archive>
void serialize (Archive &ar, KinematicsPluginInfo &obj)
template<class Archive>
void serialize (Archive &ar, ContactManagersPluginInfo &obj)
template<class Archive>
void serialize (Archive &ar, TaskComposerPluginInfo &obj)
template<class Archive>
void serialize (Archive &ar, Profile &obj)
template<class Archive>
void serialize (Archive &ar, ProfileDictionary &obj)
template<typename FloatType>
bool isWithinLimits (const Eigen::Ref< const Eigen::Matrix< FloatType, Eigen::Dynamic, 1 > > &values, const Eigen::Ref< const Eigen::Matrix< FloatType, Eigen::Dynamic, 2 > > &limits)
 Check if within limits.
template<typename FloatType>
bool satisfiesLimits (const Eigen::Ref< const Eigen::Matrix< FloatType, Eigen::Dynamic, 1 > > &values, const Eigen::Ref< const Eigen::Matrix< FloatType, Eigen::Dynamic, 2 > > &limits, const Eigen::Ref< const Eigen::Matrix< FloatType, Eigen::Dynamic, 1 > > &max_diff, const Eigen::Ref< const Eigen::Matrix< FloatType, Eigen::Dynamic, 1 > > &max_rel_diff)
 Check if values are within bounds or relatively equal to a limit.
template<typename FloatType>
bool satisfiesLimits (const Eigen::Ref< const Eigen::Matrix< FloatType, Eigen::Dynamic, 1 > > &values, const Eigen::Ref< const Eigen::Matrix< FloatType, Eigen::Dynamic, 2 > > &limits, FloatType max_diff=static_cast< FloatType >(1e-6), FloatType max_rel_diff=std::numeric_limits< FloatType >::epsilon())
 Check if values is within bounds or relatively equal to a limit.
template<typename FloatType>
void enforceLimits (Eigen::Ref< Eigen::Matrix< FloatType, Eigen::Dynamic, 1 > > values, const Eigen::Ref< const Eigen::Matrix< FloatType, Eigen::Dynamic, 2 > > &limits)
 Enforce values to be within the provided limits.
std::shared_ptr< spdlog::logger > getLogger (std::string_view name="tesseract")
 Get the Tesseract-owned default logger or a registered named logger.
void setLogger (std::shared_ptr< spdlog::logger > logger)
 Replace the default Tesseract logger.
bool isLogLevelEnabled (spdlog::level::level_enum level) noexcept
 Check whether the default Tesseract logger accepts a severity.
LogRecordHandlerId addLogRecordHandler (LogRecordHandler handler)
 Register a callback that receives structured log records.
bool removeLogRecordHandler (LogRecordHandlerId id) noexcept
 Unregister a structured-record callback.
void emitLogRecord (const LogRecord &record) noexcept
 Emit a structured record through its spdlog logger and all registered handlers.
bool writeSimplePlyFile (const std::string &path, const tesseract::common::VectorVector3d &vertices, const std::vector< Eigen::Vector3i > &vectices_color, const Eigen::VectorXi &faces, int num_faces)
 Write a simple ply file given vertices and faces.
bool writeSimplePlyFile (const std::string &path, const tesseract::common::VectorVector3d &vertices, const Eigen::VectorXi &faces, int num_faces)
 Write a simple ply file given vertices and faces.
int loadSimplePlyFile (const std::string &path, tesseract::common::VectorVector3d &vertices, Eigen::VectorXi &faces, bool triangles_only=false)
 Loads a simple ply file given a path.
PropertyTree makePluginInfoContainerSchema (std::string_view factory_base_type)
 Build a PluginInfoContainer schema for the given factory base type.
std::optional< std::pair< std::string, std::size_t > > isSequenceType (std::string_view type)
 Check if type is a sequence.
std::optional< std::pair< std::string, std::string > > isMapType (std::string_view type)
 Check if type is a map.
void validateRequired (const PropertyTree &node, const std::string &path, std::vector< std::string > &errors)
 Validator: ensure 'required' attribute is present and non-null.
void validateEnum (const PropertyTree &node, const std::string &path, std::vector< std::string > &errors)
 Validator: enforce that node's value is in 'enum' list.
void validateStringLength (const PropertyTree &node, const std::string &path, std::vector< std::string > &errors)
 Validator: enforce minimum_length and maximum_length constraints on strings.
void validateMap (const PropertyTree &node, const std::string &path, std::vector< std::string > &errors)
 Validator: ensure node value is of type YAML::NodeType::Map.
void validateSequence (const PropertyTree &node, std::size_t length, const std::string &path, std::vector< std::string > &errors)
 Validator: ensure node value is of type YAML::NodeType::Sequence.
void validateContainer (const PropertyTree &node, const std::string &path, std::vector< std::string > &errors)
 Validator: ensure property is a container of child properties. The property should have children and the value should be null.
void validateCustomType (const PropertyTree &node, const std::string &path, std::vector< std::string > &errors)
 Validator: Retrieve schema for the custom type and run its validators.
void validatePluginInfo (const PropertyTree &node, const std::string &base_type, const std::string &path, std::vector< std::string > &errors)
 Validator: Validate a plugin info structure (class + config) for derived types.
template<typename T>
void validateTypeCast (const PropertyTree &node, const std::string &path, std::vector< std::string > &errors)
 Validate that the node's value can be interpreted as the provided type.
template<typename T>
void validateTypeCastWithRange (const PropertyTree &node, const std::string &path, std::vector< std::string > &errors)
 Validator: type cast and enforce 'minimum'/'maximum' range constraints.
void registerSchema (const std::string &key, const std::string &path)
 Register a schema from a file path.
void registerSchema (const std::string &key, const std::function< PropertyTree()> &fn)
 Register a schema from a function.
void registerSchemaDerivedType (const std::string &base_type, const std::string &derived_type)
 Register that a derived type schema can be used where a base type is expected.
std::size_t nameIdHash (const std::string &name) noexcept
 Hash a name into a NameId value.
std::size_t combineNameIdHash (std::size_t f, std::size_t s) noexcept
 Mix two id values into one bucket hash — the hash of the OrderedIdPair holding them, so a caller can compute a pair's bucket hash without constructing one.
template<typename Tag>
std::ostream & operator<< (std::ostream &os, const NameId< Tag > &id)
 Stream insertion: writes exactly id.name(). Print value() explicitly where the numeric id matters.
template<typename IdT>
std::vector< IdT > toIds (const std::vector< std::string > &names)
 Convert a vector of strings to a vector of NameId<Tag>.
template<typename Container>
std::vector< std::string > toNames (const Container &ids)
 Convert any container of NameId<Tag> to a vector of name strings.
template<typename Tag>
constexpr std::size_t hash_value (const NameId< Tag > &id) noexcept
 ADL hook for boost::hash. Returns the cached id value; no rehash per lookup.
template<typename Tag>
std::size_t hash_value (const OrderedIdPair< Tag > &p) noexcept
 ADL hook for boost::hash. Returns the cached combined hash; no rehash per lookup.
template<typename SerializableType>
bool testSerializationCompareEqual (const SerializableType &a, const SerializableType &b)
template<typename SerializableType>
bool testSerializationComparePtrEqual (const SerializableType &a, const SerializableType &b)
template<typename SerializableType>
void testSerialization (const SerializableType &object, const std::string &typename_string, TestSerializationCompareFn< SerializableType > compare=testSerializationCompareEqual< SerializableType >)
 Tests serialization for a serializable type.
template<typename SerializableTypeBase, typename SerializableTypeDerived>
void testSerializationDerivedClass (const std::shared_ptr< SerializableTypeBase > &object, const std::string &typename_string)
 Tests serialization for a serializable derived type.
template<typename SerializableTypeStored>
void testSerializationAnyPoly (const tesseract::common::AnyPoly &object, const std::string &typename_string, TestSerializationCompareFn< SerializableTypeStored > compare=testSerializationCompareEqual< SerializableTypeStored >)
 Tests serialization for a serializable any poly type.
template<typename... Args>
std::string strFormat (const std::string &format, Args... args)
template<typename T>
void appendBytes (std::vector< std::uint8_t > &buf, const T &value)
 Append the raw bytes of a trivially-copyable value to a byte buffer (native byte order).
template<typename T>
T readBytes (const std::vector< std::uint8_t > &buf, std::size_t &offset)
 Read a trivially-copyable value from a byte buffer at offset, advancing it.
std::string fileToString (const std::filesystem::path &filepath)
 Read in the contents of the file into a string.
void twistChangeRefPoint (Eigen::Ref< Eigen::VectorXd > twist, const Eigen::Ref< const Eigen::Vector3d > &ref_point)
 Change the reference point of the provided Twist.
void twistChangeBase (Eigen::Ref< Eigen::VectorXd > twist, const Eigen::Isometry3d &change_base)
 Change the base coordinate system of the Twist.
void jacobianChangeBase (Eigen::Ref< Eigen::MatrixXd > jacobian, const Eigen::Isometry3d &change_base)
 Change the base coordinate system of the jacobian.
void jacobianChangeRefPoint (Eigen::Ref< Eigen::MatrixXd > jacobian, const Eigen::Ref< const Eigen::Vector3d > &ref_point)
 Change the reference point of the jacobian.
Eigen::VectorXd concat (const Eigen::VectorXd &a, const Eigen::VectorXd &b)
 Concatenate two vector.
Eigen::Vector3d calcRotationalError (const Eigen::Ref< const Eigen::Matrix3d > &R)
 Calculate the rotation error vector given a rotation error matrix where the angle is between [-pi, pi].
Eigen::VectorXd calcTransformError (const Eigen::Isometry3d &t1, const Eigen::Isometry3d &t2)
 Calculate error between two transforms expressed in t1 coordinate system.
Eigen::VectorXd calcJacobianTransformErrorDiff (const Eigen::Isometry3d &target, const Eigen::Isometry3d &source, const Eigen::Isometry3d &source_perturbed)
 Calculate jacobian transform error difference expressed in the target frame coordinate system.
Eigen::VectorXd calcJacobianTransformErrorDiff (const Eigen::Isometry3d &target, const Eigen::Isometry3d &source, const Eigen::Isometry3d &source_perturbed, const Eigen::Ref< const Eigen::VectorXd > &lower_tolerance, const Eigen::Ref< const Eigen::VectorXd > &upper_tolerance)
 Calculate jacobian transform error difference with optional per-component dead-band tolerances.
Eigen::VectorXd calcJacobianTransformErrorDiff (const Eigen::Isometry3d &target, const Eigen::Isometry3d &target_perturbed, const Eigen::Isometry3d &source, const Eigen::Isometry3d &source_perturbed)
 Calculate jacobian transform error difference expressed in the target frame coordinate system.
Eigen::VectorXd calcJacobianTransformErrorDiff (const Eigen::Isometry3d &target, const Eigen::Isometry3d &target_perturbed, const Eigen::Isometry3d &source, const Eigen::Isometry3d &source_perturbed, const Eigen::Ref< const Eigen::VectorXd > &lower_tolerance, const Eigen::Ref< const Eigen::VectorXd > &upper_tolerance)
 Calculate jacobian transform error difference (dynamic target) with optional per-component dead-band tolerances.
void applyTolerances (Eigen::Ref< Eigen::VectorXd > v, const Eigen::Ref< const Eigen::VectorXd > &lower_tolerance, const Eigen::Ref< const Eigen::VectorXd > &upper_tolerance)
 Apply a per-component dead-band tolerance to an error vector in place.
Eigen::Vector4d computeRandomColor ()
 This computes a random color RGBA [0, 1] with alpha set to 1.
void printNestedException (const std::exception &e, int level=0)
 Print a nested exception.
std::string getTempPath ()
 Get the host temp directory path.
bool isNumeric (const std::string &s)
 Determine if a string is a number.
bool isNumeric (const std::vector< std::string > &sv)
 Determine if each string in vector is a number.
Eigen::VectorXd generateRandomNumber (const Eigen::Ref< const Eigen::MatrixX2d > &limits)
 Given a set of limits it will generate a vector of random numbers between the limit.
void ltrim (std::string &s)
 Left trim string.
void rtrim (std::string &s)
 Right trim string.
void trim (std::string &s)
 Trim left and right of string.
template<typename T>
bool isIdentical (const std::vector< T > &vec1, const std::vector< T > &vec2, bool ordered=true, const std::function< bool(const T &, const T &)> &equal_pred=[](const T &v1, const T &v2) { return v1==v2;}, const std::function< bool(const T &, const T &)> &comp=[](const T &v1, const T &v2) { return v1< v2;})
 Check if two vector of strings are identical.
template<typename KeyValueContainerType, typename ValueType>
bool isIdenticalMap (const KeyValueContainerType &map_1, const KeyValueContainerType &map_2, const std::function< bool(const ValueType &, const ValueType &)> &value_eq=[](const ValueType &v1, const ValueType &v2) { return v1==v2;})
 Checks if 2 maps are identical.
template<typename ValueType>
bool isIdenticalSet (const std::set< ValueType > &set_1, const std::set< ValueType > &set_2, const std::function< bool(const ValueType &, const ValueType &)> &value_eq=[](const ValueType &v1, const ValueType &v2) { return v1==v2;})
 Checks if 2 sets are identical.
template<typename ValueType, std::size_t Size>
bool isIdenticalArray (const std::array< ValueType, Size > &array_1, const std::array< ValueType, Size > &array_2, const std::function< bool(const ValueType &, const ValueType &)> &value_eq=[](const ValueType &v1, const ValueType &v2) { return v1==v2;})
 Checks if 2 arrays are identical.
template<typename T>
bool pointersEqual (const std::shared_ptr< T > &p1, const std::shared_ptr< T > &p2)
 Checks if 2 pointers point to objects that are ==.
template<typename T>
bool pointersComparison (const std::shared_ptr< T > &p1, const std::shared_ptr< T > &p2)
 Comparison operator for the objects 2 points point to.
std::string getTimestampString ()
 Get Timestamp string.
void reorder (Eigen::Ref< Eigen::VectorXd > v, std::vector< Eigen::Index > order)
 Reorder Eigen::VectorXd implace given index list.
int QueryStringValue (const tinyxml2::XMLElement *xml_element, std::string &value)
 Query a string value from xml element.
int QueryStringText (const tinyxml2::XMLElement *xml_element, std::string &text)
 Query a string Text from xml element.
int QueryStringValue (const tinyxml2::XMLAttribute *xml_attribute, std::string &value)
 Query a string value from xml attribute.
int QueryStringAttribute (const tinyxml2::XMLElement *xml_element, const char *name, std::string &value)
 Query a string attribute from an xml element.
std::string StringAttribute (const tinyxml2::XMLElement *xml_element, const char *name, std::string default_value)
 Get string attribute if exist. If it does not exist it returns the default value.
int QueryStringAttributeRequired (const tinyxml2::XMLElement *xml_element, const char *name, std::string &value)
 Query a string attribute from an xml element and print error log.
int QueryDoubleAttributeRequired (const tinyxml2::XMLElement *xml_element, const char *name, double &value)
 Query a double attribute from an xml element and print error log.
int QueryIntAttributeRequired (const tinyxml2::XMLElement *xml_element, const char *name, int &value)
 Query a int attribute from an xml element and print error log.
bool almostEqualRelativeAndAbs (double a, double b, double max_diff=1e-6, double max_rel_diff=std::numeric_limits< double >::epsilon())
 Check if two double are relatively equal.
bool almostEqualRelativeAndAbs (const Eigen::Ref< const Eigen::VectorXd > &v1, const Eigen::Ref< const Eigen::VectorXd > &v2, double max_diff=1e-6, double max_rel_diff=std::numeric_limits< double >::epsilon())
 Check if two Eigen VectorXd are relatively and absolute equal.
bool almostEqualRelativeAndAbs (const Eigen::Ref< const Eigen::VectorXd > &v1, const Eigen::Ref< const Eigen::VectorXd > &v2, const Eigen::Ref< const Eigen::VectorXd > &max_diff, const Eigen::Ref< const Eigen::VectorXd > &max_rel_diff)
 Check if two Eigen VectorXd are relatively and absolute equal.
template<typename Scalar>
bool almostEqualRelativeAndAbs (const Eigen::Transform< Scalar, 3, Eigen::Isometry > &a, const Eigen::Transform< Scalar, 3, Eigen::Isometry > &b, std::common_type_t< Scalar > trans_atol=Scalar(1e-10), std::common_type_t< Scalar > trans_rtol=Eigen::NumTraits< Scalar >::dummy_precision(), std::common_type_t< Scalar > rot_tol=Scalar(1e-10)) noexcept
 Test whether two isometries are equal up to numerical noise.
template<typename FloatType>
bool toNumeric (const std::string &s, FloatType &value)
 Convert a string to a numeric value type.
template<class T, class Hash = std::hash<T>, class Eq = std::equal_to<T>>
void removeDuplicates (std::vector< T > &v)
 Remove duplicates and keep first.
std::vector< LinkId > getAllowedCollisions (const std::vector< LinkId > &link_ids, const AllowedCollisionEntries &acm_entries, bool remove_duplicates=true)
 Gets allowed collisions for a set of link ids.
template<typename To, typename From>
To numeric_cast (From value)
 Safely cast a number from one type to another, checking for overflow and underflow.
void processYamlIncludeDirective (YAML::Node &node, const ResourceLocator &locator)
 Recursively expands !include directives in a YAML node, in-place.
YAML::Node loadYamlFile (const std::string &file_path, const ResourceLocator &locator)
 Loads a YAML file and processes !include directives recursively.
YAML::Node loadYamlString (const std::string &yaml_string, const ResourceLocator &locator)
void writeYamlToFile (const YAML::Node &node, const std::string &file_path)
 Writes a YAML::Node to a file.
void checkForUnknownKeys (const YAML::Node &node, const std::set< std::string > &expected_keys)
 Check node map for unknown keys.
std::string toYAMLString (const YAML::Node &node)
 Converts a YAML::Node to a yaml string.
YAML::Node fromYAMLString (const std::string &string)
 Converts yaml string to a YAML::Node.
bool compareYAML (const YAML::Node &node1, const YAML::Node &node2)
 Checks if the YAML::Nodes are identical.
template bool isWithinLimits< float > (const Eigen::Ref< const Eigen::Matrix< float, Eigen::Dynamic, 1 > > &values, const Eigen::Ref< const Eigen::Matrix< float, Eigen::Dynamic, 2 > > &limits)
template bool isWithinLimits< double > (const Eigen::Ref< const Eigen::Matrix< double, Eigen::Dynamic, 1 > > &values, const Eigen::Ref< const Eigen::Matrix< double, Eigen::Dynamic, 2 > > &limits)
template bool satisfiesLimits< float > (const Eigen::Ref< const Eigen::Matrix< float, Eigen::Dynamic, 1 > > &values, const Eigen::Ref< const Eigen::Matrix< float, Eigen::Dynamic, 2 > > &limits, float max_diff, float max_rel_diff)
template bool satisfiesLimits< double > (const Eigen::Ref< const Eigen::Matrix< double, Eigen::Dynamic, 1 > > &values, const Eigen::Ref< const Eigen::Matrix< double, Eigen::Dynamic, 2 > > &limits, double max_diff, double max_rel_diff)
template bool satisfiesLimits< float > (const Eigen::Ref< const Eigen::Matrix< float, Eigen::Dynamic, 1 > > &values, const Eigen::Ref< const Eigen::Matrix< float, Eigen::Dynamic, 2 > > &limits, const Eigen::Ref< const Eigen::Matrix< float, Eigen::Dynamic, 1 > > &max_diff, const Eigen::Ref< const Eigen::Matrix< float, Eigen::Dynamic, 1 > > &max_rel_diff)
template bool satisfiesLimits< double > (const Eigen::Ref< const Eigen::Matrix< double, Eigen::Dynamic, 1 > > &values, const Eigen::Ref< const Eigen::Matrix< double, Eigen::Dynamic, 2 > > &limits, const Eigen::Ref< const Eigen::Matrix< double, Eigen::Dynamic, 1 > > &max_diff, const Eigen::Ref< const Eigen::Matrix< double, Eigen::Dynamic, 1 > > &max_rel_diff)
template void enforceLimits< float > (Eigen::Ref< Eigen::Matrix< float, Eigen::Dynamic, 1 > > values, const Eigen::Ref< const Eigen::Matrix< float, Eigen::Dynamic, 2 > > &limits)
template void enforceLimits< double > (Eigen::Ref< Eigen::Matrix< double, Eigen::Dynamic, 1 > > values, const Eigen::Ref< const Eigen::Matrix< double, Eigen::Dynamic, 2 > > &limits)
std::ostream & operator<< (std::ostream &os, const PropertyTree &tree)
bool isRelativePath (const std::string &url)
std::size_t findSeparator (const std::string &str)
template bool toNumeric< double > (const std::string &, double &)
template bool toNumeric< float > (const std::string &, float &)
template bool toNumeric< int > (const std::string &, int &)
template bool toNumeric< long > (const std::string &, long &)
template bool isIdentical< std::string > (const std::vector< std::string > &, const std::vector< std::string > &, bool, const std::function< bool(const std::string &, const std::string &)> &, const std::function< bool(const std::string &, const std::string &)> &)
template bool isIdentical< Eigen::Index > (const std::vector< Eigen::Index > &, const std::vector< Eigen::Index > &, bool, const std::function< bool(const Eigen::Index &, const Eigen::Index &)> &, const std::function< bool(const Eigen::Index &, const Eigen::Index &)> &)
template<typename E>
std::enable_if_t<!std::is_polymorphic< E >::value > my_rethrow_if_nested (const E &)
template<typename E>
std::enable_if_t< std::is_polymorphic< E >::value > my_rethrow_if_nested (const E &e)
std::pair< Eigen::Vector3d, double > calcRotationalErrorDecomposed (const Eigen::Ref< const Eigen::Matrix3d > &R)
bool operator== (const ProfileDictionary &lhs, const ProfileDictionary &rhs)
bool operator!= (const ProfileDictionary &lhs, const ProfileDictionary &rhs)
template<class Archive>
void serialize (Archive &ar, TestProfile &obj)

Variables

std::mt19937 mersenne { std::random_device{}() }
 Random number generator, one independently seeded instance per thread.

Detailed Description

Namespace owning boost's hash_is_avalanching, and defined iff boost has the trait at all.

Boost gained the trait in 1.81 and moved it out of boost::unordered in 1.89, where the old name survives only as a using-declaration that cannot be specialized.

Typedef Documentation

◆ AlignedUnorderedMap

template<typename Key, typename Value>
using tesseract::common::AlignedUnorderedMap
Initial value:
std::unordered_map<Key,
Value,
std::hash<Key>,
std::equal_to<Key>,
Eigen::aligned_allocator<std::pair<const Key, Value>>>

Enumeration Type Documentation

◆ CollisionMarginPairOverrideType

enum class tesseract::common::CollisionMarginPairOverrideType : std::uint8_t
strong

Identifies how the provided contact margin data should be applied.

Enumerator
NONE 

Do not apply contact margin data.

REPLACE 

Replace the contact manager's CollisionMarginPairData.

MODIFY 

Modify the contact managers pair margins.

This will preserve existing pairs not being modified by the provided margin data. If a pair already exist it will be updated with the provided margin data.

◆ CombinedContactAllowedValidatorType

Identify how the two should be combined.

Enumerator
AND 

Combines the two ContactAllowedValidator with AND operator.

OR 

Combines the two ContactAllowedValidator with OR operator.

Function Documentation

◆ save()

template<class Archive, typename Tag>
void tesseract::common::save ( Archive & ar,
const OrderedIdPair< Tag > & pair )

OrderedIdPair archives as its two names, under the same NVPs cereal gives std::pair.

A container keyed on OrderedIdPair therefore writes the format its string-keyed predecessor wrote, when the key was std::pair<std::string, std::string>. The ids are name hashes and are never written; they are recomputed from the names on load.

The names are emitted lexicographically rather than in the pair's canonical order, which is decided by hash value and so would tie the archive to the hashing implementation.

◆ isWithinLimits()

template<typename FloatType>
bool tesseract::common::isWithinLimits ( const Eigen::Ref< const Eigen::Matrix< FloatType, Eigen::Dynamic, 1 > > & values,
const Eigen::Ref< const Eigen::Matrix< FloatType, Eigen::Dynamic, 2 > > & limits )

Check if within limits.

Parameters
joint_positionsThe values to check
position_limitsThe limits to perform check
Returns

◆ satisfiesLimits() [1/2]

template<typename FloatType>
bool tesseract::common::satisfiesLimits ( const Eigen::Ref< const Eigen::Matrix< FloatType, Eigen::Dynamic, 1 > > & values,
const Eigen::Ref< const Eigen::Matrix< FloatType, Eigen::Dynamic, 2 > > & limits,
const Eigen::Ref< const Eigen::Matrix< FloatType, Eigen::Dynamic, 1 > > & max_diff,
const Eigen::Ref< const Eigen::Matrix< FloatType, Eigen::Dynamic, 1 > > & max_rel_diff )

Check if values are within bounds or relatively equal to a limit.

Parameters
valuesThe values to check
limitsThe limits to perform check
max_diffThe max diff when comparing value to limit value max(abs(value - limit)) <= max_diff, if true they are considered equal
max_rel_diffThe max relative diff between value and limit abs(value - limit) <= largest * max_rel_diff, if true considered equal. The largest is the largest of the absolute values of value and limit.
Returns
True if the all values are within the limits or relatively equal to the limit, otherwise false.

◆ satisfiesLimits() [2/2]

template<typename FloatType>
bool tesseract::common::satisfiesLimits ( const Eigen::Ref< const Eigen::Matrix< FloatType, Eigen::Dynamic, 1 > > & values,
const Eigen::Ref< const Eigen::Matrix< FloatType, Eigen::Dynamic, 2 > > & limits,
FloatType max_diff = static_cast<FloatType>(1e-6),
FloatType max_rel_diff = std::numeric_limits<FloatType>::epsilon() )

Check if values is within bounds or relatively equal to a limit.

Parameters
valuesThe values to check
limitsThe limits to perform check
max_diffThe max diff when comparing value to limit value max(abs(value - limit)) <= max_diff, if true they are considered equal
max_rel_diffThe max relative diff between value and limit abs(value - limit) <= largest * max_rel_diff, if true considered equal. The largest is the largest of the absolute values of value and limit.
Returns
True if the all values are within the limits or relatively equal to the limit, otherwise false.

◆ enforceLimits()

template<typename FloatType>
void tesseract::common::enforceLimits ( Eigen::Ref< Eigen::Matrix< FloatType, Eigen::Dynamic, 1 > > values,
const Eigen::Ref< const Eigen::Matrix< FloatType, Eigen::Dynamic, 2 > > & limits )

Enforce values to be within the provided limits.

Parameters
valuesThe values to enforce bounds on
limitsThe limits to perform check

◆ getLogger()

std::shared_ptr< spdlog::logger > tesseract::common::getLogger ( std::string_view name = "tesseract")

Get the Tesseract-owned default logger or a registered named logger.

The default tesseract logger writes colorized messages to standard error and remains owned by Tesseract if removed from the spdlog registry. A newly created named logger is registered with spdlog and clones the current sinks, formatter, level, error handler, and flush level of the default logger.

Parameters
nameLogger name. An empty name is permitted and follows normal spdlog registry semantics.
Returns
Shared ownership of the selected logger.

◆ setLogger()

void tesseract::common::setLogger ( std::shared_ptr< spdlog::logger > logger)

Replace the default Tesseract logger.

The logger must be non-null and named tesseract. Replace it during single-threaded application startup, before worker threads begin logging; replacement must not run concurrently with logging. Dropping tesseract from the spdlog registry does not replace the logger owned by Tesseract; use this function instead.

Parameters
loggerLogger to install as the default Tesseract logger.
Exceptions
std::invalid_argumentif logger is null or is not named tesseract.

◆ isLogLevelEnabled()

bool tesseract::common::isLogLevelEnabled ( spdlog::level::level_enum level)
noexcept

Check whether the default Tesseract logger accepts a severity.

Use this to guard expensive work needed only to construct a log message. Ordinary messages should use the TESSERACT_LOG_* macros directly.

Parameters
levelNative spdlog severity.
Returns
True when the default logger accepts level.

◆ addLogRecordHandler()

LogRecordHandlerId tesseract::common::addLogRecordHandler ( LogRecordHandler handler)

Register a callback that receives structured log records.

Handlers are invoked synchronously after the record has been written to its spdlog sinks. Exceptions thrown by a handler are isolated and do not escape the logging call or prevent later handlers from running.

Parameters
handlerCallback to register.
Returns
A nonzero identifier for a valid callback, or zero when handler is empty.

◆ removeLogRecordHandler()

bool tesseract::common::removeLogRecordHandler ( LogRecordHandlerId id)
noexcept

Unregister a structured-record callback.

Removal prevents a handler that has not yet started from being called by an in-flight dispatch and waits for callbacks already running on other threads to return. When called by the handler itself, removal returns without waiting for the current callback. State captured by a handler must remain valid until any callback that has already started has returned.

Parameters
idIdentifier returned by addLogRecordHandler().
Returns
True when a registered handler was removed; otherwise false.

◆ emitLogRecord()

void tesseract::common::emitLogRecord ( const LogRecord & record)
noexcept

Emit a structured record through its spdlog logger and all registered handlers.

Records rejected by the selected logger's native spdlog level are discarded before sink or handler dispatch. Structured attributes are appended to the spdlog message in deterministic key order. Logging and handler failures are contained and do not escape this function.

Parameters
recordRecord to emit.

◆ writeSimplePlyFile() [1/2]

bool tesseract::common::writeSimplePlyFile ( const std::string & path,
const tesseract::common::VectorVector3d & vertices,
const std::vector< Eigen::Vector3i > & vectices_color,
const Eigen::VectorXi & faces,
int num_faces )

Write a simple ply file given vertices and faces.

Parameters
pathThe file path
verticesA vector of vertices
vertices_colorThe vertices color (0-255,0-255,0-255), if empty uses a default color
facesThe first values indicates the number of vertices that define the face followed by the vertice index
num_facesThe number of faces
Returns
False if failed to write file, otherwise true

◆ writeSimplePlyFile() [2/2]

bool tesseract::common::writeSimplePlyFile ( const std::string & path,
const tesseract::common::VectorVector3d & vertices,
const Eigen::VectorXi & faces,
int num_faces )

Write a simple ply file given vertices and faces.

Parameters
pathThe file path
verticesA vector of vertices
facesThe first values indicates the number of vertices that define the face followed by the vertice index
num_facesThe number of faces
Returns
False if failed to write file, otherwise true

◆ loadSimplePlyFile()

int tesseract::common::loadSimplePlyFile ( const std::string & path,
tesseract::common::VectorVector3d & vertices,
Eigen::VectorXi & faces,
bool triangles_only = false )

Loads a simple ply file given a path.

Parameters
pathThe file path
verticesA vector of vertices
facesThe first values indicates the number of vertices that define the face followed by the vertice index
triangles_onlyConvert to only include triangles
Returns
Number of faces, If returned 0 it failed to load.

◆ makePluginInfoContainerSchema()

PropertyTree tesseract::common::makePluginInfoContainerSchema ( std::string_view factory_base_type)

Build a PluginInfoContainer schema for the given factory base type.

Parameters
factory_base_typeFully-qualified factory base class name.
Returns
A PropertyTree with { default (string), plugins (Map of derived types) }.

◆ isSequenceType()

std::optional< std::pair< std::string, std::size_t > > tesseract::common::isSequenceType ( std::string_view type)

Check if type is a sequence.

Parameters
typeThe type to check
Returns
If it is a sequence, the underlying type is returned and size

◆ isMapType()

std::optional< std::pair< std::string, std::string > > tesseract::common::isMapType ( std::string_view type)

Check if type is a map.

Parameters
typeThe type to check
Returns
If it is a map, the underlying pair<key,type> is returned

◆ validateRequired()

void tesseract::common::validateRequired ( const PropertyTree & node,
const std::string & path,
std::vector< std::string > & errors )

Validator: ensure 'required' attribute is present and non-null.

Parameters
nodeNode to validate.
pathDot-separated path for error messages.
errorsOutput vector to append errors to.

◆ validateEnum()

void tesseract::common::validateEnum ( const PropertyTree & node,
const std::string & path,
std::vector< std::string > & errors )

Validator: enforce that node's value is in 'enum' list.

Parameters
nodeNode to validate.
pathDot-separated path for error messages.
errorsOutput vector to append errors to.

◆ validateStringLength()

void tesseract::common::validateStringLength ( const PropertyTree & node,
const std::string & path,
std::vector< std::string > & errors )

Validator: enforce minimum_length and maximum_length constraints on strings.

Parameters
nodeNode to validate.
pathDot-separated path for error messages.
errorsOutput vector to append errors to.

◆ validateMap()

void tesseract::common::validateMap ( const PropertyTree & node,
const std::string & path,
std::vector< std::string > & errors )

Validator: ensure node value is of type YAML::NodeType::Map.

Parameters
nodeNode to validate.
pathDot-separated path for error messages.
errorsOutput vector to append errors to.

◆ validateSequence()

void tesseract::common::validateSequence ( const PropertyTree & node,
std::size_t length,
const std::string & path,
std::vector< std::string > & errors )

Validator: ensure node value is of type YAML::NodeType::Sequence.

Parameters
nodeNode to validate.
lengthThe length if fixed size. If zero, it is considered dynamic size sequence.
pathDot-separated path for error messages.
errorsOutput vector to append errors to.

◆ validateContainer()

void tesseract::common::validateContainer ( const PropertyTree & node,
const std::string & path,
std::vector< std::string > & errors )

Validator: ensure property is a container of child properties. The property should have children and the value should be null.

Parameters
nodeNode to validate.
pathDot-separated path for error messages.
errorsOutput vector to append errors to.

◆ validateCustomType()

void tesseract::common::validateCustomType ( const PropertyTree & node,
const std::string & path,
std::vector< std::string > & errors )

Validator: Retrieve schema for the custom type and run its validators.

Parameters
nodeNode to validate.
pathDot-separated path for error messages.
errorsOutput vector to append errors to.

◆ validatePluginInfo()

void tesseract::common::validatePluginInfo ( const PropertyTree & node,
const std::string & base_type,
const std::string & path,
std::vector< std::string > & errors )

Validator: Validate a plugin info structure (class + config) for derived types.

Parameters
nodeNode to validate (should contain 'class' and 'config' fields).
base_typeThe base type name to check against.
pathDot-separated path for error messages.
errorsOutput vector to append errors to.

◆ validateTypeCast()

template<typename T>
void tesseract::common::validateTypeCast ( const PropertyTree & node,
const std::string & path,
std::vector< std::string > & errors )

Validate that the node's value can be interpreted as the provided type.

Parameters
nodePropertyTree node whose value to validate.
pathDot-separated path for error messages.
errorsOutput vector to append errors to.

◆ validateTypeCastWithRange()

template<typename T>
void tesseract::common::validateTypeCastWithRange ( const PropertyTree & node,
const std::string & path,
std::vector< std::string > & errors )

Validator: type cast and enforce 'minimum'/'maximum' range constraints.

Parameters
nodeNode to validate.
pathDot-separated path for error messages.
errorsOutput vector to append errors to.

◆ registerSchema() [1/2]

void tesseract::common::registerSchema ( const std::string & key,
const std::string & path )

Register a schema from a file path.

Parameters
keyUnique identifier for this schema.
pathPath to a .yaml schema file.

◆ registerSchema() [2/2]

void tesseract::common::registerSchema ( const std::string & key,
const std::function< PropertyTree()> & fn )

Register a schema from a function.

Parameters
keyUnique identifier for this schema.
fnFunction that returns a PropertyTree schema.

◆ registerSchemaDerivedType()

void tesseract::common::registerSchemaDerivedType ( const std::string & base_type,
const std::string & derived_type )

Register that a derived type schema can be used where a base type is expected.

Parameters
base_typeThe base type name
derived_typeThe derived type name

◆ nameIdHash()

std::size_t tesseract::common::nameIdHash ( const std::string & name)
nodiscardnoexcept

Hash a name into a NameId value.

boost::hash<std::string>, which is avalanching and identical on every platform. Defined out of line so this header stays free of boost includes.

◆ combineNameIdHash()

std::size_t tesseract::common::combineNameIdHash ( std::size_t f,
std::size_t s )
nodiscardnoexcept

Mix two id values into one bucket hash — the hash of the OrderedIdPair holding them, so a caller can compute a pair's bucket hash without constructing one.

boost::hash_combine over the two values. Defined out of line so this header stays free of boost includes.

◆ testSerialization()

template<typename SerializableType>
void tesseract::common::testSerialization ( const SerializableType & object,
const std::string & typename_string,
TestSerializationCompareFn< SerializableType > compare = testSerializationCompareEqual<SerializableType> )

Tests serialization for a serializable type.

Serializes the type to XML file, binary file, and XML string. It then deserializes it and calls the equality operator on the results

Parameters
objectObject to be serialized
typename_stringPrefix used for filepaths. Serialized files are put in /tmp/<typename_string>.<extension>

◆ testSerializationDerivedClass()

template<typename SerializableTypeBase, typename SerializableTypeDerived>
void tesseract::common::testSerializationDerivedClass ( const std::shared_ptr< SerializableTypeBase > & object,
const std::string & typename_string )

Tests serialization for a serializable derived type.

Serializes the type to XML file, binary file, and XML string using the base type. It then deserializes it, casts it to the derived type, and calls the equality operator on the results

Parameters
objectBase class pointer to the object to be serialized
typename_stringPrefix used for filepaths. Serialized files are put in /tmp/<typename_string>.<extension>

◆ testSerializationAnyPoly()

template<typename SerializableTypeStored>
void tesseract::common::testSerializationAnyPoly ( const tesseract::common::AnyPoly & object,
const std::string & typename_string,
TestSerializationCompareFn< SerializableTypeStored > compare = testSerializationCompareEqual<SerializableTypeStored> )

Tests serialization for a serializable any poly type.

Serializes the type to XML file, binary file, and XML string using the base type. It then deserializes it, casts it to the derived type, and calls the equality operator on the results

Parameters
objectBase class pointer to the object to be serialized
typename_stringPrefix used for filepaths. Serialized files are put in /tmp/<typename_string>.<extension>

◆ appendBytes()

template<typename T>
void tesseract::common::appendBytes ( std::vector< std::uint8_t > & buf,
const T & value )

Append the raw bytes of a trivially-copyable value to a byte buffer (native byte order).

A small primitive for hand-rolled binary serialization; pairs with readBytes.

◆ readBytes()

template<typename T>
T tesseract::common::readBytes ( const std::vector< std::uint8_t > & buf,
std::size_t & offset )

Read a trivially-copyable value from a byte buffer at offset, advancing it.

Inverse of appendBytes.

Exceptions
std::runtime_errorif the buffer has fewer than sizeof(T) bytes remaining.

◆ fileToString()

std::string tesseract::common::fileToString ( const std::filesystem::path & filepath)

Read in the contents of the file into a string.

Parameters
filepathThe file to read
Returns
The contents of the file

◆ twistChangeRefPoint()

void tesseract::common::twistChangeRefPoint ( Eigen::Ref< Eigen::VectorXd > twist,
const Eigen::Ref< const Eigen::Vector3d > & ref_point )

Change the reference point of the provided Twist.

Parameters
twistThe current Twist which gets modified in place
ref_pointIs expressed in the same base frame of the Twist and is a vector from the old point to the new point.

◆ twistChangeBase()

void tesseract::common::twistChangeBase ( Eigen::Ref< Eigen::VectorXd > twist,
const Eigen::Isometry3d & change_base )

Change the base coordinate system of the Twist.

Parameters
twistThe current Twist which gets modified in place
change_baseThe transform from the desired frame to the current base frame of the Twist

◆ jacobianChangeBase()

void tesseract::common::jacobianChangeBase ( Eigen::Ref< Eigen::MatrixXd > jacobian,
const Eigen::Isometry3d & change_base )

Change the base coordinate system of the jacobian.

Parameters
jacobianThe current Jacobian which gets modified in place
change_baseThe transform from the desired frame to the current base frame of the jacobian

◆ jacobianChangeRefPoint()

void tesseract::common::jacobianChangeRefPoint ( Eigen::Ref< Eigen::MatrixXd > jacobian,
const Eigen::Ref< const Eigen::Vector3d > & ref_point )

Change the reference point of the jacobian.

Parameters
jacobianThe current Jacobian which gets modified in place
ref_pointIs expressed in the same base frame of the jacobian and is a vector from the old point to the new point.

◆ calcRotationalError()

Eigen::Vector3d tesseract::common::calcRotationalError ( const Eigen::Ref< const Eigen::Matrix3d > & R)

Calculate the rotation error vector given a rotation error matrix where the angle is between [-pi, pi].

This should be used only for calculating the error. Do not use for numerically calculating jacobians because it breaks down a -PI and PI

Parameters
Rrotation error matrix
Returns
Rotation error vector = Eigen::AngleAxisd.axis() * Eigen::AngleAxisd.angle()

◆ calcTransformError()

Eigen::VectorXd tesseract::common::calcTransformError ( const Eigen::Isometry3d & t1,
const Eigen::Isometry3d & t2 )

Calculate error between two transforms expressed in t1 coordinate system.

Warning
This should not be used to calculate numerical jacobian, see calcJacobianTransformErrorDiff
Parameters
t1Target Transform
t2Current Transform
Returns
error [Position, calcRotationalError(Angle Axis)]

◆ calcJacobianTransformErrorDiff() [1/4]

Eigen::VectorXd tesseract::common::calcJacobianTransformErrorDiff ( const Eigen::Isometry3d & target,
const Eigen::Isometry3d & source,
const Eigen::Isometry3d & source_perturbed )

Calculate jacobian transform error difference expressed in the target frame coordinate system.

This is used when the target is a fixed frame in the environment. Handles the angle-axis ±π discontinuity by computing err and perturbed_err in coordination.

Parameters
targetThe desired transform to express the transform error difference in
sourceThe current location of the source transform
source_perturbedThe perturbed location of the source transform
Returns
The change in error represented in the target frame

◆ calcJacobianTransformErrorDiff() [2/4]

Eigen::VectorXd tesseract::common::calcJacobianTransformErrorDiff ( const Eigen::Isometry3d & target,
const Eigen::Isometry3d & source,
const Eigen::Isometry3d & source_perturbed,
const Eigen::Ref< const Eigen::VectorXd > & lower_tolerance,
const Eigen::Ref< const Eigen::VectorXd > & upper_tolerance )

Calculate jacobian transform error difference with optional per-component dead-band tolerances.

Same behavior as the 3-argument overload; additionally, after the paired ±π/sign correction the err and perturbed_err vectors are clamped inside [lower_tolerance, upper_tolerance] before the subtraction. Both tolerance vectors must be size 6, or both empty for raw finite-difference behavior.

Parameters
targetThe desired transform to express the transform error difference in
sourceThe current location of the source transform
source_perturbedThe perturbed location of the source transform
lower_tolerancePer-component dead-band lower bound (size 6, or empty for no-op)
upper_tolerancePer-component dead-band upper bound (same size constraints as lower_tolerance)
Returns
The change in error represented in the target frame

◆ calcJacobianTransformErrorDiff() [3/4]

Eigen::VectorXd tesseract::common::calcJacobianTransformErrorDiff ( const Eigen::Isometry3d & target,
const Eigen::Isometry3d & target_perturbed,
const Eigen::Isometry3d & source,
const Eigen::Isometry3d & source_perturbed )

Calculate jacobian transform error difference expressed in the target frame coordinate system.

This is used when the target and source are both dynamic links. Handles the angle-axis ±π discontinuity by computing err and perturbed_err in coordination.

Parameters
targetThe desired transform to express the transform error difference in
target_perturbedThe perturbed location of the target transform
sourceThe current location of the source transform
source_perturbedThe perturbed location of the source transform
Returns
The change in error represented in the target frame

◆ calcJacobianTransformErrorDiff() [4/4]

Eigen::VectorXd tesseract::common::calcJacobianTransformErrorDiff ( const Eigen::Isometry3d & target,
const Eigen::Isometry3d & target_perturbed,
const Eigen::Isometry3d & source,
const Eigen::Isometry3d & source_perturbed,
const Eigen::Ref< const Eigen::VectorXd > & lower_tolerance,
const Eigen::Ref< const Eigen::VectorXd > & upper_tolerance )

Calculate jacobian transform error difference (dynamic target) with optional per-component dead-band tolerances.

Same behavior as the 4-argument overload; additionally, after the paired ±π/sign correction the err and perturbed_err vectors are clamped inside [lower_tolerance, upper_tolerance] before the subtraction. Both tolerance vectors must be size 6, or both empty for raw finite-difference behavior.

Parameters
targetThe desired transform to express the transform error difference in
target_perturbedThe perturbed location of the target transform
sourceThe current location of the source transform
source_perturbedThe perturbed location of the source transform
lower_tolerancePer-component dead-band lower bound (size 6, or empty for no-op)
upper_tolerancePer-component dead-band upper bound (same size constraints as lower_tolerance)
Returns
The change in error represented in the target frame

◆ applyTolerances()

void tesseract::common::applyTolerances ( Eigen::Ref< Eigen::VectorXd > v,
const Eigen::Ref< const Eigen::VectorXd > & lower_tolerance,
const Eigen::Ref< const Eigen::VectorXd > & upper_tolerance )

Apply a per-component dead-band tolerance to an error vector in place.

Each component is clamped to zero inside [lower(i), upper(i)], shifted by v(i) - lower(i) below the band, and v(i) - upper(i) above. The function is a no-op only when both lower_tolerance and upper_tolerance are empty. When non-empty, both tolerance vectors must match v in size; otherwise std::runtime_error is thrown. A non-empty paired with an empty tolerance is treated as a size mismatch and throws.

Parameters
vThe vector to clamp in place
lower_tolerancePer-component lower bound (size must equal v.size(), or empty when paired with an empty upper_tolerance for a no-op)
upper_tolerancePer-component upper bound (same size constraints as lower_tolerance)

◆ computeRandomColor()

Eigen::Vector4d tesseract::common::computeRandomColor ( )

This computes a random color RGBA [0, 1] with alpha set to 1.

Returns
A random RGBA color

◆ printNestedException()

void tesseract::common::printNestedException ( const std::exception & e,
int level = 0 )

Print a nested exception.

Parameters
eThe exception to print
levelThe exception level which controls the indentation

◆ getTempPath()

std::string tesseract::common::getTempPath ( )

Get the host temp directory path.

Returns
The host temp directory path

◆ isNumeric() [1/2]

bool tesseract::common::isNumeric ( const std::string & s)

Determine if a string is a number.

Parameters
sThe string to evaluate
Returns
True if numeric, otherwise false.

◆ isNumeric() [2/2]

bool tesseract::common::isNumeric ( const std::vector< std::string > & sv)

Determine if each string in vector is a number.

Parameters
svThe vector of strings to evaluate
Returns
True if all strings are numeric, otherwise false.

◆ generateRandomNumber()

Eigen::VectorXd tesseract::common::generateRandomNumber ( const Eigen::Ref< const Eigen::MatrixX2d > & limits)

Given a set of limits it will generate a vector of random numbers between the limit.

Parameters
limitsThe limits to generated numbers based on.
Returns
A vector of random numbers between the provided limits.

◆ ltrim()

void tesseract::common::ltrim ( std::string & s)

Left trim string.

Parameters
sThe string to left trim

◆ rtrim()

void tesseract::common::rtrim ( std::string & s)

Right trim string.

Parameters
sThe string to right trim

◆ trim()

void tesseract::common::trim ( std::string & s)

Trim left and right of string.

Parameters
sThe string to trim

◆ isIdentical()

template<typename T>
bool tesseract::common::isIdentical ( const std::vector< T > & vec1,
const std::vector< T > & vec2,
bool ordered = true,
const std::function< bool(const T &, const T &)> & equal_pred = [](const T& v1, const T& v2) { return v1 == v2; },
const std::function< bool(const T &, const T &)> & comp = [](const T& v1, const T& v2) { return v1 < v2; } )

Check if two vector of strings are identical.

Parameters
vec1Vector strings
vec2Vector strings
orderedIf true order is relavent, othwise if false order is not relavent
equal_predBinary predicate passed into std::equals to determine if an element is equal. Useful for vectors of pointers
compBinary function passed into std::sort. Only used it ordered == false. Useful for vectors of pointers

◆ isIdenticalMap()

template<typename KeyValueContainerType, typename ValueType>
bool tesseract::common::isIdenticalMap ( const KeyValueContainerType & map_1,
const KeyValueContainerType & map_2,
const std::function< bool(const ValueType &, const ValueType &)> & value_eq = [](const ValueType& v1, const ValueType& v2) { return v1 == v2; } )

Checks if 2 maps are identical.

Parameters
map_1First map
map_2Second map
Returns
True if they are identical

◆ isIdenticalSet()

template<typename ValueType>
bool tesseract::common::isIdenticalSet ( const std::set< ValueType > & set_1,
const std::set< ValueType > & set_2,
const std::function< bool(const ValueType &, const ValueType &)> & value_eq = [](const ValueType& v1, const ValueType& v2) { return v1 == v2; } )

Checks if 2 sets are identical.

Parameters
map_1First map
map_2Second map
Returns
True if they are identical

◆ isIdenticalArray()

template<typename ValueType, std::size_t Size>
bool tesseract::common::isIdenticalArray ( const std::array< ValueType, Size > & array_1,
const std::array< ValueType, Size > & array_2,
const std::function< bool(const ValueType &, const ValueType &)> & value_eq = [](const ValueType& v1, const ValueType& v2) { return v1 == v2; } )

Checks if 2 arrays are identical.

Parameters
array_1First array
array_2Second array
Returns
True if they are identical

◆ pointersEqual()

template<typename T>
bool tesseract::common::pointersEqual ( const std::shared_ptr< T > & p1,
const std::shared_ptr< T > & p2 )

Checks if 2 pointers point to objects that are ==.

Parameters
p1First pointer
p2Second pointer
Returns
True if the objects are == or both pointers are nullptr

◆ pointersComparison()

template<typename T>
bool tesseract::common::pointersComparison ( const std::shared_ptr< T > & p1,
const std::shared_ptr< T > & p2 )

Comparison operator for the objects 2 points point to.

Parameters
p1First pointer
p2Second pointer
Returns
True if *p1 < *p2 and neither is nullptr. Non-nullptr is considered > than nullptr

◆ getTimestampString()

std::string tesseract::common::getTimestampString ( )

Get Timestamp string.

Returns
Timestamp string

◆ reorder()

void tesseract::common::reorder ( Eigen::Ref< Eigen::VectorXd > v,
std::vector< Eigen::Index > order )

Reorder Eigen::VectorXd implace given index list.

Parameters
vThe vector to reorder
orderA vector of index which define the new order

◆ QueryStringValue() [1/2]

int tesseract::common::QueryStringValue ( const tinyxml2::XMLElement * xml_element,
std::string & value )

Query a string value from xml element.

Parameters
xml_elementThe xml element to query string from
valueThe value to update from the xml element
Returns
tinyxml2::XML_SUCCESS if successful, otherwise returns tinyxml2::XML_NO_ATTRIBUTE

◆ QueryStringText()

int tesseract::common::QueryStringText ( const tinyxml2::XMLElement * xml_element,
std::string & text )

Query a string Text from xml element.

Parameters
xml_elementThe xml element to query string from
testThe value to update from the xml element
Returns
tinyxml2::XML_SUCCESS if successful, otherwise returns tinyxml2::XML_NO_ATTRIBUTE

◆ QueryStringValue() [2/2]

int tesseract::common::QueryStringValue ( const tinyxml2::XMLAttribute * xml_attribute,
std::string & value )

Query a string value from xml attribute.

Parameters
xml_attributeThe xml attribute to query string from
valueThe value to update from the xml attribute
Returns
tinyxml2::XML_SUCCESS if successful, otherwise returns tinyxml2::XML_WRONG_ATTRIBUTE_TYPE

◆ QueryStringAttribute()

int tesseract::common::QueryStringAttribute ( const tinyxml2::XMLElement * xml_element,
const char * name,
std::string & value )

Query a string attribute from an xml element.

Parameters
xml_elementThe xml attribute to query attribute
nameThe name of the attribute to query
valueThe value to update from the xml attribute
Returns
tinyxml2::XML_SUCCESS if successful, otherwise returns tinyxml2::XML_NO_ATTRIBUTE or tinyxml2::XML_WRONG_ATTRIBUTE_TYPE

◆ StringAttribute()

std::string tesseract::common::StringAttribute ( const tinyxml2::XMLElement * xml_element,
const char * name,
std::string default_value )

Get string attribute if exist. If it does not exist it returns the default value.

Parameters
xml_elementThe xml element to attempt to parse attribute
nameThe name of the attribute
default_valueThe default value to return if attribute does not exist
Returns
Parsed string attribute or default value if attribute does not exist.

◆ QueryStringAttributeRequired()

int tesseract::common::QueryStringAttributeRequired ( const tinyxml2::XMLElement * xml_element,
const char * name,
std::string & value )

Query a string attribute from an xml element and print error log.

This is the same QueryStringAttribute but it will print out error messages for the failure conditions so the user only needs to check for the tinyxml2::XML_SUCCESS since it is a required attribute.

Parameters
xml_elementThe xml attribute to query attribute
nameThe name of the attribute to query
valueThe value to update from the xml attribute
Returns
tinyxml2::XML_SUCCESS if successful, otherwise returns tinyxml2::XML_NO_ATTRIBUTE or tinyxml2::XML_WRONG_ATTRIBUTE_TYPE

◆ QueryDoubleAttributeRequired()

int tesseract::common::QueryDoubleAttributeRequired ( const tinyxml2::XMLElement * xml_element,
const char * name,
double & value )

Query a double attribute from an xml element and print error log.

This is the same QueryDoubleAttribute but it will print out error messages for the failure conditions so the user only needs to check for the tinyxml2::XML_SUCCESS since it is a required attribute.

Parameters
xml_elementThe xml attribute to query attribute
nameThe name of the attribute to query
valueThe value to update from the xml attribute
Returns
tinyxml2::XML_SUCCESS if successful, otherwise returns tinyxml2::XML_NO_ATTRIBUTE or tinyxml2::XML_WRONG_ATTRIBUTE_TYPE

◆ QueryIntAttributeRequired()

int tesseract::common::QueryIntAttributeRequired ( const tinyxml2::XMLElement * xml_element,
const char * name,
int & value )

Query a int attribute from an xml element and print error log.

This is the same QueryIntAttribute but it will print out error messages for the failure conditions so the user only needs to check for the tinyxml2::XML_SUCCESS since it is a required attribute.

Parameters
xml_elementThe xml attribute to query attribute
nameThe name of the attribute to query
valueThe value to update from the xml attribute
Returns
tinyxml2::XML_SUCCESS if successful, otherwise returns tinyxml2::XML_NO_ATTRIBUTE or tinyxml2::XML_WRONG_ATTRIBUTE_TYPE

◆ almostEqualRelativeAndAbs() [1/4]

bool tesseract::common::almostEqualRelativeAndAbs ( double a,
double b,
double max_diff = 1e-6,
double max_rel_diff = std::numeric_limits<double>::epsilon() )

Check if two double are relatively equal.

The max_diff is for handling when comparing numbers near zero

Parameters
aDouble
bDouble
max_diffThe max diff when comparing std::abs(a - b) <= max_diff, if true they are considered equal
max_rel_diffThe max relative diff std::abs(a - b) <= largest * max_rel_diff, if true considered equal. The largest is the largest of the absolute values of a and b.
Returns
True if they are relatively equal, otherwise false.

◆ almostEqualRelativeAndAbs() [2/4]

bool tesseract::common::almostEqualRelativeAndAbs ( const Eigen::Ref< const Eigen::VectorXd > & v1,
const Eigen::Ref< const Eigen::VectorXd > & v2,
double max_diff = 1e-6,
double max_rel_diff = std::numeric_limits<double>::epsilon() )

Check if two Eigen VectorXd are relatively and absolute equal.

This is a vectorized implementation of the function above. The max_diff is for handling when comparing numbers near zero

Parameters
aA vector of double
bA vector of double
max_diffThe max diff when comparing max(abs(a - b)) <= max_diff, if true they are considered equal
max_rel_diffThe max relative diff abs(a - b) <= largest * max_rel_diff, if true considered equal. The largest is the largest of the absolute values of a and b.
Returns
True if they are relatively equal, otherwise false.

◆ almostEqualRelativeAndAbs() [3/4]

bool tesseract::common::almostEqualRelativeAndAbs ( const Eigen::Ref< const Eigen::VectorXd > & v1,
const Eigen::Ref< const Eigen::VectorXd > & v2,
const Eigen::Ref< const Eigen::VectorXd > & max_diff,
const Eigen::Ref< const Eigen::VectorXd > & max_rel_diff )

Check if two Eigen VectorXd are relatively and absolute equal.

This is a vectorized implementation of the function above. The max_diff is for handling when comparing numbers near zero

Parameters
aA vector of double
bA vector of double
max_diffThe max diff when comparing max(abs(a - b)) <= max_diff, if true they are considered equal
max_rel_diffThe max relative diff abs(a - b) <= largest * max_rel_diff, if true considered equal. The largest is the largest of the absolute values of a and b.
Returns
True if they are relatively equal, otherwise false.

◆ almostEqualRelativeAndAbs() [4/4]

template<typename Scalar>
bool tesseract::common::almostEqualRelativeAndAbs ( const Eigen::Transform< Scalar, 3, Eigen::Isometry > & a,
const Eigen::Transform< Scalar, 3, Eigen::Isometry > & b,
std::common_type_t< Scalar > trans_atol = Scalar(1e-10),
std::common_type_t< Scalar > trans_rtol = Eigen::NumTraits<Scalar>::dummy_precision(),
std::common_type_t< Scalar > rot_tol = Scalar(1e-10) )
noexcept

Test whether two isometries are equal up to numerical noise.

Translation: ||ta - tb|| <= max(trans_atol, trans_rtol * max(||ta||, ||tb||)) Rotation: angle(Ra^T Rb) <= rot_tol (via ||Ra - Rb||_F^2 = 8 sin^2(theta/2) ~ 2 theta^2, relative error theta^2/12)

Frame-invariant, symmetric in a/b, well-defined at the origin, sqrt-free. Any NaN yields false. Requires linear() of both inputs to be a proper rotation (checked in debug builds; a non-finite linear part is left to the NaN path). Defaults are tuned for double at robot-cell scale; float callers should pass their own.

◆ toNumeric()

template<typename FloatType>
bool tesseract::common::toNumeric ( const std::string & s,
FloatType & value )

Convert a string to a numeric value type.

Parameters
sThe string to be converted
valueThe value to be loaded with converted string
Returns
True if successful, otherwise false

◆ removeDuplicates()

template<class T, class Hash = std::hash<T>, class Eq = std::equal_to<T>>
void tesseract::common::removeDuplicates ( std::vector< T > & v)

Remove duplicates and keep first.

Parameters
vThe vector to remove duplicates from

◆ getAllowedCollisions()

std::vector< LinkId > tesseract::common::getAllowedCollisions ( const std::vector< LinkId > & link_ids,
const AllowedCollisionEntries & acm_entries,
bool remove_duplicates = true )

Gets allowed collisions for a set of link ids.

Parameters
link_idsVector of LinkIds for which we want the allowed collisions
acm_entriesEntries in the ACM. Get this with AllowedCollisionMatrix::getAllAllowedCollisions()
remove_duplicatesIf true, duplicates will be removed. Default: true
Returns
vector of LinkIds that are allowed to collide with the links given

◆ numeric_cast()

template<typename To, typename From>
To tesseract::common::numeric_cast ( From value)

Safely cast a number from one type to another, checking for overflow and underflow.

Template Parameters
ToThe target type
FromThe source type
Parameters
valueThe value to cast
Returns
The casted value
Exceptions
std::underflow_errorif casting a negative signed value to an unsigned type
std::overflow_errorif the value is out of the target type's range

◆ processYamlIncludeDirective()

void tesseract::common::processYamlIncludeDirective ( YAML::Node & node,
const ResourceLocator & locator )

Recursively expands !include directives in a YAML node, in-place.

This function walks the given node and:

  • When it encounters a node tagged !include, it loads the referenced file (via the provided ResourceLocator), replaces the tagged node with the parsed content of that file, clears the !include tag, and then continues processing the newly loaded subtree.
  • When it encounters a mapping, it recurses into each value in-place.
  • When it encounters a sequence, it recurses into each element in-place.

After this call returns, node and its entire subtree will have had all !include directives resolved and removed. Subsequent calls on the same expanded tree are no-ops.

Parameters
nodeThe YAML node to process. Must be non-const so it can be mutated in-place as includes are expanded.
locatorThe locator used to resolve file paths or URLs for !include directives. May maintain internal state (e.g. cache) between calls.
Exceptions
std::runtime_errorif an !include tag is not a scalar string, or if the specified file cannot be located or loaded.

◆ loadYamlFile()

YAML::Node tesseract::common::loadYamlFile ( const std::string & file_path,
const ResourceLocator & locator )

Loads a YAML file and processes !include directives recursively.

This function loads a YAML file and replaces any node tagged with !include with the content of the specified file. It handles nested !include directives and works with both maps and sequences.

Parameters
file_pathThe path to the YAML file/url to be loaded.
locatorThe locator used to resolve urls and relative file paths.
Returns
A YAML::Node object containing the fully processed YAML structure.
Exceptions
std::runtime_errorif an !include tag is used improperly (e.g., not scalar), or if a file specified in an !include directive cannot be loaded.

◆ writeYamlToFile()

void tesseract::common::writeYamlToFile ( const YAML::Node & node,
const std::string & file_path )

Writes a YAML::Node to a file.

Parameters
nodeThe YAML::Node to write.
file_pathThe path to the output file.
Exceptions
std::runtime_errorif the file cannot be opened.

◆ checkForUnknownKeys()

void tesseract::common::checkForUnknownKeys ( const YAML::Node & node,
const std::set< std::string > & expected_keys )

Check node map for unknown keys.

Parameters
nodeThe node to check
expected_keysThe expected keys

◆ toYAMLString()

std::string tesseract::common::toYAMLString ( const YAML::Node & node)

Converts a YAML::Node to a yaml string.

Parameters
nodeInput node
Returns
String containing the yaml

◆ fromYAMLString()

YAML::Node tesseract::common::fromYAMLString ( const std::string & string)

Converts yaml string to a YAML::Node.

Parameters
stringInput string containing the yaml
Returns
Resulting YAML::Node

◆ compareYAML()

bool tesseract::common::compareYAML ( const YAML::Node & node1,
const YAML::Node & node2 )

Checks if the YAML::Nodes are identical.

The == operator checks if they reference the same memory. This checks if they contain the same information

Parameters
node1Input YAML::Node
node2Input YAML::Node

Variable Documentation

◆ mersenne

std::mt19937 tesseract::common::mersenne { std::random_device{}() }
inlinethread_local

Random number generator, one independently seeded instance per thread.

Seeding affects only the calling thread. On Windows each DLL additionally gets its own instance, so a seed set in one module does not reach draws made in another.