Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
sdf::v9 Namespace Reference

Namespaces

 filesystem
 

Classes

class  Actor
 Provides a description of an actor. More...
 
class  AirPressure
 AirPressure contains information about a general purpose fluid pressure sensor. More...
 
class  Altimeter
 Altimeter contains information about an altimeter sensor. More...
 
class  Animation
 Animation in Actor. More...
 
class  AssertionInternalError
 Class for generating Exceptions which come from sdf assertions. More...
 
class  Atmosphere
 The Atmosphere class contains information about an atmospheric model and related parameters such as temperature and pressure at sea level. More...
 
class  Box
 Box represents a box shape, and is usually accessed through a Geometry. More...
 
class  Camera
 Information about a monocular camera sensor. More...
 
class  Collision
 A collision element descibes the collision properties associated with a link. More...
 
class  Color
 Defines a color. More...
 
class  Console
 Message, error, warning, and logging functionality. More...
 
class  ConsolePrivate
 
class  Contact
 Contact information for a surface. More...
 
class  Cylinder
 Cylinder represents a cylinder shape, and is usually accessed through a Geometry. More...
 
class  Element
 SDF Element class. More...
 
class  ElementPrivate
 
class  Error
 
class  Exception
 Class for generating exceptions. More...
 
class  Frame
 A Frame element descibes the properties associated with an explicit frame defined in a Model or World. More...
 
class  Geometry
 Geometry provides access to a shape, such as a Box. More...
 
class  Gui
 
class  Heightmap
 Heightmap represents a shape defined by a 2D field, and is usually accessed through a Geometry. More...
 
class  HeightmapBlend
 Blend information to be used between textures on heightmaps. More...
 
class  HeightmapTexture
 Texture to be used on heightmaps. More...
 
class  Imu
 Imu contains information about an imu sensor. More...
 
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  Joint
 
class  JointAxis
 Parameters related to the axis of rotation for rotational joints, and the axis of translation for prismatic joints. More...
 
class  Lidar
 Lidar contains information about a Lidar sensor. More...
 
class  Light
 Provides a description of a light source. More...
 
class  Link
 
class  Magnetometer
 Magnetometer contains information about a magnetometer sensor. More...
 
class  Material
 This class contains visual material properties. More...
 
class  Mesh
 Mesh represents a mesh shape, and is usually accessed through a Geometry. More...
 
class  Model
 
class  Noise
 The Noise class contains information about a noise model, such as a Gaussian distribution. More...
 
class  Param
 A parameter class. More...
 
class  ParamPrivate
 
struct  ParamStreamer
 
class  Pbr
 This class provides access to Physically-Based-Rendering (PBR) material workflows. More...
 
class  PbrWorkflow
 This class contains Physically-Based-Rendering (PBR) workflow properties. More...
 
class  Physics
 The physics element specifies the type and properties of a dynamics engine. More...
 
class  Plane
 Plane represents a plane shape, and is usually accessed through a Geometry. More...
 
class  Root
 Root class that acts as an entry point to the SDF document model. More...
 
class  Scene
 
class  SDF
 Base SDF class. More...
 
class  SemanticPose
 SemanticPose is a data structure that can be used by different DOM objects to resolve poses on a PoseRelativeToGraph. More...
 
class  Sky
 
class  Sphere
 Sphere represents a sphere shape, and is usually accessed through a Geometry. More...
 
class  Surface
 Surface information for a collision. More...
 
class  Time
 A Time class, can be used to hold wall- or sim-time. More...
 
class  Trajectory
 Trajectory for Animation. More...
 
class  Visual
 
class  Waypoint
 Waypoint for Trajectory. More...
 
class  World
 

Typedefs

typedef std::shared_ptr< ConsoleConsolePtr
 
typedef std::shared_ptr< ElementElementPtr
 
typedef std::vector< ElementPtrElementPtr_V
 
typedef std::weak_ptr< ElementElementWeakPtr
 
using Errors = std::vector< Error >
 A vector of Error. More...
 
typedef std::vector< ParamPtrParam_V
 
typedef std::shared_ptr< ParamParamPtr
 
typedef std::shared_ptr< SDFSDFPtr
 

Enumerations

enum  AtmosphereType { AtmosphereType::ADIABATIC = 0 }
 The set of atmosphere model types. More...
 
enum  ErrorCode {
  ErrorCode::NONE = 0, ErrorCode::FILE_READ, ErrorCode::DUPLICATE_NAME, ErrorCode::RESERVED_NAME,
  ErrorCode::ATTRIBUTE_MISSING, ErrorCode::ATTRIBUTE_INVALID, ErrorCode::ATTRIBUTE_DEPRECATED, ErrorCode::ELEMENT_MISSING,
  ErrorCode::ELEMENT_INVALID, ErrorCode::ELEMENT_DEPRECATED, ErrorCode::ELEMENT_INCORRECT_TYPE, ErrorCode::URI_INVALID,
  ErrorCode::URI_LOOKUP, ErrorCode::DIRECTORY_NONEXISTANT, ErrorCode::MODEL_CANONICAL_LINK_INVALID, ErrorCode::MODEL_WITHOUT_LINK,
  ErrorCode::NESTED_MODELS_UNSUPPORTED, ErrorCode::LINK_INERTIA_INVALID, ErrorCode::JOINT_CHILD_LINK_INVALID, ErrorCode::JOINT_PARENT_LINK_INVALID,
  ErrorCode::JOINT_PARENT_SAME_AS_CHILD, ErrorCode::FRAME_ATTACHED_TO_INVALID, ErrorCode::FRAME_ATTACHED_TO_CYCLE, ErrorCode::FRAME_ATTACHED_TO_GRAPH_ERROR,
  ErrorCode::POSE_RELATIVE_TO_INVALID, ErrorCode::POSE_RELATIVE_TO_CYCLE, ErrorCode::POSE_RELATIVE_TO_GRAPH_ERROR, ErrorCode::STRING_READ
}
 Set of error codes. More...
 
enum  GeometryType {
  GeometryType::EMPTY = 0, GeometryType::BOX = 1, GeometryType::CYLINDER = 2, GeometryType::PLANE = 3,
  GeometryType::SPHERE = 4, GeometryType::MESH = 5, GeometryType::HEIGHTMAP = 6
}
 The set of geometry types. More...
 
enum  JointType {
  JointType::INVALID = 0, JointType::BALL = 1, JointType::CONTINUOUS = 2, JointType::FIXED = 3,
  JointType::GEARBOX = 4, JointType::PRISMATIC = 5, JointType::REVOLUTE = 6, JointType::REVOLUTE2 = 7,
  JointType::SCREW = 8, JointType::UNIVERSAL = 9
}
 The set of joint types. More...
 
enum  LightType { LightType::INVALID = 0, LightType::POINT = 1, LightType::SPOT = 2, LightType::DIRECTIONAL = 3 }
 The set of light types. More...
 
enum  NoiseType { NoiseType::NONE = 0, NoiseType::GAUSSIAN = 1, NoiseType::GAUSSIAN_QUANTIZED = 2 }
 The set of noise types. More...
 
enum  NormalMapSpace : int { NormalMapSpace::TANGENT = 0, NormalMapSpace::OBJECT = 1 }
 Space the normal map is defined in. More...
 
enum  PbrWorkflowType : int { PbrWorkflowType::NONE = 0, PbrWorkflowType::METAL = 1, PbrWorkflowType::SPECULAR = 2 }
 Type of PBR workflow. More...
 
enum  PixelFormatType {
  PixelFormatType::UNKNOWN_PIXEL_FORMAT = 0, PixelFormatType::L_INT8, PixelFormatType::L_INT16, PixelFormatType::RGB_INT8,
  PixelFormatType::RGBA_INT8, PixelFormatType::BGRA_INT8, PixelFormatType::RGB_INT16, PixelFormatType::RGB_INT32,
  PixelFormatType::BGR_INT8, PixelFormatType::BGR_INT16, PixelFormatType::BGR_INT32, PixelFormatType::R_FLOAT16,
  PixelFormatType::RGB_FLOAT16, PixelFormatType::R_FLOAT32, PixelFormatType::RGB_FLOAT32, PixelFormatType::BAYER_RGGB8,
  PixelFormatType::BAYER_BGGR8, PixelFormatType::BAYER_GBRG8, PixelFormatType::BAYER_GRBG8
}
 The set of pixel formats. More...
 
enum  ShaderType : int { ShaderType::PIXEL = 0, ShaderType::VERTEX = 1, ShaderType::NORMAL_MAP_OBJECTSPACE = 2, ShaderType::NORMAL_MAP_TANGENTSPACE = 3 }
 

Functions

SDFORMAT_VISIBLE void addNestedModel (ElementPtr _sdf, ElementPtr _includeSDF)
 Copy the contents of the first model element from one ElementPtr to another ElementPtr, prepending the copied model name with :: to link and joint names, and apply the model pose to the copied link poses. More...
 
SDFORMAT_VISIBLE void addNestedModel (ElementPtr _sdf, ElementPtr _includeSDF, Errors &_errors)
 Copy the contents of the first model element from one ElementPtr to another ElementPtr, prepending the copied model name with :: to link and joint names, and apply the model pose to the copied link poses. More...
 
SDFORMAT_VISIBLE void addURIPath (const std::string &_uri, const std::string &_path)
 Associate paths to a URI. More...
 
SDFORMAT_VISIBLE bool checkCanonicalLinkNames (const sdf::Root *_root)
 Check that for each model, the canonical_link attribute value matches the name of a link in the model if the attribute is set and not empty. More...
 
SDFORMAT_VISIBLE bool checkFrameAttachedToGraph (const sdf::Root *_root)
 For the world and each model, check that the attached_to graphs build without errors and have no cycles. More...
 
SDFORMAT_VISIBLE bool checkFrameAttachedToNames (const sdf::Root *_root)
 Check that for each frame, the attached_to attribute value does not match its own frame name but does match the name of a link, joint, or other frame in the model if the attribute is set and not empty. More...
 
SDFORMAT_VISIBLE bool checkJointParentChildLinkNames (const sdf::Root *_root)
 Check that all joints in contained models specify parent and child link names that match the names of sibling links. More...
 
SDFORMAT_VISIBLE bool checkPoseRelativeToGraph (const sdf::Root *_root)
 For the world and each model, check that the attached_to graphs build without errors and have no cycles. 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...
 
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...
 
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...
 
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 an SDFElement interface using a file. More...
 
SDFORMAT_VISIBLE bool initString (const std::string &_xmlString, SDFPtr _sdf)
 Initialize the SDF interface using a string. More...
 
std::string SDFORMAT_VISIBLE lowercase (const std::string &_in)
 Transforms a string to its lowercase equivalent. More...
 
template<class T >
std::ostream & operator<< (std::ostream &os, ParamStreamer< T > s)
 
template<class... Ts>
std::ostream & operator<< (std::ostream &os, ParamStreamer< std::variant< Ts... >> sv)
 
template<class T >
 ParamStreamer (T) -> ParamStreamer< T >
 
SDFORMAT_VISIBLE sdf::SDFPtr readFile (const std::string &_filename)
 Populate the SDF values from a file. More...
 
SDFORMAT_VISIBLE sdf::SDFPtr readFile (const std::string &_filename, Errors &_errors)
 Populate the SDF values from a file. More...
 
SDFORMAT_VISIBLE bool readFile (const std::string &_filename, SDFPtr _sdf, Errors &_errors)
 Populate the SDF values from a file. More...
 
SDFORMAT_VISIBLE bool readFile (const std::string &_filename, SDFPtr _sdf)
 Populate the SDF values from a file. More...
 
SDFORMAT_VISIBLE bool readFileWithoutConversion (const std::string &_filename, SDFPtr _sdf, Errors &_errors)
 Populate the SDF values from a file without converting to the latest SDF version. More...
 
SDFORMAT_VISIBLE bool readString (const std::string &_xmlString, SDFPtr _sdf, Errors &_errors)
 Populate the SDF values from a string. 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, Errors &_errors)
 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...
 
SDFORMAT_VISIBLE bool readStringWithoutConversion (const std::string &_xmlString, SDFPtr _sdf, Errors &_errors)
 Populate the SDF values from a string without converting to the latest SDF version. More...
 
SDFORMAT_VISIBLE bool recursiveSameTypeUniqueNames (sdf::ElementPtr _elem)
 Check that all sibling elements of the same type have unique names. More...
 
SDFORMAT_VISIBLE bool recursiveSiblingUniqueNames (sdf::ElementPtr _elem)
 Check that all sibling elements of the any type have unique names. More...
 
class SDFORMAT_VISIBLE SDF_DEPRECATED (9.2) URDF2SDF
 URDF to SDF converter. 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 bool shouldValidateElement (sdf::ElementPtr _elem)
 Check whether the element should be validated. More...
 
SDFORMAT_VISIBLE std::vector< std::string > split (const std::string &_str, const std::string &_splitter)
 Split a string using the delimiter in splitter. More...
 
SDFORMAT_VISIBLE std::string trim (const char *_in)
 Trim leading and trailing whitespace from a string. More...
 

Variables

class SDFORMAT_VISIBLE Element
 
class SDFORMAT_VISIBLE Param
 
class SDFORMAT_VISIBLE SDF
 

Typedef Documentation

◆ ElementPtr

typedef std::shared_ptr<Element> sdf::v9::ElementPtr

◆ ElementPtr_V

typedef std::vector<ElementPtr> sdf::v9::ElementPtr_V

◆ ElementWeakPtr

typedef std::weak_ptr<Element> sdf::v9::ElementWeakPtr

◆ Errors

using sdf::v9::Errors = typedef std::vector<Error>

A vector of Error.

◆ Param_V

typedef std::vector<ParamPtr> sdf::v9::Param_V

◆ ParamPtr

typedef std::shared_ptr<Param> sdf::v9::ParamPtr

◆ SDFPtr

typedef std::shared_ptr<SDF> sdf::v9::SDFPtr

Enumeration Type Documentation

◆ AtmosphereType

The set of atmosphere model types.

Enumerator
ADIABATIC 

Adiabatic atmosphere model.

◆ ErrorCode

enum sdf::v9::ErrorCode
strong

Set of error codes.

Usually one or more errors are returned in an Errors vector. The collection of Errors should be take as a whole, where an error toward the beginning of the vector can inform errors toward the end of the vector.

See also
Errors
Enumerator
NONE 
FILE_READ 

Indicates that reading an SDF file failed.

DUPLICATE_NAME 

A duplicate name was found for an element where unique names are required.

RESERVED_NAME 

A reserved name was used in an entity name attribute.

ATTRIBUTE_MISSING 

Indicates that a required SDF attribute is missing.

ATTRIBUTE_INVALID 

This error indicates that an SDF attribute is invalid.

ATTRIBUTE_DEPRECATED 

This error indicates that an SDF attribute is deprecated.

ELEMENT_MISSING 

Indicates that a required SDF element is missing.

ELEMENT_INVALID 

This error indicates that an SDF element is invalid.

ELEMENT_DEPRECATED 

This error indicates that an SDF element is deprecated.

ELEMENT_INCORRECT_TYPE 

Indicates that an incorrect SDF element type was encountered.

This error is used when an element of certain type is expected, and an element of a different type was received.

URI_INVALID 

A URI is invalid.

URI_LOOKUP 

A error occured while trying to resolve a URI.

DIRECTORY_NONEXISTANT 

A filesystem directory does not exist.

MODEL_CANONICAL_LINK_INVALID 

A model with an invalid canonical link.

MODEL_WITHOUT_LINK 

A model without a link.

NESTED_MODELS_UNSUPPORTED 

Indicates that a DOM object tried to read a nested model.

LINK_INERTIA_INVALID 

A link has invalid inertia.

JOINT_CHILD_LINK_INVALID 

A joint has an invalid child link.

JOINT_PARENT_LINK_INVALID 

A joint has an invalid parent link.

JOINT_PARENT_SAME_AS_CHILD 

A joint has the same link specified as parent and child.

FRAME_ATTACHED_TO_INVALID 

The frame attached-to value does not match the name of an existing frame in the current scope.

FRAME_ATTACHED_TO_CYCLE 

The frame attached-to graph contains a cycle.

FRAME_ATTACHED_TO_GRAPH_ERROR 

The frame attached-to graph has an internal error.

POSE_RELATIVE_TO_INVALID 

The pose relative-to value does not match the name of an existing frame in the current scope.

POSE_RELATIVE_TO_CYCLE 

The pose relative-to graph contains a cycle.

POSE_RELATIVE_TO_GRAPH_ERROR 

The pose relative-to graph has an internal error.

STRING_READ 

Indicates that reading an SDF string failed.

◆ GeometryType

enum sdf::v9::GeometryType
strong

The set of geometry types.

Enumerator
EMPTY 

Empty geometry. This means no shape has been defined.

BOX 

A box geometry.

CYLINDER 

A cylinder geometry.

PLANE 

A plane geometry.

SPHERE 

A sphere geometry.

MESH 

A mesh geometry.

HEIGHTMAP 

A heightmap geometry.

◆ JointType

enum sdf::v9::JointType
strong

The set of joint types.

INVALID indicates that joint type has not been set, or has not been set correctly.

Enumerator
INVALID 

An invalid joint.

This indicates an error since a joint type is required to fully specify a joint.

BALL 

A ball and socket joint.

CONTINUOUS 

A hinge joint that rotates on a single axis with a continuous range of motion.

FIXED 

A joint with zero degrees of freedom that rigidly connects two links.

GEARBOX 

Geared revolute joint.

PRISMATIC 

A sliding joint that slides along an axis with a limited range specified by upper and lower limits.

REVOLUTE 

A hinge joint that rotates on a single axis with a fixed range of motion.

REVOLUTE2 

Same as two revolute joints connected in series.

SCREW 

A single degree of freedom joint with coupled sliding and rotational motion.

UNIVERSAL 

Similar to a ball joint, but constrains one degree of freedom.

◆ LightType

enum sdf::v9::LightType
strong

The set of light types.

INVALID indicates that light type has not been set, or has not been set correctly.

Enumerator
INVALID 

An invalid light.

This indicates an error since a light type is required to fully specify a light.

POINT 

A point light source.

SPOT 

A spot light source.

DIRECTIONAL 

A directional light source.

◆ NoiseType

enum sdf::v9::NoiseType
strong

The set of noise types.

Enumerator
NONE 

No noise model.

GAUSSIAN 

Draw noise values independently for each measurement from a Gaussian distribution.

GAUSSIAN_QUANTIZED 

Gaussian noise plus quantization of outputs (ie. rounding).

◆ NormalMapSpace

enum sdf::v9::NormalMapSpace : int
strong

Space the normal map is defined in.

Enumerator
TANGENT 

Tangent space.

OBJECT 

Object space.

◆ PbrWorkflowType

enum sdf::v9::PbrWorkflowType : int
strong

Type of PBR workflow.

Enumerator
NONE 

No workflow.

METAL 

Metal/Roughness workflow.

SPECULAR 

Specular/Glossiness workflow.

◆ PixelFormatType

The set of pixel formats.

This list should match ignition::common::Image::PixelFormatType.

Enumerator
UNKNOWN_PIXEL_FORMAT 
L_INT8 
L_INT16 
RGB_INT8 
RGBA_INT8 
BGRA_INT8 
RGB_INT16 
RGB_INT32 
BGR_INT8 
BGR_INT16 
BGR_INT32 
R_FLOAT16 
RGB_FLOAT16 
R_FLOAT32 
RGB_FLOAT32 
BAYER_RGGB8 
BAYER_BGGR8 
BAYER_GBRG8 
BAYER_GRBG8 

◆ ShaderType

enum sdf::v9::ShaderType : int
strong
Enumerator
PIXEL 
VERTEX 
NORMAL_MAP_OBJECTSPACE 
NORMAL_MAP_TANGENTSPACE 

Function Documentation

◆ addNestedModel() [1/2]

SDFORMAT_VISIBLE void sdf::v9::addNestedModel ( ElementPtr  _sdf,
ElementPtr  _includeSDF 
)

Copy the contents of the first model element from one ElementPtr to another ElementPtr, prepending the copied model name with :: to link and joint names, and apply the model pose to the copied link poses.

If //xyz/ == "__model__" for the axes of any copied joints, then apply the model pose rotation to those joint axes.

Parameters
[in]_sdfElementPtr for model into which the elements will be copied.
[in]_includeSDFThe first model element from this ElementPtr will be copied to _sdf with the mentioned name and pose transformations.

◆ addNestedModel() [2/2]

SDFORMAT_VISIBLE void sdf::v9::addNestedModel ( ElementPtr  _sdf,
ElementPtr  _includeSDF,
Errors _errors 
)

Copy the contents of the first model element from one ElementPtr to another ElementPtr, prepending the copied model name with :: to link and joint names, and apply the model pose to the copied link poses.

If //xyz/ == "__model__" for the axes of any copied joints, then apply the model pose rotation to those joint axes.

Parameters
[in]_sdfElementPtr for model into which the elements will be copied.
[in]_includeSDFThe first model element from this ElementPtr will be copied to _sdf with the mentioned name and pose transformations.
[out]_errorsAny errors will be appended to this variable.

◆ checkCanonicalLinkNames()

SDFORMAT_VISIBLE bool sdf::v9::checkCanonicalLinkNames ( const sdf::Root *  _root)

Check that for each model, the canonical_link attribute value matches the name of a link in the model if the attribute is set and not empty.

This checks recursively and should check the files exhaustively rather than terminating early when the first error is found.

Parameters
[in]_rootsdf Root object to check recursively.
Returns
True if all models have valid canonical_link attributes.

◆ checkFrameAttachedToGraph()

SDFORMAT_VISIBLE bool sdf::v9::checkFrameAttachedToGraph ( const sdf::Root *  _root)

For the world and each model, check that the attached_to graphs build without errors and have no cycles.

Confirm that following directed edges from each vertex in the graph leads to a model, link, or world frame. This checks recursively and should check the files exhaustively rather than terminating early when the first error is found.

Parameters
[in]_rootsdf Root object to check recursively.
Returns
True if all attached_to graphs are valid.

◆ checkFrameAttachedToNames()

SDFORMAT_VISIBLE bool sdf::v9::checkFrameAttachedToNames ( const sdf::Root *  _root)

Check that for each frame, the attached_to attribute value does not match its own frame name but does match the name of a link, joint, or other frame in the model if the attribute is set and not empty.

This checks recursively and should check the files exhaustively rather than terminating early when the first error is found.

Parameters
[in]_rootsdf Root object to check recursively.
Returns
True if all frames have valid attached_to attributes.

◆ checkJointParentChildLinkNames()

SDFORMAT_VISIBLE bool sdf::v9::checkJointParentChildLinkNames ( const sdf::Root *  _root)

Check that all joints in contained models specify parent and child link names that match the names of sibling links.

This checks recursively and should check the files exhaustively rather than terminating early when the first error is found.

Parameters
[in]_rootsdf Root object to check recursively.
Returns
True if all models have joints with valid parent and child link names.

◆ checkPoseRelativeToGraph()

SDFORMAT_VISIBLE bool sdf::v9::checkPoseRelativeToGraph ( const sdf::Root *  _root)

For the world and each model, check that the attached_to graphs build without errors and have no cycles.

Confirm that following directed edges from each vertex in the graph leads to a model, link, or world frame. This checks recursively and should check the files exhaustively rather than terminating early when the first error is found.

Parameters
[in]_rootsdf Root object to check recursively.
Returns
True if all attached_to graphs are valid.

◆ convertFile()

SDFORMAT_VISIBLE bool sdf::v9::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.

◆ convertString()

SDFORMAT_VISIBLE bool sdf::v9::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.

◆ equal()

template<typename T >
bool sdf::v9::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::v9::Color::operator==().

◆ getModelFilePath()

SDFORMAT_VISIBLE std::string sdf::v9::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.

◆ init()

SDFORMAT_VISIBLE bool sdf::v9::init ( SDFPtr  _sdf)

Init based on the installed sdf_format.xml file.

◆ initFile() [1/2]

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

Initialize the SDF interface using a file.

◆ initFile() [2/2]

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

Initialize an SDFElement interface using a file.

◆ initString()

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

Initialize the SDF interface using a string.

◆ lowercase()

std::string SDFORMAT_VISIBLE sdf::v9::lowercase ( const std::string &  _in)

Transforms a string to its lowercase equivalent.

Parameters
[in]_inString to convert to lowercase
Returns
Lowercase equilvalent of _in.

◆ operator<<() [1/2]

template<class T >
std::ostream& sdf::v9::operator<< ( std::ostream &  os,
ParamStreamer< T >  s 
)

◆ operator<<() [2/2]

template<class... Ts>
std::ostream& sdf::v9::operator<< ( std::ostream &  os,
ParamStreamer< std::variant< Ts... >>  sv 
)

◆ ParamStreamer()

template<class T >
sdf::v9::ParamStreamer ( ) -> ParamStreamer< T >

◆ readFile() [1/4]

SDFORMAT_VISIBLE sdf::SDFPtr sdf::v9::readFile ( const std::string &  _filename)

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

Parameters
[in]_filenameName of the SDF file
Returns
Populated SDF pointer.

◆ readFile() [2/4]

SDFORMAT_VISIBLE sdf::SDFPtr sdf::v9::readFile ( const std::string &  _filename,
Errors _errors 
)

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

Parameters
[in]_filenameName of the SDF file
[out]_errorsParsing errors will be appended to this variable.
Returns
Populated SDF pointer.

◆ readFile() [3/4]

SDFORMAT_VISIBLE bool sdf::v9::readFile ( const std::string &  _filename,
SDFPtr  _sdf,
Errors _errors 
)

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

Parameters
[in]_filenameName of the SDF file
[in]_sdfPointer to an SDF object.
[out]_errorsParsing errors will be appended to this variable.
Returns
True if successful.

◆ readFile() [4/4]

SDFORMAT_VISIBLE bool sdf::v9::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

Parameters
[in]_filenameName of the SDF file
[in]_sdfPointer to an SDF object.
Returns
True if successful.

◆ readFileWithoutConversion()

SDFORMAT_VISIBLE bool sdf::v9::readFileWithoutConversion ( const std::string &  _filename,
SDFPtr  _sdf,
Errors _errors 
)

Populate the SDF values from a file without converting to the latest SDF version.

This populates the given sdf pointer from a file. If the file is a URDF file it is converted to SDF first. This function does not convert the loaded SDF to the latest version. Use this function with care, as it may prevent loading of DOM objects from this SDF object.

Parameters
[in]_filenameName of the SDF file
[in]_sdfPointer to an SDF object.
[out]_errorsParsing errors will be appended to this variable.
Returns
True if successful.

◆ readString() [1/4]

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

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

Parameters
[in]_xmlStringXML string to be parsed.
[in]_sdfPointer to an SDF object.
[out]_errorsParsing errors will be appended to this variable.
Returns
True if successful.

◆ readString() [2/4]

SDFORMAT_VISIBLE bool sdf::v9::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

Parameters
[in]_xmlStringXML string to be parsed.
[in]_sdfPointer to an SDF object.
Returns
True if successful.

◆ readString() [3/4]

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

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

Parameters
[in]_xmlStringXML string to be parsed.
[in]_sdfPointer to an SDF object.
[out]_errorsParsing errors will be appended to this variable.
Returns
True if successful.

◆ readString() [4/4]

SDFORMAT_VISIBLE bool sdf::v9::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

Parameters
[in]_xmlStringXML string to be parsed.
[in]_sdfPointer to an sdf Element object.
Returns
True if successful.

◆ readStringWithoutConversion()

SDFORMAT_VISIBLE bool sdf::v9::readStringWithoutConversion ( const std::string &  _xmlString,
SDFPtr  _sdf,
Errors _errors 
)

Populate the SDF values from a string without converting to the latest SDF version.

This populates the sdf pointer from a string. If the string is a URDF file it is converted to SDF first. This function does not convert the loaded SDF to the latest version. Use this function with care, as it may prevent loading of DOM objects from this SDF object.

Parameters
[in]_xmlStringXML string to be parsed.
[in]_sdfPointer to an SDF object.
[out]_errorsParsing errors will be appended to this variable.
Returns
True if successful.

◆ recursiveSameTypeUniqueNames()

SDFORMAT_VISIBLE bool sdf::v9::recursiveSameTypeUniqueNames ( sdf::ElementPtr  _elem)

Check that all sibling elements of the same type have unique names.

This checks recursively and should check the files exhaustively rather than terminating early when the first duplicate name is found.

Parameters
[in]_elemsdf Element to check recursively.
Returns
True if all contained elements have do not share a name with sibling elements of the same type.

◆ recursiveSiblingUniqueNames()

SDFORMAT_VISIBLE bool sdf::v9::recursiveSiblingUniqueNames ( sdf::ElementPtr  _elem)

Check that all sibling elements of the any type have unique names.

This checks recursively and should check the files exhaustively rather than terminating early when the first duplicate name is found.

Parameters
[in]_elemsdf Element to check recursively.
Returns
True if all contained elements have do not share a name with sibling elements of any type.

◆ SDF_DEPRECATED()

class SDFORMAT_VISIBLE sdf::v9::SDF_DEPRECATED ( 9.  2)

URDF to SDF converter.

This is now deprecated for external usage and will be removed in the next major version of libsdformat. Instead, consider using sdf::readFile or sdf::readString, which automatically convert URDF to SDF.

constructor

destructor

convert urdf xml document string to sdf xml document

Parameters
[in]_xmlDoca tinyxml document containing the urdf model
Returns
a tinyxml document containing sdf of the model

convert urdf file to sdf xml document

Parameters
[in]_urdfStra string containing filename of the urdf model
Returns
a tinyxml document containing sdf of the model

convert urdf string to sdf xml document, with option to enforce limits.

Parameters
[in]_urdfStra string containing model urdf
[in]_enforceLimitsoption to enforce joint limits
Returns
a tinyxml document containing sdf of the model

Return true if the filename is a URDF model.

Parameters
[in]_filenameFile to check.
Returns
True if _filename is a URDF model.

things that do not belong in urdf but should be mapped into sdf

Todo:
: do this using sdf definitions, not hard coded stuff

list extensions for debugging

list extensions for debugging

◆ shouldValidateElement()

SDFORMAT_VISIBLE bool sdf::v9::shouldValidateElement ( sdf::ElementPtr  _elem)

Check whether the element should be validated.

If this returns false, validators such as the unique name and reserve name checkers should skip this element and its descendants.

Parameters
[in]_elemsdf Element to check.
Returns
True if the element should be validated

◆ split()

SDFORMAT_VISIBLE std::vector<std::string> sdf::v9::split ( const std::string &  _str,
const std::string &  _splitter 
)

Split a string using the delimiter in splitter.

Parameters
[in]strThe string to split.
[in]splitterThe delimiter to use.
Returns
A vector of strings containing the split tokens.

◆ trim()

SDFORMAT_VISIBLE std::string sdf::v9::trim ( const char *  _in)

Trim leading and trailing whitespace from a string.

Parameters
[in]_inThe string to trim.
Returns
A string containing the trimmed value.

Variable Documentation

◆ Element

◆ Param

◆ SDF