Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
Functions
tesseract_urdf_common_unit.h File Reference
#include <tesseract_common/macros.h>
#include <fstream>
#include <iostream>
#include <vector>
#include <gtest/gtest.h>
#include <console_bridge/console.h>
#include <tinyxml2.h>
#include <tesseract_common/resource_locator.h>
#include <tesseract_common/utils.h>
#include <tesseract_urdf/urdf_parser.h>
#include <tesseract_support/tesseract_support_resource_locator.h>
Include dependency graph for tesseract_urdf_common_unit.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename ElementType >
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP bool runTest (ElementType &type, std::function< ElementType(const tinyxml2::XMLElement *, const int)> func, const std::string &xml_string, const std::string &element_name, int version)
 
template<typename ElementType >
bool runTest (ElementType &type, std::function< ElementType(const tinyxml2::XMLElement *, const tesseract_common::ResourceLocator &, bool, const int)> func, const std::string &xml_string, const std::string &element_name, const tesseract_common::ResourceLocator &locator, int version, bool visual)
 
template<typename ElementType >
bool runTest (ElementType &type, std::function< ElementType(const tinyxml2::XMLElement *, const tesseract_common::ResourceLocator &, const int)> func, const std::string &xml_string, const std::string &element_name, const tesseract_common::ResourceLocator &locator, int version)
 
template<typename ElementType >
bool runTest (ElementType &type, std::function< ElementType(const tinyxml2::XMLElement *, const tesseract_common::ResourceLocator &, std::unordered_map< std::string, tesseract_scene_graph::Material::Ptr > &, const int)> func, const std::string &xml_string, const std::string &element_name, const tesseract_common::ResourceLocator &locator, std::unordered_map< std::string, tesseract_scene_graph::Material::Ptr > &available_materials, int version)
 
template<typename ElementType >
bool runTest (ElementType &type, std::function< ElementType(const tinyxml2::XMLElement *, std::unordered_map< std::string, tesseract_scene_graph::Material::Ptr > &, bool, const int)> func, const std::string &xml_string, const std::string &element_name, std::unordered_map< std::string, tesseract_scene_graph::Material::Ptr > &available_materials, int version, const bool visual)
 
std::string stripNewline (const std::string &in)
 stripNewline - For some reason, tinyxml2 printers add a trailing newline. This function removes it. More...
 
std::string toString (const tinyxml2::XMLElement *element)
 
template<typename TessType >
int writeTest (TessType &type, std::function< tinyxml2::XMLElement *(const TessType &, tinyxml2::XMLDocument &)> func, std::string &text)
 writeTest - test write functions More...
 
template<typename TessType >
int writeTest (TessType &type, std::function< tinyxml2::XMLElement *(const TessType &, tinyxml2::XMLDocument &, const std::string &)> func, std::string &text, const std::string &directory)
 writeTest - test write functions for links More...
 
template<typename TessType >
int writeTest (TessType &type, std::function< tinyxml2::XMLElement *(const TessType &, tinyxml2::XMLDocument &, const std::string &, const std::string &)> func, std::string &text, const std::string &directory, const std::string &filename)
 writeTest - test write functions for meshes More...
 
template<typename TessType >
int writeTest (TessType &type, std::function< tinyxml2::XMLElement *(const TessType &, tinyxml2::XMLDocument &, const std::string &, const std::string &, const int)> func, std::string &text, const std::string &directory, const std::string &link_name, const int id)
 writeTest - test write functions for collision and visual geometries More...
 
void writeTextToFile (const std::string &path, const std::string &text)
 

Function Documentation

◆ runTest() [1/5]

template<typename ElementType >
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP bool runTest ( ElementType &  type,
std::function< ElementType(const tinyxml2::XMLElement *, const int)>  func,
const std::string &  xml_string,
const std::string &  element_name,
int  version 
)

◆ runTest() [2/5]

template<typename ElementType >
bool runTest ( ElementType &  type,
std::function< ElementType(const tinyxml2::XMLElement *, const tesseract_common::ResourceLocator &, bool, const int)>  func,
const std::string &  xml_string,
const std::string &  element_name,
const tesseract_common::ResourceLocator locator,
int  version,
bool  visual 
)

◆ runTest() [3/5]

template<typename ElementType >
bool runTest ( ElementType &  type,
std::function< ElementType(const tinyxml2::XMLElement *, const tesseract_common::ResourceLocator &, const int)>  func,
const std::string &  xml_string,
const std::string &  element_name,
const tesseract_common::ResourceLocator locator,
int  version 
)

◆ runTest() [4/5]

template<typename ElementType >
bool runTest ( ElementType &  type,
std::function< ElementType(const tinyxml2::XMLElement *, const tesseract_common::ResourceLocator &, std::unordered_map< std::string, tesseract_scene_graph::Material::Ptr > &, const int)>  func,
const std::string &  xml_string,
const std::string &  element_name,
const tesseract_common::ResourceLocator locator,
std::unordered_map< std::string, tesseract_scene_graph::Material::Ptr > &  available_materials,
int  version 
)

◆ runTest() [5/5]

template<typename ElementType >
bool runTest ( ElementType &  type,
std::function< ElementType(const tinyxml2::XMLElement *, std::unordered_map< std::string, tesseract_scene_graph::Material::Ptr > &, bool, const int)>  func,
const std::string &  xml_string,
const std::string &  element_name,
std::unordered_map< std::string, tesseract_scene_graph::Material::Ptr > &  available_materials,
int  version,
const bool  visual 
)

◆ stripNewline()

std::string stripNewline ( const std::string &  in)
inline

stripNewline - For some reason, tinyxml2 printers add a trailing newline. This function removes it.

Parameters
in- input string
Returns
out - string equal to input string with trailing newlines removed.

◆ toString()

std::string toString ( const tinyxml2::XMLElement *  element)
inline

◆ writeTest() [1/4]

template<typename TessType >
int writeTest ( TessType &  type,
std::function< tinyxml2::XMLElement *(const TessType &, tinyxml2::XMLDocument &)>  func,
std::string &  text 
)

writeTest - test write functions

Parameters
type- object of type being tested
func- function to write object to URDF-XML
text- xml text generated
Returns
0 if success, 1 if exception thrown, 2 if nullptr generated

◆ writeTest() [2/4]

template<typename TessType >
int writeTest ( TessType &  type,
std::function< tinyxml2::XMLElement *(const TessType &, tinyxml2::XMLDocument &, const std::string &)>  func,
std::string &  text,
const std::string &  directory 
)

writeTest - test write functions for links

Parameters
type- object of type being tested
func- function to write object to URDF-XML
text- xml text generated
directory- directory to save files
Returns
0 if success, 1 if exception thrown, 2 if nullptr generated

◆ writeTest() [3/4]

template<typename TessType >
int writeTest ( TessType &  type,
std::function< tinyxml2::XMLElement *(const TessType &, tinyxml2::XMLDocument &, const std::string &, const std::string &)>  func,
std::string &  text,
const std::string &  directory,
const std::string &  filename 
)

writeTest - test write functions for meshes

Parameters
type- object of type being tested
func- function to write object to URDF-XML
text- xml text generated
directory- directory to save files
filename- name of link to which geometry is attached
Returns
0 if success, 1 if exception thrown, 2 if nullptr generated

◆ writeTest() [4/4]

template<typename TessType >
int writeTest ( TessType &  type,
std::function< tinyxml2::XMLElement *(const TessType &, tinyxml2::XMLDocument &, const std::string &, const std::string &, const int)>  func,
std::string &  text,
const std::string &  directory,
const std::string &  link_name,
const int  id 
)

writeTest - test write functions for collision and visual geometries

Parameters
type- object of type being tested
func- function to write object to URDF-XML
text- xml text generated
directory- directory to save files
link_name- name of link to which geometry is attached
id- index of this geometry in list
Returns
0 if success, 1 if exception thrown, 2 if nullptr generated

◆ writeTextToFile()

void writeTextToFile ( const std::string &  path,
const std::string &  text 
)
inline