This document contains information about migrating
between different versions of the SDFormat specification.
The SDFormat specification version number is specified in the version
attribute of the sdf element (1.4, 1.5, 1.6, etc.)
and is distinct from sdformat library version
(2.3, 3.0, 4.0, etc.).
There are *.convert files that allow old sdf files to be migrated
forward programmatically.
This document aims to contain similar information to those files
but with improved human-readability..
ABI was broken for sdf::Element, and restored on version 11.2.1.
-
sdf/Console.hh Add functions to retrieve message stream objects. These can be useful for redirecting the console output to other streams.
- ConsoleStream &GetMsgStream()
- ConsoleStream &GetLogStream()
-
sdf/ParserConfig.hh:
- void SetDeprecatedElementsPolicy(EnforcementPolicy _policy)
- void ResetDeprecatedElementsPolicy()
- EnforcementPolicy DeprecatedElementsPolicy() const
-
test/test_utils.hh:
- ScopeExit: A utility struct that calls a function when going out of scope.
- RedirectConsoleStream: A utility class used for redirecting the output of sdferr, sdfwarn, etc to a more convenient stream object like a std::stringstream for testing purposes.
-
sdf/ParserConfig.hh A class that contains configuration options for the libsdformat parser.
-
- Depend on ignition-utils1 for the ImplPtr and UniqueImplPtr.
- Pull request 474
-
sdf/Joint.hh
- Errors ResolveChildLink(std::string&) const
- Errors ResolveParentLink(std::string&) const
-
sdf/Model.hh:
- std::pair<const Link *, std::string> CanonicalLinkAndRelativeName() const;
-
sdf/Root.hh sdf::Root elements can now only contain one of either Model, Light or Actor since multiple items would conflict with overrides specified in an tag.
- const sdf::Model *Model();
- const sdf::Light *Light();
- const sdf::Actor *Actor();
-
sdf/Model.hh: the following methods now accept nested names relative to the model's scope that can begin with a sequence of nested model names separated by
::and may end with the name of an object of the specified type.- const Frame *FrameByName(const std::string &) const
- const Joint *JointByName(const std::string &) const
- const Link *LinkByName(const std::string &) const
- bool FrameNameExists(const std::string &) const
- bool JointNameExists(const std::string &) const
- bool LinkNameExists(const std::string &) const
-
sdf/Heightmap.hh: sampling now defaults to 1 instead of 2.
- src/Root.hh: The following methods have been deprecated in favor of the
new methods. For now the behavior is unchanged, but Root elements should
only contain one or none of Model/Light/Actor.
- const sdf::Model *ModelByIndex();
- uint64_t ModelCount();
- bool ModelNameExists(const std::string &_name) const;
- const sdf::Light *LightByIndex();
- uint64_t LightCount();
- bool LightNameExists(const std::string &_name) const;
- const sdf::Actor *ActorByIndex();
- uint64_t ActorCount();
- bool ActorNameExists(const std::string &_name) const;
-
Fixed Atmosphere DOM class's temperature default value. Changed from -0.065 to -0.0065.
-
Fixed parsing of
<sensor><pose>tags on lumped links when converting from URDF.
-
Axis vectors specified in are normalized if their norm is greater than 0. A vector with 0 norm generates an error
-
- Depend on tinyxml2 instead of tinyxml for XML parsing.
- Pull request 264
-
- Minimum/maximum values specified in SDFormat description files are now enforced
- Pull request 303
-
- Parsing of bad values generates an error
- Pull request 244
-
- Removed the
parser_urdf.hhheader file and itsURDF2SDFclass - Pull request 276
- Removed the
-
- Removed the deprecated
Pose(),SetPose(), and*PoseFrame()API's in all DOM classes: - const ignition::math::Pose3d &Pose()
- void SetPose(const ignition::math::Pose3d &)
- const std::string &PoseFrame()
- void SetPoseFrame(const std::string &)
- Removed the deprecated
-
- Removed deprecated functions from sdf/JointAxis.hh:
- bool UseParentModelFrame()
- void SetUseParentModelFrame(bool)
-
sdf/Element.hh
- void AddValue(const std::string &, const std::string &, bool, const std::string &, const std::string &, const std::string &)
-
sdf/Param.hh
- Param(const std::string &, const std::string &e, const std::string &, bool, const std::string &, const std::string &, const std::string &)
- std::optionalstd::string GetMinValueAsString() const;
- std::optionalstd::string GetMaxValueAsString() const;
- bool ValidateValue() const;
- sdf/Element.hh
- sdf::ElementPtr FindElement() const
- camera.sdf
- Reduce minimum value of
//camera/clip/far
- Reduce minimum value of
- Fix spelling of supported shader types in
//material/shader/@typenormal_map_objectspacereplaced bynormal_map_object_spacenormal_map_tangentspacereplaced bynormal_map_tangent_space- pull request 383
- sdf/Model.hh
- uint64_t ModelCount() const
- const Model *ModelByIndex(const uint64_t) const
- const Model *ModelByName(const std::string &) const
- bool ModelNameExists(const std::string &) const
- Permit models without links if they contain a nested canonical link.
-
sdf/Collision.hh
- sdf::SemanticPose SemanticPose() const
-
sdf/Element.hh
- void Clear()
- const std::string &OriginalVersion() const
- void SetOriginalVersion(const std::string &)
-
sdf/Frame.hh: DOM class for frames in the model or world.
- Errors ResolveAttachedToBody(std::string&) const
- sdf::SemanticPose SemanticPose() const
-
sdf/Joint.hh
- sdf::SemanticPose SemanticPose() const
-
sdf/JointAxis.hh
- Errors ResolveXyz(ignition::math::Vector3d &, const std::string &) const
-
sdf/Light.hh
- sdf::SemanticPose SemanticPose() const
-
sdf/Link.hh
- sdf::SemanticPose SemanticPose() const
-
sdf/Model.hh
- uint64_t FrameCount() const
- const Frame *FrameByIndex(const uint64_t) const
- const Frame *FrameByName(const std::string &) const
- bool FrameNameExists(const std::string &) const
- sdf::SemanticPose SemanticPose() const
-
sdf/SDFImpl.hh
- void Clear()
- const std::string &OriginalVersion() const
- void SetOriginalVersion(const std::string &)
-
sdf/SemanticPose.hh: Helper class for resolving poses of DOM objects.
-
sdf/Sensor.hh
- sdf::SemanticPose SemanticPose() const
-
sdf/Visual.hh
- sdf::SemanticPose SemanticPose() const
-
sdf/World.hh
- uint64_t FrameCount() const
- const Frame *FrameByIndex(const uint64_t) const
- const Frame *FrameByName(const std::string &) const
- bool FrameNameExists(const std::string &) const
- const Model *ModelByName(const std::string &) const
-
sdf/parser.hh
- bool checkCanonicalLinkNames(sdf::Root*)
- bool checkFrameAttachedToGraph(sdf::Root*)
- bool checkFrameAttachedToNames(sdf::Root*)
- bool checkJointParentChildLinkNames(sdf::Root*)
- bool checkPoseRelativeToGraph(sdf::Root*)
- bool recursiveSameTypeUniqueNames(sdf::ElementPtr)
- bool recursiveSiblingUniqueNames(sdf::ElementPtr)
- bool shouldValidateElement(sdf::ElementPtr)
-
sdf/parser_urdf.hh
- Deprecation: URDF2SDF
- Replacement: None. Use the functions sdf::readFile or sdf::readString, which automatically convert URDF to SDFormat.
-
All DOM classes with
Pose()andPoseFrame()API's:- Deprecation: const ignition::math::Pose3d &Pose()
- Replacement: const ignition::math::Pose3d &RawPose()
- Deprecation: const std::string &PoseFrame()
- Replacement: const std::string &PoseRelativeTo()
- Deprecation: void SetPose(const ignition::math::Pose3d &)
- Replacement: void SetRawPose(const ignition::math::Pose3d &)
- Deprecation: void SetPoseFrame(const std::string &)
- Replacement: void SetPoseRelativeTo(const std::string &)
-
sdf/JointAxis.hh
- Deprecation: bool UseParentModelFrame()
- Replacement: const std::string &XyzExpressedIn()
- Deprecation: void SetUseParentModelFrame(bool)
- Replacement: void SetXyzExpressedIn(const std::string &)
-
- Change installation path of SDF description files to allow side-by-side installation.
{prefix}/share/sdformat/1.*/*.sdf->{prefix}/share/sdformat8/1.*/*.sdf- BitBucket pull request 538
- sdf/Types.hh
- Deprecated: sdf::Color class
- Replacement: ignition::math::Color class
- Removed the following functions from
parser.hh- bool initDoc(TiXmlDocument *_xmlDoc, SDFPtr _sdf);
- bool initDoc(TiXmlDocument *_xmlDoc, ElementPtr _sdf);
- bool initXml(TiXmlElement *_xml, ElementPtr _sdf);
- bool readDoc(TiXmlDocument *_xmlDoc, SDFPtr _sdf, const std::string &_source);
- bool readDoc(TiXmlDocument *_xmlDoc, ElementPtr _sdf, const std::string &_source);
- bool readXml(TiXmlElement *_xml, ElementPtr _sdf);
- void copyChildren(ElementPtr _sdf, TiXmlElement *_xml);
- std::string getBestSupportedModelVersion(TiXmlElement *_modelXML, std::string &_modelFileName);
-
sdf/Param.hh
- Deprecation: const std::type_info &GetType() const
- Replacement: template bool IsType() const
-
sdf/SDFImpl.hh
- Deprecation: ElementPtr root
- Replacement: ElementPtr Root() const / void Root(const ElementPtr _root)
- Deprecation: static std::string version
- Replacement: static std::string Version()
-
sdf/Types.hh
- Deprecation: sdf::Vector2i
- Replacement: ignition::math::Vector2i
- Deprecation: sdf::Vector2d
- Replacement: ignition::math::Vector2d
- Deprecation: sdf::Vector3
- Replacement: ignition::math::Vector3d
- Deprecation: sdf::Quaternion
- Replacement: ignition::math::Quaterniond
- Deprecation: sdf::Pose
- Replacement: ignition::math::Pose3d
- New SDFormat specification version 1.6
- Details about the 1.5 to 1.6 transition are explained below in this same document
-
Boost pointers and boost::function
- All boost pointers, boost::function in the public API have been replaced by their std:: equivalents (C++11 standard)
-
Lump:: prefix in link names
- Changed to
_fixed_joint_lump__to avoid confusion with scoped names - BitBucket pull request 245
- Changed to
-
capsule.sdf and ellipsoid.sdf new shape types included in
//geometrycapsule.sdf: A shape consisting of a cylinder capped by hemispheres with parameters for theradiusandlengthof cylindrical section.ellipsoid.sdf: A convex shape with up to three radii defining its shape in of the form (x^2/a^2 + y^2/b^2 + z^2/c^2 = 1).
-
light.sdf
//light/intensityelement- description: Scale factor to set the relative power of a light.
- type: double
- default: 1
- required: 0
- pull request 484
-
joint.sdf
childandparentelements accept frame names instead of only link names -
heightmap.sdf: sampling now defaults to 1 instead of 2.
-
Element attribute names containing delimiter "::" no longer accepted
- joint.sdf
initial_positionelement in<joint><axis>and<joint><axis2>is deprecated
- inerial.sdf
//inertial/pose/@relative_toattribute is removed
-
frame.sdf
//frame/@attached_toattribute- description: Name of the link or frame to which this frame is attached. If a frame is specified, recursively following the attached_to attributes of the specified frames must lead to the name of a link, a model, or the world frame.
- type: string
- default: ""
- required: *
- BitBucket pull request 603
-
joint.sdf
//axis/xyz/@expressed_inand//axis2/xyz/@expressed_inattributes- description: The name of the frame in which the
//axis/xyzvalue is expressed. When migrating from sdf 1.6, ause_parent_model_framevalue oftruewill be mapped to a value of__model__for theexpressed_inattribute. - type: string
- default: ""
- required: 0
- BitBucket pull request 589
- description: The name of the frame in which the
-
material.sdf
//material/double_sidedelement- description: Flag to indicate whether the mesh that this material is applied to will be rendered as double sided.
- type: bool
- default: false
- required: 0
- pull request 418
-
model.sdf
//model/@canonical_linkattribute- description: The name of the canonical link in this model to which the model's implicit frame is attached. This implies that a model must have at least one link (unless it is static), which is also stated in the Modifications section.
- type: string
- default: ""
- required: 0
- BitBucket pull request 601
-
world.sdf
//world/frameelement is now allowed.
-
A non-static model must have at least one link, as specified in the proposal.
-
Unique names for all sibling elements:
- As described in the proposal,
all named sibling elements must have unique names.
Uniqueness is forced so that referencing implicit frames is not ambiguous,
e.g. you cannot have a link and joint share an implicit frame name.
Some existing SDFormat models may not comply with this requirement.
The
ign sdf --checkcommand can be used to identify models that violate this requirement. - BitBucket pull request 600
- As described in the proposal,
all named sibling elements must have unique names.
Uniqueness is forced so that referencing implicit frames is not ambiguous,
e.g. you cannot have a link and joint share an implicit frame name.
Some existing SDFormat models may not comply with this requirement.
The
-
Reserved names:
- As described in the proposal,
entities in a simulation must not use world as a name.
It has a special interpretation when specified as a parent or child link
of a joint.
Names starting and ending with double underscores (eg.
__wheel__) must be reserved for use by library implementors and the specification. For example, such names might be useful during parsing for setting sentinel or default names for elements with missing names. If explicitly stated, they can be referred to (e.g.__model__/worldfor implicit model / world frames, respectively).
- As described in the proposal,
entities in a simulation must not use world as a name.
It has a special interpretation when specified as a parent or child link
of a joint.
Names starting and ending with double underscores (eg.
-
joint.sdf
//joint/childmay no longer be specified asworld. -
pose.sdf
//pose/@frameattribute is renamed to//pose/@relative_to.
-
<frame>element is now only allowed in<model>and<world>. It is no longer allowed in the following elements:- actor
- audio_source
- camera
- collision
- frame
- gui
- inertial
- joint
- light
- light_state
- link
- link_state
- population
- projector
- sensor
- visual
- BitBucket pull request 603
-
actor.sdf
staticelement was deprecated in BitBucket pull request 280 and is now removed. -
imu.sdf
topicelement was deprecated in BitBucket pull request 532 and is now removed. -
joint.sdf
//axis/use_parent_model_frameand//axis2/use_parent_model_frameelements are removed in favor of the//axis/xyz/@expressed_inand//axis2/xyz/@expressed_inattributes. When migrating from sdf 1.6, ause_parent_model_framevalue oftruewill be mapped to a value of__model__for theexpressed_inattribute. -
joint.sdf
//physics/ode/provide_feedbackwas deprecated in BitBucket pull request 38 and is now removed. -
world.sdf
//world/jointwas removed as it has never been used.
-
actor.sdf
tensionelement- description: The tension of the trajectory spline. The default value of zero equates to a Catmull-Rom spline, which may also cause the animation to overshoot keyframes. A value of one will cause the animation to stick to the keyframes.
- type: double
- default: 0.0
- min: 0.0
- max: 1.0
- required: 0
- BitBucket pull request 466
-
camera.sdf
depth_camera/clipsub-elements:near,far- description: Clipping parameters for depth camera on rgbd camera sensor.
- BitBucket pull request 628
-
camera.sdf
intrinsicssub-elements:fx,fy,cx,cy,s- description: Camera intrinsic parameters for setting a custom perspective projection matrix.
- BitBucket pull request 496
-
heightmap_shape.sdf
samplingelement- description: Samples per heightmap datum. For rasterized heightmaps, this indicates the number of samples to take per pixel. Using a lower value, e.g. 1, will generally improve the performance of the heightmap but lower the heightmap quality.
- type: unsigned int
- default: 2
- required: 0
- Bitbucket pull request 293
-
link.sdf
enable_windelement- description: If true, the link is affected by the wind
- type: bool
- default: false
- required: 0
- BitBucket pull request 240
-
link.sdf
lightelement- included from
light.sdfwithrequired="*", so a link can have any number of attached lights. - BitBucket pull request 373
- included from
-
model.sdf
enable_windelement- description: If set to true, all links in the model will be affected by the wind. Can be overriden by the link wind property.
- type: bool
- default: false
- required: 0
- BitBucket pull request 240
-
model_state.sdf
scaleelement- description: Scale for the 3 dimensions of the model.
- type: vector3
- default: "1 1 1"
- required: 0
- BitBucket pull request 246
-
physics.sdf
dart::collision_detectorelement- description: The collision detector for DART to use. Can be dart, fcl, bullet or ode.
- type: string
- default: fcl
- required: 0
- BitBucket pull request 440
-
physics.sdf
dart::solver::solver_typeelement- description: The DART LCP/constraint solver to use. Either dantzig or pgs (projected Gauss-Seidel)
- type: string
- default: dantzig
- required: 0
- BitBucket pull request 369
-
physics.sdf
friction_modelelement- description: Name of ODE friction model to use. Valid values include:
- pyramid_model: (default) friction forces limited in two directions in proportion to normal force.
- box_model: friction forces limited to constant in two directions.
- cone_model: friction force magnitude limited in proportion to normal force. See gazebo pull request 1522 (merged in gazebo 8c05ad64967c) for the implementation of this feature.
- type: string
- default: "pyramid_model"
- required: 0
- Bitbucket pull request 294
- description: Name of ODE friction model to use. Valid values include:
-
physics.sdf
island_threadselement underode::solver- description: Number of threads to use for "islands" of disconnected models.
- type: int
- default: 0
- required: 0
- BitBucket pull request 380
-
physics.sdf
thread_position_correctionelement underode::solver- description: Flag to use threading to speed up position correction computation.
- type: bool
- default: 0
- required: 0
- BitBucket pull request 380
-
sonar.sdf
geometryelement- description: The sonar collision shape. Currently supported geometries are: "cone" and "sphere".
- type: string
- default: "cone"
- required: 0
- BitBucket pull request 495
-
state.sdf allow
lighttags withininsertionselement -
surface.sdf
category_bitmaskelement- description: Bitmask for category of collision filtering.
Collision happens if
((category1 & collision2) | (category2 & collision1))is not zero. If not specified, the category_bitmask should be interpreted as being the same as collide_bitmask. - type: unsigned int
- default: 65535
- required: 0
- BitBucket pull request 318
- description: Bitmask for category of collision filtering.
Collision happens if
-
world.sdf
windelement- description: The wind tag specifies the type and properties of the wind.
- required: 0
- BitBucket pull request 240
-
world.sdf
wind::linear_velocityelement- description: Linear velocity of the wind.
- type: vector3
- default: "0 0 0"
- required: 0
- BitBucket pull request 240
-
gravityandmagnetic_fieldelements are moved fromphysicstoworld- In physics element: gravity and
magnetic_fieldtags have been moved from Physics to World element. - BitBucket pull request 247
- BitBucket gazebo pull request 2090
- In physics element: gravity and
-
New noise for IMU
- A new style for representing the noise properties of an
imuwas implemented in BitBucket pull request 199 for sdf 1.5 and the old style was declared as deprecated. The old style has been removed from sdf 1.6 with the conversion script updating to the new style. - BitBucket pull request 199
- BitBucket pull request 243
- BitBucket pull request 244
- A new style for representing the noise properties of an