All Classes Namespaces Files Functions Variables Typedefs Friends Macros Groups Pages
Classes | Typedefs | Functions | Variables
sdf Namespace Reference

namespace for Simulation Description Format parser More...

Classes

class  AssertionInternalError
 Class for generating Exceptions which come from sdf assertions. More...
 
class  Color
 Defines a color. More...
 
class  Console
 Message, error, warning, and logging functionality. More...
 
class  ConsolePrivate
 
class  Converter
 Convert from one version of SDF to another. More...
 
class  Element
 SDF Element class. More...
 
class  ElementPrivate
 
class  Exception
 Class for generating exceptions. More...
 
class  ExceptionPrivate
 
class  Inertia
 A class for inertial information about a link. More...
 
class  InternalError
 Class for generating Internal Gazebo Errors: those errors which should never happend and represent programming bugs. More...
 
class  Param
 A parameter class. More...
 
class  ParamPrivate
 
class  SDF
 Base SDF class. More...
 
class  SDFExtension
 
class  SDFPrivate
 Private data for base SDF class. More...
 
class  Time
 A Time class, can be used to hold wall- or sim-time. More...
 
class  URDF2SDF
 URDF to SDF converter. More...
 

Typedefs

typedef std::shared_ptr< ConsoleConsolePtr
 
typedef std::shared_ptr< ElementElementPtr
 
typedef std::vector< ElementPtrElementPtr_V
 
typedef std::weak_ptr< ElementElementWeakPtr
 
typedef std::vector< ParamPtrParam_V
 
typedef std::shared_ptr< ParamParamPtr
 
typedef std::shared_ptr< SDFSDFPtr
 

Functions

SDFORMAT_VISIBLE void addNestedModel (ElementPtr _sdf, ElementPtr _includeSDF)
 
SDFORMAT_VISIBLE void addURIPath (const std::string &_uri, const std::string &_path)
 Associate paths to a URI. More...
 
SDFORMAT_VISIBLE bool convertFile (const std::string &_filename, const std::string &_version, SDFPtr _sdf)
 Convert an SDF file to a specific SDF version. More...
 
SDFORMAT_VISIBLE bool convertString (const std::string &_sdfString, const std::string &_version, SDFPtr _sdf)
 Convert an SDF string to a specific SDF version. More...
 
void copyChildren (ElementPtr _sdf, TiXmlElement *_xml)
 
template<typename T >
bool equal (const T &_a, const T &_b, const T &_epsilon=1e-6f)
 check if two values are equal, within a tolerance More...
 
SDFORMAT_VISIBLE std::string findFile (const std::string &_filename, bool _searchLocalPath=true, bool _useCallback=false)
 Find the absolute path of a file. More...
 
std::string getBestSupportedModelVersion (TiXmlElement *_modelXML, std::string &_modelFileName)
 Get the best SDF version from models supported by this sdformat. More...
 
SDFORMAT_VISIBLE std::string getModelFilePath (const std::string &_modelDirPath)
 Get the file path to the model file. More...
 
SDFORMAT_VISIBLE bool init (SDFPtr _sdf)
 Init based on the installed sdf_format.xml file. More...
 
bool initDoc (TiXmlDocument *_xmlDoc, SDFPtr _sdf)
 Initialize the SDF interface using a TinyXML document. More...
 
bool initDoc (TiXmlDocument *_xmlDoc, ElementPtr _sdf)
 Initialize and SDF Element using a TinyXML document. More...
 
SDFORMAT_VISIBLE bool initFile (const std::string &_filename, SDFPtr _sdf)
 Initialize the SDF interface using a file. More...
 
SDFORMAT_VISIBLE bool initFile (const std::string &_filename, ElementPtr _sdf)
 Initialize and SDFElement interface using a file. More...
 
SDFORMAT_VISIBLE bool initString (const std::string &_xmlString, SDFPtr _sdf)
 Initialize the SDF interface using a string. More...
 
bool initXml (TiXmlElement *_xml, ElementPtr _sdf)
 For internal use only. Do not use this function. More...
 
bool readDoc (TiXmlDocument *_xmlDoc, SDFPtr _sdf, const std::string &_source, bool _convert=true)
 Populate the SDF values from a TinyXML document. More...
 
bool readDoc (TiXmlDocument *_xmlDoc, ElementPtr _sdf, const std::string &_source, bool _convert=true)
 
SDFORMAT_VISIBLE bool readFile (const std::string &_filename, SDFPtr _sdf)
 Populate the SDF values from a file. More...
 
SDFORMAT_VISIBLE bool readString (const std::string &_xmlString, SDFPtr _sdf)
 Populate the SDF values from a string. More...
 
SDFORMAT_VISIBLE bool readString (const std::string &_xmlString, ElementPtr _sdf)
 Populate the SDF values from a string. More...
 
bool readXml (TiXmlElement *_xml, ElementPtr _sdf)
 For internal use only. Do not use this function. More...
 
SDFORMAT_VISIBLE void setFindCallback (std::function< std::string(const std::string &)> _cb)
 Set the callback to use when SDF can't find a file. More...
 
SDFORMAT_VISIBLE const char * winGetEnv (const char *_name)
 Windows equivalent of getEnv. More...
 

Variables

class SDFORMAT_VISIBLE Element
 
class SDFORMAT_VISIBLE Param
 
class SDFORMAT_VISIBLE SDF
 

Detailed Description

namespace for Simulation Description Format parser

Typedef Documentation

typedef std::shared_ptr<Element> sdf::ElementPtr
typedef std::vector<ElementPtr> sdf::ElementPtr_V
typedef std::weak_ptr<Element> sdf::ElementWeakPtr
typedef std::vector<ParamPtr> sdf::Param_V
typedef std::shared_ptr<Param> sdf::ParamPtr
typedef std::shared_ptr<SDF> sdf::SDFPtr

Function Documentation

SDFORMAT_VISIBLE void sdf::addNestedModel ( ElementPtr  _sdf,
ElementPtr  _includeSDF 
)
SDFORMAT_VISIBLE bool sdf::convertFile ( const std::string &  _filename,
const std::string &  _version,
SDFPtr  _sdf 
)

Convert an SDF file to a specific SDF version.

Parameters
[in]_filenameName of the SDF file to convert.
[in]_versionVersion to convert _filename to.
[out]_sdfPointer to the converted SDF document.
Returns
True on success.
SDFORMAT_VISIBLE bool sdf::convertString ( const std::string &  _sdfString,
const std::string &  _version,
SDFPtr  _sdf 
)

Convert an SDF string to a specific SDF version.

Parameters
[in]_sdfStringThe SDF string to convert.
[in]_versionVersion to convert _filename to.
[out]_sdfPointer to the converted SDF document.
Returns
True on success.
void sdf::copyChildren ( ElementPtr  _sdf,
TiXmlElement *  _xml 
)
template<typename T >
bool sdf::equal ( const T &  _a,
const T &  _b,
const T &  _epsilon = 1e-6f 
)
inline

check if two values are equal, within a tolerance

Parameters
[in]_athe first value
[in]_bthe second value
[in]_epsilonthe tolerance

Referenced by sdf::Color::operator==().

std::string sdf::getBestSupportedModelVersion ( TiXmlElement *  _modelXML,
std::string &  _modelFileName 
)

Get the best SDF version from models supported by this sdformat.

Parameters
[in]_modelXMLXML element from config file pointing to the model XML tag
[out]_modelFileNamefile name of the best model file
Returns
string with the best SDF version supported
SDFORMAT_VISIBLE std::string sdf::getModelFilePath ( const std::string &  _modelDirPath)

Get the file path to the model file.

Parameters
[in]_modelDirPathdirectory system path of the model
Returns
string with the full filesystem path to the best version (greater SDF protocol supported by this sdformat version) of the .sdf model files hosted by _modelDirPath.
SDFORMAT_VISIBLE bool sdf::init ( SDFPtr  _sdf)

Init based on the installed sdf_format.xml file.

bool sdf::initDoc ( TiXmlDocument *  _xmlDoc,
SDFPtr  _sdf 
)

Initialize the SDF interface using a TinyXML document.

bool sdf::initDoc ( TiXmlDocument *  _xmlDoc,
ElementPtr  _sdf 
)

Initialize and SDF Element using a TinyXML document.

SDFORMAT_VISIBLE bool sdf::initFile ( const std::string &  _filename,
SDFPtr  _sdf 
)

Initialize the SDF interface using a file.

SDFORMAT_VISIBLE bool sdf::initFile ( const std::string &  _filename,
ElementPtr  _sdf 
)

Initialize and SDFElement interface using a file.

SDFORMAT_VISIBLE bool sdf::initString ( const std::string &  _xmlString,
SDFPtr  _sdf 
)

Initialize the SDF interface using a string.

bool sdf::initXml ( TiXmlElement *  _xml,
ElementPtr  _sdf 
)

For internal use only. Do not use this function.

bool sdf::readDoc ( TiXmlDocument *  _xmlDoc,
SDFPtr  _sdf,
const std::string &  _source,
bool  _convert = true 
)

Populate the SDF values from a TinyXML document.

bool sdf::readDoc ( TiXmlDocument *  _xmlDoc,
ElementPtr  _sdf,
const std::string &  _source,
bool  _convert = true 
)
SDFORMAT_VISIBLE bool sdf::readFile ( const std::string &  _filename,
SDFPtr  _sdf 
)

Populate the SDF values from a file.

This populates the given sdf pointer from a file. If the file is a URDF file it is converted to SDF first. All files are converted to the latest SDF version

SDFORMAT_VISIBLE bool sdf::readString ( const std::string &  _xmlString,
SDFPtr  _sdf 
)

Populate the SDF values from a string.

This populates the sdf pointer from a string. If the string is a URDF string it is converted to SDF first. All string are converted to the latest SDF version

SDFORMAT_VISIBLE bool sdf::readString ( const std::string &  _xmlString,
ElementPtr  _sdf 
)

Populate the SDF values from a string.

This populates the sdf pointer from a string. If the string is a URDF string it is converted to SDF first. All strings are converted to the latest SDF version

bool sdf::readXml ( TiXmlElement *  _xml,
ElementPtr  _sdf 
)

For internal use only. Do not use this function.

SDFORMAT_VISIBLE const char* sdf::winGetEnv ( const char *  _name)

Windows equivalent of getEnv.

Should only be called when using windows.

Parameters
[in]_nameName of the environment variable to get.
Returns
Environment variable contents, or NULL on error.

Variable Documentation