Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
Namespaces | Functions
utils.cpp File Reference

Common Tesseract Utility Functions. More...

#include <tesseract_common/macros.h>
#include <ctime>
#include <string>
#include <type_traits>
#include <console_bridge/console.h>
#include <fstream>
#include <tesseract_common/utils.h>
Include dependency graph for utils.cpp:

Namespaces

namespace  tesseract_common
 

Functions

template bool tesseract_common::toNumeric< double > (const std::string &, double &)
 
template bool tesseract_common::toNumeric< float > (const std::string &, float &)
 
template bool tesseract_common::toNumeric< int > (const std::string &, int &)
 
template bool tesseract_common::toNumeric< long > (const std::string &, long &)
 
template bool tesseract_common::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 tesseract_common::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 >::valuetesseract_common::my_rethrow_if_nested (const E &)
 
template<typename E >
std::enable_if_t< std::is_polymorphic< E >::valuetesseract_common::my_rethrow_if_nested (const E &e)
 
std::string tesseract_common::fileToString (const tesseract_common::fs::path &filepath)
 Read in the contents of the file into a string. More...
 
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. More...
 
void tesseract_common::twistChangeBase (Eigen::Ref< Eigen::VectorXd > twist, const Eigen::Isometry3d &change_base)
 Change the base coordinate system of the Twist. More...
 
void tesseract_common::jacobianChangeBase (Eigen::Ref< Eigen::MatrixXd > jacobian, const Eigen::Isometry3d &change_base)
 Change the base coordinate system of the jacobian. More...
 
void tesseract_common::jacobianChangeRefPoint (Eigen::Ref< Eigen::MatrixXd > jacobian, const Eigen::Ref< const Eigen::Vector3d > &ref_point)
 Change the reference point of the jacobian. More...
 
Eigen::VectorXd tesseract_common::concat (const Eigen::VectorXd &a, const Eigen::VectorXd &b)
 Concatenate two vector. More...
 
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]. More...
 
Eigen::Vector3d tesseract_common::calcRotationalError2 (const Eigen::Ref< const Eigen::Matrix3d > &R)
 Calculate the rotation error vector given a rotation error matrix where the angle is between [0, 2 * pi]. More...
 
Eigen::VectorXd tesseract_common::calcTransformError (const Eigen::Isometry3d &t1, const Eigen::Isometry3d &t2)
 Calculate error between two transforms expressed in t1 coordinate system. More...
 
Eigen::Vector4d tesseract_common::computeRandomColor ()
 This computes a random color RGBA [0, 1] with alpha set to 1. More...
 
void tesseract_common::printNestedException (const std::exception &e, int level=0)
 Print a nested exception. More...
 
std::string tesseract_common::getTempPath ()
 Get the host temp directory path. More...
 
bool tesseract_common::isNumeric (const std::string &s)
 Determine if a string is a number. More...
 
bool tesseract_common::isNumeric (const std::vector< std::string > &sv)
 Determine if each string in vector is a number. More...
 
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. More...
 
void tesseract_common::ltrim (std::string &s)
 Left trim string. More...
 
void tesseract_common::rtrim (std::string &s)
 Right trim string. More...
 
void tesseract_common::trim (std::string &s)
 Trim left and right of string. More...
 
std::string tesseract_common::getTimestampString ()
 Get Timestamp string. More...
 
void tesseract_common::reorder (Eigen::Ref< Eigen::VectorXd > v, std::vector< Eigen::Index > order)
 Reorder Eigen::VectorXd implace given index list. More...
 
tinyxml2::XMLError tesseract_common::QueryStringValue (const tinyxml2::XMLElement *xml_element, std::string &value)
 Query a string value from xml element. More...
 
tinyxml2::XMLError tesseract_common::QueryStringText (const tinyxml2::XMLElement *xml_element, std::string &text)
 Query a string Text from xml element. More...
 
tinyxml2::XMLError tesseract_common::QueryStringValue (const tinyxml2::XMLAttribute *xml_attribute, std::string &value)
 Query a string value from xml attribute. More...
 
tinyxml2::XMLError tesseract_common::QueryStringAttribute (const tinyxml2::XMLElement *xml_element, const char *name, std::string &value)
 Query a string attribute from an xml element. More...
 
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. More...
 
tinyxml2::XMLError 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. More...
 
tinyxml2::XMLError 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. More...
 
tinyxml2::XMLError 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. More...
 
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. More...
 
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. More...
 
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. More...
 
std::vector< std::string > tesseract_common::getAllowedCollisions (const std::vector< std::string > &link_names, const AllowedCollisionEntries &acm_entries, bool remove_duplicates=true)
 Gets allowed collisions for a set of link names. More...
 

Detailed Description

Common Tesseract Utility Functions.

Author
Levi Armstrong
Date
January 18, 2018
Version
TODO
Bug:
No known bugs
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.