Skip to content

Latest commit

 

History

History
425 lines (343 loc) · 18.6 KB

Migration.md

File metadata and controls

425 lines (343 loc) · 18.6 KB

Migration Guide for SDF Protocol

This document contains information about migrating between different versions of the SDF protocol. The SDF protocol 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.).

Note on backward compatibility

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..

SDFormat 8.x to 9.0

Additions

  1. sdf/Collision.hh

    • sdf::SemanticPose SemanticPose() const
  2. sdf/Element.hh

    • void Clear()
    • const std::string &OriginalVersion() const
    • void SetOriginalVersion(const std::string &)
  3. sdf/Frame.hh: DOM class for frames in the model or world.

    • Errors ResolveAttachedToBody(std::string&) const
    • sdf::SemanticPose SemanticPose() const
  4. sdf/Joint.hh

    • sdf::SemanticPose SemanticPose() const
  5. sdf/JointAxis.hh

    • Errors ResolveXyz(ignition::math::Vector3d &, const std::string &) const
  6. sdf/Light.hh

    • sdf::SemanticPose SemanticPose() const
  7. sdf/Link.hh

    • sdf::SemanticPose SemanticPose() const
  8. 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
  9. sdf/SDFImpl.hh

    • void Clear()
    • const std::string &OriginalVersion() const
    • void SetOriginalVersion(const std::string &)
  10. sdf/SemanticPose.hh: Helper class for resolving poses of DOM objects.

  11. sdf/Sensor.hh

    • sdf::SemanticPose SemanticPose() const
  12. sdf/Visual.hh

    • sdf::SemanticPose SemanticPose() const
  13. 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
  14. 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)

Deprecations

  1. sdf/parser_urdf.hh

    • Deprecation: URDF2SDF
    • Replacement: None. Use the functions sdf::readFile or sdf::readString, which automatically convert URDF to SDFormat.
  2. All DOM classes with Pose() and PoseFrame() 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 &)
  3. sdf/JointAxis.hh

    • Deprecation: bool UseParentModelFrame()
    • Replacement: const std::string &XyzExpressedIn()
    • Deprecation: void SetUseParentModelFrame(bool)
    • Replacement: void SetXyzExpressedIn(const std::string &)

SDFormat 8.0 to 8.1

Modifications

    • 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

SDFormat 5.x to 6.x

Deprecations

  1. sdf/Types.hh
    • Deprecated: sdf::Color class
    • Replacement: ignition::math::Color class

SDFormat 4.x to 5.x

Deletions

  1. 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);

Deprecations

  1. sdf/Param.hh

    • Deprecation: const std::type_info &GetType() const
    • Replacement: template bool IsType() const
  2. 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()
  3. 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

SDFormat 3.x to 4.x

Additions

  1. New SDF protocol version 1.6
    • Details about the 1.5 to 1.6 transition are explained below in this same document

Modifications

  1. Boost pointers and boost::function

    • All boost pointers, boost::function in the public API have been replaced by their std:: equivalents (C++11 standard)
  2. gravity and magnetic_field elements are moved from physics to world

  3. New noise for IMU

  4. Lump:: prefix in link names

SDF protocol 1.7 to 1.8

Deprecations

  1. joint.sdf initial_position element in <joint><axis> and <joint><axis2> is deprecated

SDF protocol 1.6 to 1.7

Additions

  1. frame.sdf //frame/@attached_to attribute

    • 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 or the world frame.
    • type: string
    • default: ""
    • required: *
    • BitBucket pull request 603
  2. joint.sdf //axis/xyz/@expressed_in and //axis2/xyz/@expressed_in attributes

    • description: The name of the frame in which the //axis/xyz value is expressed. When migrating from sdf 1.6, a use_parent_model_frame value of true will be mapped to a value of __model__ for the expressed_in attribute.
    • type: string
    • default: ""
    • required: 0
    • BitBucket pull request 589
  3. model.sdf //model/@canonical_link attribute

    • 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
  4. world.sdf //world/frame element is now allowed.

Modifications

  1. A non-static model must have at least one link, as specified in the proposal.

  2. 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 --check command can be used to identify models that violate this requirement.
    • BitBucket pull request 600
  3. 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__ / world for implicit model / world frames, respectively).
  4. joint.sdf //joint/child may no longer be specified as world.

  5. pose.sdf //pose/@frame attribute is renamed to //pose/@relative_to.

Removals

  1. <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
  2. actor.sdf static element was deprecated in BitBucket pull request 280 and is now removed.

  3. imu.sdf topic element was deprecated in BitBucket pull request 532 and is now removed.

  4. joint.sdf //axis/use_parent_model_frame and //axis2/use_parent_model_frame elements are removed in favor of the //axis/xyz/@expressed_in and //axis2/xyz/@expressed_in attributes. When migrating from sdf 1.6, a use_parent_model_frame value of true will be mapped to a value of __model__ for the expressed_in attribute.

  5. joint.sdf //physics/ode/provide_feedback was deprecated in BitBucket pull request 38 and is now removed.

  6. world.sdf //world/joint was removed as it has never been used.

SDF protocol 1.5 to 1.6

Additions

  1. actor.sdf tension element

    • 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
  2. camera.sdf depth_camera/clip sub-elements: near, far

  3. camera.sdf intrinsics sub-elements: fx, fy, cx, cy, s

  4. link.sdf enable_wind element

  5. link.sdf light element

  6. model.sdf enable_wind element

    • 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
  7. model_state.sdf scale element

  8. physics.sdf dart::collision_detector element

    • 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
  9. physics.sdf dart::solver::solver_type element

    • 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
  10. physics.sdf island_threads element under ode::solver

    • description: Number of threads to use for "islands" of disconnected models.
    • type: int
    • default: 0
    • required: 0
    • BitBucket pull request 380
  11. physics.sdf thread_position_correction element under ode::solver

    • description: Flag to use threading to speed up position correction computation.
    • type: bool
    • default: 0
    • required: 0
    • BitBucket pull request 380
  12. sonar.sdf geometry element

    • description: The sonar collision shape. Currently supported geometries are: "cone" and "sphere".
    • type: string
    • default: "cone"
    • required: 0
    • BitBucket pull request 495
  13. state.sdf allow light tags within insertions element

  14. surface.sdf category_bitmask element

    • 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
  15. world.sdf wind element

  16. world.sdf wind::linear_velocity element