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

Namespaces

 filesystem
 
 internal
 Internal namespace.
 

Classes

class  Actor
 Provides a description of an actor. More...
 
class  AirPressure
 AirPressure contains information about a general purpose fluid pressure sensor. More...
 
class  AirSpeed
 AirSpeed contains information about a general purpose air speed 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. They include information about the assertion expression violated, function where problem appeared and assertion debug message. 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  BulletFriction
 BulletFriction information for a friction. More...
 
class  Camera
 Information about a monocular camera sensor. More...
 
class  Capsule
 Capsule represents a capsule shape, and is usually accessed through a Geometry. More...
 
class  Collision
 A collision element descibes the collision properties associated with a link. 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  Ellipsoid
 Ellipsoid represents a ellipsoid shape, and is usually accessed through a Geometry. More...
 
class  Error
 
class  Exception
 Class for generating exceptions. More...
 
class  ForceTorque
 ForceTorque contains information about a force torque sensor. More...
 
class  Frame
 A Frame element descibes the properties associated with an explicit frame defined in a Model or World. More...
 
class  Friction
 Friction information for a surface. 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  InterfaceFrame
 Interface element representing an explicit frame. More...
 
class  InterfaceJoint
 Interface element representing a Joint. More...
 
class  InterfaceLink
 Interface element representing a Link. More...
 
class  InterfaceModel
 Interface element representing a Model. More...
 
class  InterfaceModelPoseGraph
 Class used in reposture callbacks of custom parsers to resolve poses. 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  NavSat
 NavSat contains information about a NavSat sensor. More...
 
class  NestedInclude
 Contains the necessary information about an included model file for custom model parsers to be able to find the file and parse it. More...
 
class  Noise
 The Noise class contains information about a noise model, such as a Gaussian distribution. More...
 
class  ODE
 ODE information for a friction. More...
 
class  OutputConfig
 This class contains configuration options for SDF output. More...
 
class  Param
 A parameter class. More...
 
class  ParamPrivate
 
struct  ParamStreamer
 
class  ParserConfig
 This class contains configuration options for the libsdformat parser. More...
 
class  ParticleEmitter
 A description of a particle emitter, which can be attached to a link. More...
 
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  Plugin
 
class  Polyline
 Polyline represents a 2D path. Multiple polylines can be combined. More...
 
class  PrintConfig
 This class contains configuration options for printing elements. More...
 
class  Projector
 A description of a projector, which can be attached to a link. More...
 
class  Root
 Root class that acts as an entry point to the SDF document model. More...
 
class  Scene
 
class  ScopedGraph
 
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  Sensor
 Information about an SDF sensor. 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  Torsional
 Torsional friction. More...
 
class  Trajectory
 Trajectory for Animation. More...
 
class  Visual
 
class  Waypoint
 Waypoint for Trajectory. More...
 
class  World
 

Typedefs

typedef std::shared_ptr< ConsoleConsolePtr
 
using CustomModelParser = std::function< sdf::InterfaceModelPtr(const sdf::NestedInclude &, Errors &)>
 Defines a custom model parser. More...
 
typedef std::shared_ptr< const ElementElementConstPtr
 
using ElementPtr = std::shared_ptr< Element >
 
typedef std::vector< ElementPtrElementPtr_V
 
using ElementWeakPtr = std::weak_ptr< Element >
 
using Errors = std::vector< Error >
 A vector of Error. More...
 
using InterfaceModelConstPtr = std::shared_ptr< const InterfaceModel >
 
using InterfaceModelPtr = std::shared_ptr< InterfaceModel >
 
typedef std::vector< ParamPtrParam_V
 
typedef std::shared_ptr< ParamParamPtr
 
using Plugins = std::vector< Plugin >
 A vector of Plugin. More...
 
using RepostureFunction = std::function< void(const sdf::InterfaceModelPoseGraph &)>
 Function signature for the reposture callback function. More...
 
typedef std::shared_ptr< SDFSDFPtr
 

Enumerations

enum  AtmosphereType { AtmosphereType::ADIABATIC = 0 }
 
enum  EnforcementPolicy { EnforcementPolicy::ERR, EnforcementPolicy::WARN, EnforcementPolicy::LOG }
 Policy to describe how to treat certain conditions when parsing. 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::ATTRIBUTE_INCORRECT_TYPE,
  ErrorCode::ELEMENT_MISSING, ErrorCode::ELEMENT_INVALID, ErrorCode::ELEMENT_DEPRECATED, ErrorCode::ELEMENT_INCORRECT_TYPE,
  ErrorCode::ELEMENT_ERROR, 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::ROTATION_SNAP_CONFIG_ERROR, ErrorCode::STRING_READ, ErrorCode::MODEL_PLACEMENT_FRAME_INVALID,
  ErrorCode::VERSION_DEPRECATED, ErrorCode::MERGE_INCLUDE_UNSUPPORTED, ErrorCode::PARAMETER_ERROR, ErrorCode::UNKNOWN_PARAMETER_TYPE,
  ErrorCode::FATAL_ERROR, ErrorCode::WARNING, ErrorCode::JOINT_AXIS_EXPRESSED_IN_INVALID, ErrorCode::CONVERSION_ERROR,
  ErrorCode::PARSING_ERROR, ErrorCode::XML_ERROR
}
 
enum  ForceTorqueFrame : uint8_t { ForceTorqueFrame::INVALID = 0, ForceTorqueFrame::PARENT = 1, ForceTorqueFrame::CHILD = 2, ForceTorqueFrame::SENSOR = 3 }
 
enum  ForceTorqueMeasureDirection : uint8_t { ForceTorqueMeasureDirection::INVALID = 0, ForceTorqueMeasureDirection::PARENT_TO_CHILD = 1, ForceTorqueMeasureDirection::CHILD_TO_PARENT = 2 }
 
enum  GeometryType {
  GeometryType::EMPTY = 0, GeometryType::BOX = 1, GeometryType::CYLINDER = 2, GeometryType::PLANE = 3,
  GeometryType::SPHERE = 4, GeometryType::MESH = 5, GeometryType::HEIGHTMAP = 6, GeometryType::CAPSULE = 7,
  GeometryType::ELLIPSOID = 8, GeometryType::POLYLINE = 9
}
 
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
}
 
enum  LightType { LightType::INVALID = 0, LightType::POINT = 1, LightType::SPOT = 2, LightType::DIRECTIONAL = 3 }
 
enum  NoiseType { NoiseType::NONE = 0, NoiseType::GAUSSIAN = 1, NoiseType::GAUSSIAN_QUANTIZED = 2 }
 
enum  NormalMapSpace : int { NormalMapSpace::TANGENT = 0, NormalMapSpace::OBJECT = 1 }
 Space the normal map is defined in. More...
 
enum  ParticleEmitterType { ParticleEmitterType::POINT = 0, ParticleEmitterType::BOX = 1, ParticleEmitterType::CYLINDER = 2, ParticleEmitterType::ELLIPSOID = 3 }
 
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
}
 
enum  SensorType {
  SensorType::NONE = 0, SensorType::ALTIMETER = 1, SensorType::CAMERA = 2, SensorType::CONTACT = 3,
  SensorType::DEPTH_CAMERA = 4, SensorType::FORCE_TORQUE = 5, SensorType::GPS = 6, SensorType::GPU_LIDAR = 7,
  SensorType::IMU = 8, SensorType::LOGICAL_CAMERA = 9, SensorType::MAGNETOMETER = 10, SensorType::MULTICAMERA = 11,
  SensorType::LIDAR = 12, SensorType::RFID = 13, SensorType::RFIDTAG = 14, SensorType::SONAR = 15,
  SensorType::WIRELESS_RECEIVER = 16, SensorType::WIRELESS_TRANSMITTER = 17, SensorType::AIR_PRESSURE = 18, SensorType::RGBD_CAMERA = 19,
  SensorType::THERMAL_CAMERA = 20, SensorType::NAVSAT = 21, SensorType::SEGMENTATION_CAMERA = 22, SensorType::BOUNDINGBOX_CAMERA = 23,
  SensorType::CUSTOM = 24, SensorType::WIDE_ANGLE_CAMERA = 25, SensorType::AIR_SPEED = 26
}
 
enum  ShaderType : int { ShaderType::PIXEL = 0, ShaderType::VERTEX = 1, ShaderType::NORMAL_MAP_OBJECTSPACE = 2, ShaderType::NORMAL_MAP_TANGENTSPACE = 3 }
 

Functions

GZ_SDFORMAT_VISIBLE void addURIPath (const std::string &_uri, const std::string &_path)
 Associate paths to a URI. More...
 
GZ_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...
 
GZ_SDFORMAT_VISIBLE bool checkCanonicalLinkNames (sdf::Errors &_errors, 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...
 
GZ_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...
 
GZ_SDFORMAT_VISIBLE bool checkFrameAttachedToGraph (sdf::Errors &_errors, const sdf::Root *_root)
 For the world and each model, check that the attached_to graphs build without errors and have no cycles. More...
 
GZ_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...
 
GZ_SDFORMAT_VISIBLE bool checkFrameAttachedToNames (sdf::Errors &_errors, 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...
 
GZ_SDFORMAT_VISIBLE void checkJointAxisExpressedInValues (const sdf::Root *_root, Errors &_errors)
 Check that all joint axes in contained joints specify xyz expressed-in names that match the names of valid frames. More...
 
GZ_SDFORMAT_VISIBLE bool checkJointParentChildNames (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...
 
GZ_SDFORMAT_VISIBLE GZ_DEPRECATED(13) bool checkJointParentChildLinkNames(const sdf GZ_SDFORMAT_VISIBLE void checkJointParentChildNames (const sdf::Root *_root, Errors &_errors)
 Check that all joints in contained models specify parent and child link names that match the names of sibling links. More...
 
GZ_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...
 
GZ_SDFORMAT_VISIBLE bool checkPoseRelativeToGraph (sdf::Errors &_errors, const sdf::Root *_root)
 For the world and each model, check that the attached_to graphs build without errors and have no cycles. More...
 
GZ_SDFORMAT_VISIBLE std::string computeMergedModelProxyFrameName (const std::string &_modelName)
 Function to compute a merged model's proxy frame name. More...
 
GZ_SDFORMAT_VISIBLE bool convertFile (const std::string &_filename, const std::string &_version, const ParserConfig &_config, SDFPtr _sdf)
 Convert an SDF file to a specific SDF version. More...
 
GZ_SDFORMAT_VISIBLE bool convertFile (const std::string &_filename, const std::string &_version, SDFPtr _sdf)
 Convert an SDF file to a specific SDF version. More...
 
GZ_SDFORMAT_VISIBLE sdf::Errors convertFile (SDFPtr _sdf, const std::string &_filename, const std::string &_version, const ParserConfig &_config=ParserConfig::GlobalConfig())
 Convert an SDF file to a specific SDF version. More...
 
GZ_SDFORMAT_VISIBLE bool convertString (const std::string &_sdfString, const std::string &_version, const ParserConfig &_config, SDFPtr _sdf)
 Convert an SDF string to a specific SDF version. More...
 
GZ_SDFORMAT_VISIBLE bool convertString (const std::string &_sdfString, const std::string &_version, SDFPtr _sdf)
 Convert an SDF string to a specific SDF version. More...
 
GZ_SDFORMAT_VISIBLE sdf::Errors convertString (SDFPtr _sdf, const std::string &_sdfString, const std::string &_version, const ParserConfig &_config=ParserConfig::GlobalConfig())
 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...
 
GZ_SDFORMAT_VISIBLE std::string findFile (const std::string &_filename, bool _searchLocalPath, bool _useCallback, const ParserConfig &_config)
 Find the absolute path of a file. More...
 
GZ_SDFORMAT_VISIBLE std::string findFile (const std::string &_filename, bool _searchLocalPath=true, bool _useCallback=false)
 Find the absolute path of a file. More...
 
GZ_SDFORMAT_VISIBLE std::string findFile (sdf::Errors &_errors, const std::string &_filename, bool _searchLocalPath, bool _useCallback, const ParserConfig &_config)
 Find the absolute path of a file. More...
 
GZ_SDFORMAT_VISIBLE std::string findFile (sdf::Errors &_errors, const std::string &_filename, bool _searchLocalPath=true, bool _useCallback=false)
 Find the absolute path of a file. More...
 
GZ_SDFORMAT_VISIBLE std::string getModelFilePath (const std::string &_modelDirPath)
 Get the file path to the model file. More...
 
GZ_SDFORMAT_VISIBLE std::string getModelFilePath (sdf::Errors &_errors, const std::string &_modelDirPath)
 Get the file path to the model file. More...
 
class GZ_SDFORMAT_VISIBLE GZ_DEPRECATED (13) Inertia
 A class for inertial information about a link. More...
 
GZ_SDFORMAT_VISIBLE bool init (sdf::Errors &_errors, SDFPtr _sdf, const ParserConfig &_config)
 Initialize the SDF interface from the embedded root spec file. More...
 
GZ_SDFORMAT_VISIBLE bool init (SDFPtr _sdf)
 Initialize the SDF interface from the embedded root spec file. More...
 
GZ_SDFORMAT_VISIBLE bool init (SDFPtr _sdf, const ParserConfig &_config)
 Initialize the SDF interface from the embedded root spec file. More...
 
GZ_SDFORMAT_VISIBLE bool initFile (const std::string &_filename, const ParserConfig &_config, ElementPtr _sdf)
 Initialize an SDFElement interface using a file. More...
 
GZ_SDFORMAT_VISIBLE bool initFile (const std::string &_filename, const ParserConfig &_config, ElementPtr _sdf, sdf::Errors &_errors)
 Initialize an SDFElement interface using a file. More...
 
GZ_SDFORMAT_VISIBLE bool initFile (const std::string &_filename, const ParserConfig &_config, SDFPtr _sdf)
 Initialize the SDF interface using a file. More...
 
GZ_SDFORMAT_VISIBLE bool initFile (const std::string &_filename, const ParserConfig &_config, SDFPtr _sdf, sdf::Errors &_errors)
 Initialize the SDF interface using a file. More...
 
GZ_SDFORMAT_VISIBLE bool initFile (const std::string &_filename, ElementPtr _sdf)
 Initialize an SDF Element interface using a file. More...
 
GZ_SDFORMAT_VISIBLE bool initFile (const std::string &_filename, SDFPtr _sdf)
 Initialize the SDF interface using a file. More...
 
GZ_SDFORMAT_VISIBLE bool initString (const std::string &_xmlString, const ParserConfig &_config, SDFPtr _sdf)
 Initialize the SDF interface using a string. More...
 
GZ_SDFORMAT_VISIBLE bool initString (const std::string &_xmlString, const ParserConfig &_config, SDFPtr _sdf, sdf::Errors &_errors)
 Initialize the SDF interface using a string. More...
 
GZ_SDFORMAT_VISIBLE bool initString (const std::string &_xmlString, SDFPtr _sdf)
 Initialize the SDF interface using a string. More...
 
GZ_SDFORMAT_VISIBLE std::string JoinName (const std::string &_scopeName, const std::string &_localName)
 Join two strings with the '::' delimiter. More...
 
std::string GZ_SDFORMAT_VISIBLE lowercase (const std::string &_in)
 Transforms a string to its lowercase equivalent. More...
 
GZ_SDFORMAT_VISIBLE std::ostream & operator<< (std::ostream &_out, const sdf::Errors &_errs)
 Output operator for a collection of errors. More...
 
template<class... Ts>
std::ostream & operator<< (std::ostream &os, ParamStreamer< std::variant< Ts... >> sv)
 
template<class T >
std::ostream & operator<< (std::ostream &os, ParamStreamer< T > s)
 
template<typename ParamVariant >
 ParamStreamer (const ParamVariant &_val, int _precision) -> ParamStreamer< ParamVariant >
 
GZ_SDFORMAT_VISIBLE sdf::SDFPtr readFile (const std::string &_filename)
 Populate the SDF values from a file. More...
 
GZ_SDFORMAT_VISIBLE sdf::SDFPtr readFile (const std::string &_filename, const ParserConfig &_config, Errors &_errors)
 Populate the SDF values from a file. More...
 
GZ_SDFORMAT_VISIBLE bool readFile (const std::string &_filename, const ParserConfig &_config, SDFPtr _sdf, Errors &_errors)
 Populate the SDF values from a file. More...
 
GZ_SDFORMAT_VISIBLE sdf::SDFPtr readFile (const std::string &_filename, Errors &_errors)
 Populate the SDF values from a file. More...
 
GZ_SDFORMAT_VISIBLE bool readFile (const std::string &_filename, SDFPtr _sdf)
 Populate the SDF values from a file. More...
 
GZ_SDFORMAT_VISIBLE bool readFile (const std::string &_filename, SDFPtr _sdf, Errors &_errors)
 Populate the SDF values from a file. More...
 
GZ_SDFORMAT_VISIBLE bool readFileWithoutConversion (const std::string &_filename, const ParserConfig &_config, SDFPtr _sdf, Errors &_errors)
 Populate the SDF values from a file without converting to the latest SDF version. More...
 
GZ_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...
 
GZ_SDFORMAT_VISIBLE bool readString (const std::string &_xmlString, const ParserConfig &_config, ElementPtr _sdf, Errors &_errors)
 Populate the SDF values from a string. More...
 
GZ_SDFORMAT_VISIBLE bool readString (const std::string &_xmlString, const ParserConfig &_config, SDFPtr _sdf, Errors &_errors)
 Populate the SDF values from a string. More...
 
GZ_SDFORMAT_VISIBLE bool readString (const std::string &_xmlString, ElementPtr _sdf)
 Populate the SDF values from a string. More...
 
GZ_SDFORMAT_VISIBLE bool readString (const std::string &_xmlString, ElementPtr _sdf, Errors &_errors)
 Populate the SDF values from a string. More...
 
GZ_SDFORMAT_VISIBLE bool readString (const std::string &_xmlString, SDFPtr _sdf)
 Populate the SDF values from a string. More...
 
GZ_SDFORMAT_VISIBLE bool readString (const std::string &_xmlString, SDFPtr _sdf, Errors &_errors)
 Populate the SDF values from a string. More...
 
GZ_SDFORMAT_VISIBLE bool readStringWithoutConversion (const std::string &_xmlString, const ParserConfig &_config, SDFPtr _sdf, Errors &_errors)
 Populate the SDF values from a string. More...
 
GZ_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...
 
GZ_SDFORMAT_VISIBLE bool recursiveSameTypeUniqueNames (sdf::ElementPtr _elem)
 Check that all sibling elements of the same type have unique names. More...
 
GZ_SDFORMAT_VISIBLE bool recursiveSameTypeUniqueNames (sdf::Errors &_errors, sdf::ElementPtr _elem)
 Check that all sibling elements of the same type have unique names. More...
 
GZ_SDFORMAT_VISIBLE bool recursiveSiblingNoDoubleColonInNames (sdf::ElementPtr _elem)
 Check that all sibling elements do not contain the delimiter double colons '::' in element names, which is reserved for forming scopes in SDFormat 1.8. More...
 
GZ_SDFORMAT_VISIBLE bool recursiveSiblingNoDoubleColonInNames (sdf::Errors &_errors, sdf::ElementPtr _elem)
 Check that all sibling elements do not contain the delimiter double colons '::' in element names, which is reserved for forming scopes in SDFormat 1.8. More...
 
GZ_SDFORMAT_VISIBLE bool recursiveSiblingUniqueNames (sdf::ElementPtr _elem)
 Check that all sibling elements of the any type have unique names. More...
 
GZ_SDFORMAT_VISIBLE bool recursiveSiblingUniqueNames (sdf::Errors &_errors, sdf::ElementPtr _elem)
 Check that all sibling elements of the any type have unique names. More...
 
GZ_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...
 
GZ_SDFORMAT_VISIBLE bool shouldValidateElement (sdf::ElementPtr _elem)
 Check whether the element should be validated. More...
 
GZ_SDFORMAT_VISIBLE std::vector< std::string > split (const std::string &_str, const std::string &_splitter)
 Split a string using the delimiter in splitter. More...
 
GZ_SDFORMAT_VISIBLE std::pair< std::string, std::string > SplitName (const std::string &_absoluteName)
 Split a name into a two strings based on the '::' delimeter. More...
 
GZ_SDFORMAT_VISIBLE std::string trim (const char *_in)
 Trim leading and trailing whitespace from a string. More...
 
GZ_SDFORMAT_VISIBLE std::string trim (const std::string &_in)
 Trim leading and trailing whitespace from a string. More...
 

Variables

class GZ_SDFORMAT_VISIBLE Element
 
const std::string kSdfScopeDelimiter = "::"
 
constexpr char kSdfStringSource [] = "<data-string>"
 The source path replacement if it was parsed from a string, instead of a file. More...
 
constexpr char kUrdfStringSource [] = "<urdf-string>"
 The source path replacement if the urdf was parsed from a string, instead of a file. More...
 
class GZ_SDFORMAT_VISIBLE Param
 
class GZ_SDFORMAT_VISIBLE SDF
 

Typedef Documentation

◆ CustomModelParser

Defines a custom model parser.

Every custom model parser should define it's own way of (quickly) determining if it should parse a model. This should generally be done by looking at the file extension of include.resolvedFileName, and returning nullptr if it doesn't match a given criteria.

Custom model parsers are visited in the reverse of how they are defined. The latest parser gains precedence.

Custom model parsers are never checked if resolved file extension ends with *.sdf or *.world. If libsdformat encounters a *.urdf file, it will first check custom parser. If no custom parser is found, it will then convert the URDF XML to SDFormat XML, and parse it as an SDFormat file.

Parameters
[in]includeThe parsed //include information from which this model should be parsed.
[out]errorsErrors encountered during custom parsing. If any errors are reported, this must return nullptr.
Returns
An optional ModelInterface.
  • If not nullptr, the returned model interface is incorporated into the existing model and its frames are exposed through the frame graph.
  • If nullptr and no errors are reported, then libsdformat should continue testing out other custom parsers registered under the same extension (e.g. a parser for .yaml, which may cover many different schemas).

If an exception is raised by this callback, libsdformat will not try to intercept the exception.

To see an example implementation, please refer to test/integration/interface_api.cc

◆ ElementConstPtr

typedef std::shared_ptr<const Element> sdf::SDF_VERSION_NAMESPACE::ElementConstPtr

◆ ElementPtr

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

◆ ElementPtr_V

◆ ElementWeakPtr

◆ Errors

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

A vector of Error.

◆ InterfaceModelConstPtr

◆ InterfaceModelPtr

◆ Param_V

◆ ParamPtr

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

◆ Plugins

using sdf::SDF_VERSION_NAMESPACE::Plugins = typedef std::vector<Plugin>

A vector of Plugin.

◆ RepostureFunction

Function signature for the reposture callback function.

◆ SDFPtr

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

Enumeration Type Documentation

◆ AtmosphereType

Enumerator
ADIABATIC 

Adiabatic atmosphere model.

◆ EnforcementPolicy

Policy to describe how to treat certain conditions when parsing.

Enumerator
ERR 

Policy is to treat condition as an error and fail parsing.

WARN 

Treat condition as a warning and issue to user.

LOG 

Ignore condition in favor of best effort parsing.

◆ ErrorCode

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.

ATTRIBUTE_INCORRECT_TYPE 

Indicates an attribute was included that is not part of the sdf spec.

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.

ELEMENT_ERROR 

Generic error type for Elements.

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.

ROTATION_SNAP_CONFIG_ERROR 

The rotation snap config provided is not valid.

STRING_READ 

Indicates that reading an SDF string failed.

MODEL_PLACEMENT_FRAME_INVALID 

The specified placement frame is invalid.

VERSION_DEPRECATED 

The provided version has been deprecated or it is pre-versioning.

MERGE_INCLUDE_UNSUPPORTED 

Merge include is unspported for the type of entity being included, or the custom parser does not support merge includes.

PARAMETER_ERROR 

Generic error type for parameters (values of SDFormat elements or attributes).

UNKNOWN_PARAMETER_TYPE 

The specified parameter (values of SDFormat elements or attributes) type is unknown.

FATAL_ERROR 

Generic error to be thrown with SDF_ASSERT by the caller.

This has been created to help preserve behavior.

WARNING 

Generic warning saved as error due to WarningsPolicy config.

JOINT_AXIS_EXPRESSED_IN_INVALID 

The joint axis expressed-in value does not match the name of an existing frame in the current scope.

CONVERSION_ERROR 

SDF conversion generic error.

PARSING_ERROR 

Generic error during parsing.

XML_ERROR 

Error at the XML level.

◆ ForceTorqueFrame

Enumerator
INVALID 

Invalid frame.

PARENT 

Wrench expressed in the orientation of the parent link frame.

CHILD 

Wrench expressed in the orientation of the child link frame.

SENSOR 

Wrench expressed in the orientation of the joint sensor frame.

◆ ForceTorqueMeasureDirection

Enumerator
INVALID 

Invalid frame.

PARENT_TO_CHILD 

Wrench measured as applied by the parent link on the child link.

CHILD_TO_PARENT 

Wrench measured as applied by the child link on the parent link.

◆ GeometryType

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.

CAPSULE 

A capsule geometry.

ELLIPSOID 

An ellipsoid geometry.

POLYLINE 

A polyline geometry.

◆ JointType

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

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

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

Space the normal map is defined in.

Enumerator
TANGENT 

Tangent space.

OBJECT 

Object space.

◆ ParticleEmitterType

Enumerator
POINT 

A point emitter.

BOX 

A box emitter.

CYLINDER 

A cylinder emitter.

ELLIPSOID 

An ellipsoid emitter.

◆ PbrWorkflowType

Type of PBR workflow.

Enumerator
NONE 

No workflow.

METAL 

Metal/Roughness workflow.

SPECULAR 

Specular/Glossiness workflow.

◆ 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 

◆ SensorType

Enumerator
NONE 

An unspecified sensor type.

ALTIMETER 

An altimeter sensor.

CAMERA 

A monocular camera sensor.

CONTACT 

A contact sensor.

DEPTH_CAMERA 

A depth camera sensor.

FORCE_TORQUE 

A force-torque sensor.

GPS 

A GPS sensor.

GPU_LIDAR 

A GPU based lidar sensor.

IMU 

An IMU sensor.

LOGICAL_CAMERA 

A logical camera sensor.

MAGNETOMETER 

A magnetometer sensor.

MULTICAMERA 

A multicamera sensor.

LIDAR 

A CPU based lidar sensor.

RFID 

An RFID sensor.

RFIDTAG 

An RFID tag.

SONAR 

A sonar tag sensor.

WIRELESS_RECEIVER 

A wireless receiver.

WIRELESS_TRANSMITTER 

A wireless transmitter.

AIR_PRESSURE 

An air pressure sensor.

RGBD_CAMERA 

An RGBD sensor, which produces both a color image and a depth image.

THERMAL_CAMERA 

A thermal camera sensor.

NAVSAT 

A NavSat sensor, such as GPS.

SEGMENTATION_CAMERA 

A segmentation camera sensor.

BOUNDINGBOX_CAMERA 

A boundingbox camera sensor.

CUSTOM 

A custom sensor.

WIDE_ANGLE_CAMERA 

A wide angle camera sensor.

AIR_SPEED 

An air speed sensor.

◆ ShaderType

Enumerator
PIXEL 
VERTEX 
NORMAL_MAP_OBJECTSPACE 
NORMAL_MAP_TANGENTSPACE 

Function Documentation

◆ checkCanonicalLinkNames() [1/2]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::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.

◆ checkCanonicalLinkNames() [2/2]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::checkCanonicalLinkNames ( sdf::Errors _errors,
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
[out]_errorsVector of errors.
[in]_rootSDF Root object to check recursively.
Returns
True if all models have valid canonical_link attributes.

◆ checkFrameAttachedToGraph() [1/2]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::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.

◆ checkFrameAttachedToGraph() [2/2]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::checkFrameAttachedToGraph ( sdf::Errors _errors,
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
[out]_errorsVector of errors.
[in]_rootSDF Root object to check recursively.
Returns
True if all attached_to graphs are valid.

◆ checkFrameAttachedToNames() [1/2]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::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.

◆ checkFrameAttachedToNames() [2/2]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::checkFrameAttachedToNames ( sdf::Errors _errors,
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
[out]_errorsVector of errors.
[in]_rootSDF Root object to check recursively.
Returns
True if all frames have valid attached_to attributes.

◆ checkJointAxisExpressedInValues()

GZ_SDFORMAT_VISIBLE void sdf::SDF_VERSION_NAMESPACE::checkJointAxisExpressedInValues ( const sdf::Root _root,
Errors _errors 
)

Check that all joint axes in contained joints specify xyz expressed-in names that match the names of valid frames.

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.
[out]_errorsDetected errors will be appended to this variable.

◆ checkJointParentChildNames() [1/2]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::checkJointParentChildNames ( 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.

◆ checkJointParentChildNames() [2/2]

GZ_SDFORMAT_VISIBLE GZ_DEPRECATED (13) bool checkJointParentChildLinkNames( const sdf GZ_SDFORMAT_VISIBLE void sdf::SDF_VERSION_NAMESPACE::checkJointParentChildNames ( const sdf::Root _root,
Errors _errors 
)

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.
Deprecated:
Use checkJointParentChildNames.

Check that all joints in contained models specify parent and child names that match the names of sibling links, joints, models, or frames. 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.
[out]_errorsDetected errors will be appended to this variable.

◆ checkPoseRelativeToGraph() [1/2]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::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.

◆ checkPoseRelativeToGraph() [2/2]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::checkPoseRelativeToGraph ( sdf::Errors _errors,
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
[out]_errorsVector of errors.
[in]_rootSDF Root object to check recursively.
Returns
True if all attached_to graphs are valid.

◆ computeMergedModelProxyFrameName()

GZ_SDFORMAT_VISIBLE std::string sdf::SDF_VERSION_NAMESPACE::computeMergedModelProxyFrameName ( const std::string &  _modelName)

Function to compute a merged model's proxy frame name.

Parameters
[in]_modelNameThe merged model's name
Returns
The computed frame name

◆ convertFile() [1/3]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::convertFile ( const std::string &  _filename,
const std::string &  _version,
const ParserConfig _config,
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.
[in]_configCustom parser configuration
[out]_sdfPointer to the converted SDF document.
Returns
True on success.

◆ convertFile() [2/3]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::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.

◆ convertFile() [3/3]

GZ_SDFORMAT_VISIBLE sdf::Errors sdf::SDF_VERSION_NAMESPACE::convertFile ( SDFPtr  _sdf,
const std::string &  _filename,
const std::string &  _version,
const ParserConfig _config = ParserConfig::GlobalConfig() 
)

Convert an SDF file to a specific SDF version.

Parameters
[out]_sdfPointer to the converted SDF document.
[in]_filenameName of the SDF file to convert.
[in]_versionVersion to convert _filename to.
[in]_configCustom parser configuration
Returns
Vector of errors, successful when vector is empty.

◆ convertString() [1/3]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::convertString ( const std::string &  _sdfString,
const std::string &  _version,
const ParserConfig _config,
SDFPtr  _sdf 
)

Convert an SDF string to a specific SDF version.

Parameters
[in]_sdfStringThe SDF string to convert.
[in]_versionVersion to convert _filename to.
[in]_configCustom parser configuration
[out]_sdfPointer to the converted SDF document.
Returns
True on success.

◆ convertString() [2/3]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::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.

◆ convertString() [3/3]

GZ_SDFORMAT_VISIBLE sdf::Errors sdf::SDF_VERSION_NAMESPACE::convertString ( SDFPtr  _sdf,
const std::string &  _sdfString,
const std::string &  _version,
const ParserConfig _config = ParserConfig::GlobalConfig() 
)

Convert an SDF string to a specific SDF version.

Parameters
[out]_sdfPointer to the converted SDF document.
[in]_sdfStringThe SDF string to convert.
[in]_versionVersion to convert _filename to.
[in]_configCustom parser configuration
Returns
Vector of errors, successful when vector is empty.

◆ equal()

template<typename T >
bool sdf::SDF_VERSION_NAMESPACE::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

◆ getModelFilePath() [1/2]

GZ_SDFORMAT_VISIBLE std::string sdf::SDF_VERSION_NAMESPACE::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.

◆ getModelFilePath() [2/2]

GZ_SDFORMAT_VISIBLE std::string sdf::SDF_VERSION_NAMESPACE::getModelFilePath ( sdf::Errors _errors,
const std::string &  _modelDirPath 
)

Get the file path to the model file.

Parameters
[out]_errorsVector of errors.
[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.

◆ GZ_DEPRECATED()

class GZ_SDFORMAT_VISIBLE sdf::SDF_VERSION_NAMESPACE::GZ_DEPRECATED ( 13  )

A class for inertial information about a link.

◆ init() [1/3]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::init ( sdf::Errors _errors,
SDFPtr  _sdf,
const ParserConfig _config 
)

Initialize the SDF interface from the embedded root spec file.

Parameters
[out]_errorsVector of errors.
[out]_sdfPointer to an SDF object.
[in]_configCustom parser configuration
Returns
True if successful.

◆ init() [2/3]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::init ( SDFPtr  _sdf)

Initialize the SDF interface from the embedded root spec file.

Parameters
[out]_sdfPointer to an SDF object.
Returns
True if successful.

◆ init() [3/3]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::init ( SDFPtr  _sdf,
const ParserConfig _config 
)

Initialize the SDF interface from the embedded root spec file.

Parameters
[out]_sdfPointer to an SDF object.
[in]_configCustom parser configuration
Returns
True if successful.

◆ initFile() [1/6]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::initFile ( const std::string &  _filename,
const ParserConfig _config,
ElementPtr  _sdf 
)

Initialize an SDFElement interface using a file.

Parameters
[in]_filenameName of the SDF file
[in]_configCustom parser configuration
[out]_sdfPointer to an SDF Element object.
Returns
True if successful.

◆ initFile() [2/6]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::initFile ( const std::string &  _filename,
const ParserConfig _config,
ElementPtr  _sdf,
sdf::Errors _errors 
)

Initialize an SDFElement interface using a file.

Parameters
[in]_filenameName of the SDF file
[in]_configCustom parser configuration
[out]_sdfPointer to an SDF Element object.
[out]_errorsVector of errors.
Returns
True if successful.

◆ initFile() [3/6]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::initFile ( const std::string &  _filename,
const ParserConfig _config,
SDFPtr  _sdf 
)

Initialize the SDF interface using a file.

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

◆ initFile() [4/6]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::initFile ( const std::string &  _filename,
const ParserConfig _config,
SDFPtr  _sdf,
sdf::Errors _errors 
)

Initialize the SDF interface using a file.

Parameters
[in]_filenameName of the SDF file
[in]_configCustom parser configuration
[out]_sdfPointer to an SDF object.
[out]_errorsVector of errors.
Returns
True if successful.

◆ initFile() [5/6]

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

Initialize an SDF Element interface using a file.

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

◆ initFile() [6/6]

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

Initialize the SDF interface using a file.

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

◆ initString() [1/3]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::initString ( const std::string &  _xmlString,
const ParserConfig _config,
SDFPtr  _sdf 
)

Initialize the SDF interface using a string.

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

◆ initString() [2/3]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::initString ( const std::string &  _xmlString,
const ParserConfig _config,
SDFPtr  _sdf,
sdf::Errors _errors 
)

Initialize the SDF interface using a string.

Parameters
[in]_xmlStringXML string to be parsed.
[in]_configCustom parser configuration
[out]_sdfPointer to an SDF object.
[out]_errorsVector of errors.
Returns
True if successful.

◆ initString() [3/3]

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

Initialize the SDF interface using a string.

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

◆ JoinName()

GZ_SDFORMAT_VISIBLE std::string sdf::SDF_VERSION_NAMESPACE::JoinName ( const std::string &  _scopeName,
const std::string &  _localName 
)

Join two strings with the '::' delimiter.

This checks for edge cases and is safe to use with any valid names

Parameters
[in]_scopeNamethe left-hand-side component
[in]_localNamethe right-hand-side component
Returns
A full string with the names joined by the '::' delimeter.

◆ lowercase()

std::string GZ_SDFORMAT_VISIBLE sdf::SDF_VERSION_NAMESPACE::lowercase ( const std::string &  _in)

Transforms a string to its lowercase equivalent.

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

Referenced by sdf::SDF_VERSION_NAMESPACE::Param::Get().

◆ operator<<() [1/3]

GZ_SDFORMAT_VISIBLE std::ostream& sdf::SDF_VERSION_NAMESPACE::operator<< ( std::ostream &  _out,
const sdf::Errors _errs 
)

Output operator for a collection of errors.

Parameters
[in,out]_outThe output stream.
[in]_errThe errors to output.
Returns
Reference to the given output stream

◆ operator<<() [2/3]

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

◆ operator<<() [3/3]

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

◆ ParamStreamer()

template<typename ParamVariant >
sdf::SDF_VERSION_NAMESPACE::ParamStreamer ( const ParamVariant &  _val,
int  _precision 
) -> ParamStreamer< ParamVariant >

◆ readFile() [1/6]

GZ_SDFORMAT_VISIBLE sdf::SDFPtr sdf::SDF_VERSION_NAMESPACE::readFile ( const std::string &  _filename)

Populate the SDF values from a file.

This populates a new 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/6]

GZ_SDFORMAT_VISIBLE sdf::SDFPtr sdf::SDF_VERSION_NAMESPACE::readFile ( const std::string &  _filename,
const ParserConfig _config,
Errors _errors 
)

Populate the SDF values from a file.

This populates a new 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]_configCustom parser configuration
[out]_errorsParsing errors will be appended to this variable.
Returns
Populated SDF pointer.

◆ readFile() [3/6]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::readFile ( const std::string &  _filename,
const ParserConfig _config,
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]_configCustom parser configuration
[out]_sdfPointer to an SDF object.
[out]_errorsParsing errors will be appended to this variable.
Returns
True if successful.

◆ readFile() [4/6]

GZ_SDFORMAT_VISIBLE sdf::SDFPtr sdf::SDF_VERSION_NAMESPACE::readFile ( const std::string &  _filename,
Errors _errors 
)

Populate the SDF values from a file.

This populates a new 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() [5/6]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::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
[out]_sdfPointer to an SDF object.
Returns
True if successful.

◆ readFile() [6/6]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::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
[out]_sdfPointer to an SDF object.
[out]_errorsParsing errors will be appended to this variable.
Returns
True if successful.

◆ readFileWithoutConversion() [1/2]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::readFileWithoutConversion ( const std::string &  _filename,
const ParserConfig _config,
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]_configCustom parser configuration
[out]_sdfPointer to an SDF object.
[out]_errorsParsing errors will be appended to this variable.
Returns
True if successful.

◆ readFileWithoutConversion() [2/2]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::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
[out]_sdfPointer to an SDF object.
[out]_errorsParsing errors will be appended to this variable.
Returns
True if successful.

◆ readString() [1/6]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::readString ( const std::string &  _xmlString,
const ParserConfig _config,
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]_configCustom parser configuration
[out]_sdfPointer to an SDF Element object.
[out]_errorsParsing errors will be appended to this variable.
Returns
True if successful.

◆ readString() [2/6]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::readString ( const std::string &  _xmlString,
const ParserConfig _config,
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]_configCustom parser configuration
[out]_sdfPointer to an SDF object.
[out]_errorsParsing errors will be appended to this variable.
Returns
True if successful.

◆ readString() [3/6]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::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.

◆ readString() [4/6]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::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.
[out]_sdfPointer to an SDF Element object.
[out]_errorsParsing errors will be appended to this variable.
Returns
True if successful.

◆ readString() [5/6]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::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.
[out]_sdfPointer to an SDF object.
Returns
True if successful.

◆ readString() [6/6]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::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.
[out]_sdfPointer to an SDF object.
[out]_errorsParsing errors will be appended to this variable.
Returns
True if successful.

◆ readStringWithoutConversion() [1/2]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::readStringWithoutConversion ( const std::string &  _xmlString,
const ParserConfig _config,
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 strings are converted to the latest SDF version

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

◆ readStringWithoutConversion() [2/2]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::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.
[out]_sdfPointer to an SDF object.
[out]_errorsParsing errors will be appended to this variable.
Returns
True if successful.

◆ recursiveSameTypeUniqueNames() [1/2]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::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.

◆ recursiveSameTypeUniqueNames() [2/2]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::recursiveSameTypeUniqueNames ( sdf::Errors _errors,
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
[out]_errorsVector of errors.
[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.

◆ recursiveSiblingNoDoubleColonInNames() [1/2]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::recursiveSiblingNoDoubleColonInNames ( sdf::ElementPtr  _elem)

Check that all sibling elements do not contain the delimiter double colons '::' in element names, which is reserved for forming scopes in SDFormat 1.8.

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

Parameters
[in]_elemSDF Element to check recursively.
Returns
True if all contained element names do not have the delimiter '::'

◆ recursiveSiblingNoDoubleColonInNames() [2/2]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::recursiveSiblingNoDoubleColonInNames ( sdf::Errors _errors,
sdf::ElementPtr  _elem 
)

Check that all sibling elements do not contain the delimiter double colons '::' in element names, which is reserved for forming scopes in SDFormat 1.8.

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

Parameters
[out]_errorsVector of errors.
[in]_elemSDF Element to check recursively.
Returns
True if all contained element names do not have the delimiter '::'

◆ recursiveSiblingUniqueNames() [1/2]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::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.

◆ recursiveSiblingUniqueNames() [2/2]

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::recursiveSiblingUniqueNames ( sdf::Errors _errors,
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
[out]_errorsVector of errors.
[in]_elemSDF Element to check recursively.
Returns
True if all contained elements have do not share a name with sibling elements of any type.

◆ shouldValidateElement()

GZ_SDFORMAT_VISIBLE bool sdf::SDF_VERSION_NAMESPACE::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()

GZ_SDFORMAT_VISIBLE std::vector<std::string> sdf::SDF_VERSION_NAMESPACE::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.

◆ SplitName()

GZ_SDFORMAT_VISIBLE std::pair<std::string, std::string> sdf::SDF_VERSION_NAMESPACE::SplitName ( const std::string &  _absoluteName)

Split a name into a two strings based on the '::' delimeter.

Parameters
[in]_absoluteNameThe fully qualified absolute name
Returns
A pair with the absolute name minus the leaf node name, and the leaf name

◆ trim() [1/2]

GZ_SDFORMAT_VISIBLE std::string sdf::SDF_VERSION_NAMESPACE::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.

◆ trim() [2/2]

GZ_SDFORMAT_VISIBLE std::string sdf::SDF_VERSION_NAMESPACE::trim ( const std::string &  _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

class GZ_SDFORMAT_VISIBLE sdf::SDF_VERSION_NAMESPACE::Element

◆ kSdfScopeDelimiter

const std::string sdf::SDF_VERSION_NAMESPACE::kSdfScopeDelimiter = "::"

◆ kSdfStringSource

constexpr char sdf::SDF_VERSION_NAMESPACE::kSdfStringSource[] = "<data-string>"
constexpr

The source path replacement if it was parsed from a string, instead of a file.

◆ kUrdfStringSource

constexpr char sdf::SDF_VERSION_NAMESPACE::kUrdfStringSource[] = "<urdf-string>"
constexpr

The source path replacement if the urdf was parsed from a string, instead of a file.

◆ Param

class GZ_SDFORMAT_VISIBLE sdf::SDF_VERSION_NAMESPACE::Param

◆ SDF

class GZ_SDFORMAT_VISIBLE sdf::SDF_VERSION_NAMESPACE::SDF