Skip to content

Commit

Permalink
Merge pull request #1219 from gazebosim/scpeters/merge_13_main
Browse files Browse the repository at this point in the history
Merge sdf13 ➡️  main
  • Loading branch information
scpeters authored Jan 9, 2023
2 parents 94cdc7d + e91644f commit f39f571
Show file tree
Hide file tree
Showing 72 changed files with 3,434 additions and 429 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@ jobs:
- run: brew config
- run: brew list

# Workaround for https://github.com/actions/setup-python/issues/577
- name: Clean up python binaries
run: |
rm /usr/local/bin/2to3;
rm /usr/local/bin/idle3;
rm /usr/local/bin/pydoc3;
rm /usr/local/bin/python3;
rm /usr/local/bin/python3-config;
- name: Install base dependencies
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
run: |
brew tap osrf/simulation;
# check for ci_matching_branch
Expand Down
80 changes: 80 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,60 @@

## libsdformat 13.X

### libsdformat 13.3.0 (2022-12-12)

1. Sensor: add sdf::Errors output to API methods
* [Pull request #1138](https://github.com/gazebosim/sdformat/pull/1138)

1. Warn child joint that resolves to world
* [Pull request #1211](https://github.com/gazebosim/sdformat/pull/1211)

1. Converter: add sdf::Errors output to API methods
* [Pull request #1123](https://github.com/gazebosim/sdformat/pull/1123)

1. ParamPassing: sdfwarns to sdf::Errors when warnings policy set to sdf::EnforcementPolicy::ERR
* [Pull request #1135](https://github.com/gazebosim/sdformat/pull/1135)

1. Camera: added HasLensProjection
* [Pull request #1203](https://github.com/gazebosim/sdformat/pull/1203)

1. Change default `camera_info_topic` value to `__default__`
* [Pull request #1201](https://github.com/gazebosim/sdformat/pull/1201)

1. Check JointAxis expressed-in values during Load
* [Pull request #1195](https://github.com/gazebosim/sdformat/pull/1195)

1. Added camera info topic to Camera
* [Pull request #1198](https://github.com/gazebosim/sdformat/pull/1198)
* [Pull request #1200](https://github.com/gazebosim/sdformat/pull/1200)

1. Fix static URDF models with fixed joints
* [Pull request #1193](https://github.com/gazebosim/sdformat/pull/1193)

### libsdformat 13.2.0 (2022-10-20)

1. sdf/1.10/joint.sdf: add `screw_thread_pitch`
* [Pull request #1168](https://github.com/gazebosim/sdformat/pull/1168)

1. sdf/1.10: support //world/joint specification
* [Pull request #1117](https://github.com/gazebosim/sdformat/pull/1117)
* [Pull request #1189](https://github.com/gazebosim/sdformat/pull/1189)

1. Model: add sdf::Errors output to API methods
* [Pull request #1122](https://github.com/gazebosim/sdformat/pull/1122)

1. Added Root::WorldByName
* [Pull request #1121](https://github.com/gazebosim/sdformat/pull/1121)

1. Python: add OpticalFrameID APIs to pyCamera
* [Pull request #1184](https://github.com/gazebosim/sdformat/pull/1184)

1. Fix `GZ_PYTHON_INSTALL_PATH` value
* [Pull request #1183](https://github.com/gazebosim/sdformat/pull/1183)

1. Rename python bindings import library for Windows
* [Pull request #1165](https://github.com/gazebosim/sdformat/pull/1165)

### libsdformat 13.1.0 (2022-10-12)

1. Add test helper python package for encapsulating versioned python packages
Expand Down Expand Up @@ -1298,14 +1352,40 @@

## libsdformat 9.X

### libsdformat 9.10.0 (2022-11-30)

1. Ign to gz header migration.
* [Pull request #1118](https://github.com/gazebosim/sdformat/pull/1118)

1. Added HasLensProjection.
* [Pull request #1203](https://github.com/gazebosim/sdformat/pull/1203)

1. Added camera info topic to Camera
* [Pull request #1198](https://github.com/gazebosim/sdformat/pull/1198)
* [Pull request #1201](https://github.com/gazebosim/sdformat/pull/1201)

### libsdformat 9.9.1 (2022-11-08)

1. Fix static URDF models with fixed joints
* [Pull request #1193](https://github.com/gazebosim/sdformat/pull/1193)

1. Don't assume `CMAKE_INSTALL_*DIR` variables are relative
* [Pull request #1190](https://github.com/gazebosim/sdformat/pull/1190)

### libsdformat 9.9.0 (2022-09-07)

1. sdf/camera.sdf: fields for projection matrix
* [Pull request #1088](https://github.com/gazebosim/sdformat/pull/1088)

1. urdf: add //frame for reduced links/joints
* [Pull request #1148](https://github.com/gazebosim/sdformat/pull/1148)

1. urdf: fix sensor/light pose for links lumped by fixed joints
* [Pull request #1114](https://github.com/gazebosim/sdformat/pull/1114)

1. urdf: fix test and clean up internals
* [Pull request #1126](https://github.com/gazebosim/sdformat/pull/1126)

1. Ensure relocatable config files
* [Pull request #419](https://github.com/gazebosim/sdformat/pull/419)
* [Pull request #1093](https://github.com/gazebosim/sdformat/pull/1093)
Expand Down
6 changes: 6 additions & 0 deletions Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,10 @@ ABI was broken for `sdf::Element`, and restored on version 11.2.1.

## SDFormat specification 1.9 to 1.10

### Additions

1. **world.sdf**: A joint can be specified directly in a world.

### Modifications

1. **joint.sdf**: axis limits default values have changed
Expand All @@ -563,6 +567,8 @@ ABI was broken for `sdf::Element`, and restored on version 11.2.1.
+ `//limit/velocity`: `inf` (formerly `-1`)
+ `//limit/effort`: `inf` (formerly `-1`)

1. **joint.sdf**: thread_pitch is deprecated in favor of screw_thread_pitch.

1. **plugin.sdf**: name attribute is now optional with empty default value.

### Removals
Expand Down
12 changes: 12 additions & 0 deletions include/sdf/Camera.hh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ namespace sdf
/// an error code and message. An empty vector indicates no error.
public: Errors Load(ElementPtr _sdf);

/// \brief Get the camera info topic
/// \return Topic for the camera info
public: std::string CameraInfoTopic() const;

/// \brief Set the camera info topic
/// \param[in] _cameraInfoTopic Topic for the camera info.
public: void SetCameraInfoTopic(const std::string& _cameraInfoTopic);

/// \brief Get a pointer to the SDF element that was used during
/// load.
/// \return SDF element pointer. The value will be nullptr if Load has
Expand Down Expand Up @@ -558,6 +566,10 @@ namespace sdf
/// \return True if the camera has instrinsics values set, false otherwise
public: bool HasLensIntrinsics() const;

/// \brief Get whether or not the camera has projection values set
/// \return True if the camera has projection values set, false otherwise
public: bool HasLensProjection() const;

/// \brief Create and return an SDF element filled with data from this
/// camera.
/// Note that parameter passing functionality is not captured with this
Expand Down
10 changes: 10 additions & 0 deletions include/sdf/Error.hh
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@ namespace sdf

/// \brief Generic warning saved as error due to WarningsPolicy config
WARNING,

/// \brief The joint axis expressed-in value does not match the name of an
/// existing frame in the current scope.
JOINT_AXIS_EXPRESSED_IN_INVALID,

/// \brief SDF conversion generic error.
CONVERSION_ERROR,

/// \brief Generic error during parsing.
PARSING_ERROR,
};

class SDFORMAT_VISIBLE Error
Expand Down
26 changes: 22 additions & 4 deletions include/sdf/Joint.hh
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,27 @@ namespace sdf
/// \param[in] _frame The name of the pose relative-to frame.
public: void SetPoseRelativeTo(const std::string &_frame);

/// \brief Get the thread pitch (only valid for screw joints)
/// \return The thread pitch
/// \brief Get the displacement along the joint axis for each complete
/// revolution around the joint axis (only valid for screw joints).
/// \return The thread pitch with units of meters per revolution with a
/// positive value corresponding to a right-handed thread.
public: double ScrewThreadPitch() const;

/// \brief Set the thread pitch (only valid for screw joints).
/// \param[in] _threadPitch The thread pitch with units of meters per
/// revolution with a positive value corresponding to a right-handed thread.
public: void SetScrewThreadPitch(double _threadPitch);

/// \brief Get the thread pitch in gazebo-classic format (only valid for
/// screw joints). This will be deprecated in a future version.
/// \return The thread pitch with units of radians / meters and a positive
/// value coresponding to a left-handed thread.
public: double ThreadPitch() const;

/// \brief Set the thread pitch (only valid for screw joints)
/// \param[in] _threadPitch The thread pitch of the joint
/// \brief Set the thread pitch in gazebo-classic format (only valid for
/// screw joints). This will be deprecated in a future version.
/// \param[in] _threadPitch The thread pitch with units of radians / meters
/// and a positive value coresponding to a left-handed thread.
public: void SetThreadPitch(double _threadPitch);

/// \brief Get a pointer to the SDF element that was used during
Expand Down Expand Up @@ -291,6 +306,9 @@ namespace sdf
/// \brief Allow Model::Load to call SetPoseRelativeToGraph.
friend class Model;

/// \brief Allow World::Load to call SetPoseRelativeToGraph.
friend class World;

/// \brief Private data pointer.
GZ_UTILS_IMPL_PTR(dataPtr)
};
Expand Down
7 changes: 5 additions & 2 deletions include/sdf/ParserConfig.hh
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,17 @@ class SDFORMAT_VISIBLE ParserConfig
public: void RegisterCustomModelParser(CustomModelParser _modelParser);

/// \brief Get the registered custom model parsers
/// \return Vector of registered model parser callbacks.
public: const std::vector<CustomModelParser> &CustomModelParsers() const;

/// \brief Set the preserveFixedJoint flag.
/// \param[in] _preserveFixedJoint flag value to set
/// \param[in] _preserveFixedJoint True to preserve fixed joints, false to
/// reduce the fixed joints and merge the child link into the parent.
public: void URDFSetPreserveFixedJoint(bool _preserveFixedJoint);

/// \brief Get the preserveFixedJoint flag value.
/// \return Current flag value
/// \return True to preserve fixed joints, false to reduce the fixed joints
/// and merge the child link into the parent.
public: bool URDFPreserveFixedJoint() const;

/// \brief Set the storeResolvedURIs flag value.
Expand Down
14 changes: 14 additions & 0 deletions include/sdf/Root.hh
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,20 @@ namespace sdf
/// \sa uint64_t WorldCount() const
public: World *WorldByIndex(const uint64_t _index);

/// \brief Get a world based on a name.
/// \param[in] _name Name of the world.
/// \return Pointer to the world. Nullptr if a world with the given name
/// does not exist.
/// \sa bool WorldNameExists(const std::string &_name) const
public: const World *WorldByName(const std::string &_name) const;

/// \brief Get a world based on a name.
/// \param[in] _name Name of the world.
/// \return Pointer to the world. Nullptr if a world with the given name
/// does not exist.
/// \sa bool WorldNameExists(const std::string &_name) const
public: World *WorldByName(const std::string &_name);

/// \brief Get whether a world name exists.
/// \param[in] _name Name of the world to check.
/// \return True if there exists a world with the given name.
Expand Down
8 changes: 8 additions & 0 deletions include/sdf/Sensor.hh
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,14 @@ namespace sdf
/// \return SDF element pointer with updated sensor values.
public: sdf::ElementPtr ToElement() const;

/// \brief Create and return an SDF element filled with data from this
/// sensor.
/// Note that parameter passing functionality is not captured with this
/// function.
/// \param[in] _errors Vector of errors.
/// \return SDF element pointer with updated sensor values.
public: sdf::ElementPtr ToElement(sdf::Errors &_errors) const;

/// \brief Get the sensor type.
/// \return The sensor type.
public: SensorType Type() const;
Expand Down
65 changes: 63 additions & 2 deletions include/sdf/World.hh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ namespace sdf
class Actor;
class Frame;
class InterfaceModel;
class Joint;
class Light;
class Model;
class ParserConfig;
Expand Down Expand Up @@ -212,6 +213,12 @@ namespace sdf
/// exists.
public: bool AddActor(const Actor &_actor);

/// \brief Add a joint to the world.
/// \param[in] _joint Joint to add.
/// \return True if successful, false if a joint with the name already
/// exists.
public: bool AddJoint(const Joint &_joint);

/// \brief Add a light to the world.
/// \param[in] _light Light to add.
/// \return True if successful, false if a light with the name already
Expand All @@ -233,10 +240,13 @@ namespace sdf
/// \brief Remove all models.
public: void ClearModels();

/// \brief Remove all models.
/// \brief Remove all actors.
public: void ClearActors();

/// \brief Remove all models.
/// \brief Remove all joints.
public: void ClearJoints();

/// \brief Remove all lights.
public: void ClearLights();

/// \brief Remove all physics.
Expand Down Expand Up @@ -316,6 +326,45 @@ namespace sdf
/// \return True if there exists an explicit frame with the given name.
public: bool FrameNameExists(const std::string &_name) const;

/// \brief Get the number of joints.
/// \return Number of joints contained in this World object.
public: uint64_t JointCount() const;

/// \brief Get a joint based on an index.
/// \param[in] _index Index of the joint. The index should be in the
/// range [0..JointCount()).
/// \return Pointer to the joint. Nullptr if the index does not exist.
/// \sa uint64_t JointCount() const
public: const Joint *JointByIndex(uint64_t _index) const;

/// \brief Get a mutable joint based on an index.
/// \param[in] _index Index of the joint. The index should be in the
/// range [0..JointCount()).
/// \return Pointer to the joint. Nullptr if the index does not exist.
/// \sa uint64_t JointCount() const
public: Joint *JointByIndex(uint64_t _index);

/// \brief Get an joint based on a name.
/// \param[in] _name Name of the joint.
/// To get a joint in a nested model, prefix the joint name with the
/// sequence of nested models containing this joint, delimited by "::".
/// \return Pointer to the joint. Nullptr if the name does not
/// exist.
public: const Joint *JointByName(const std::string &_name) const;

/// \brief Get a mutable joint based on a name.
/// \param[in] _name Name of the joint.
/// To get a joint in a nested model, prefix the joint name with the
/// sequence of nested models containing this joint, delimited by "::".
/// \return Pointer to the joint. Nullptr if the name does not
/// exist.
public: Joint *JointByName(const std::string &_name);

/// \brief Get whether a joint name exists.
/// \param[in] _name Name of the joint to check.
/// \return True if there exists a joint with the given name.
public: bool JointNameExists(const std::string &_name) const;

/// \brief Get the number of lights.
/// \return Number of lights contained in this World object.
public: uint64_t LightCount() const;
Expand Down Expand Up @@ -438,6 +487,18 @@ namespace sdf
public: sdf::ElementPtr ToElement(
const OutputConfig &_config = OutputConfig::GlobalConfig()) const;

/// \brief Check if a given name exists in the FrameAttachedTo graph at the
/// scope of the world.
/// \param[in] _name Name of the implicit or explicit frame to check.
/// To check for a frame in a nested model, prefix the frame name with
/// the sequence of nested models containing this frame, delimited by "::".
/// \return True if the frame name is found in the FrameAttachedTo graph.
/// False otherwise, or if the frame graph is invalid.
/// \note This function assumes the world has a valid FrameAttachedTo graph.
/// It will return false if the graph is invalid.
public: bool NameExistsInFrameAttachedToGraph(
const std::string &_name) const;

/// \brief Get the plugins attached to this object.
/// \return A vector of Plugin, which will be empty if there are no
/// plugins.
Expand Down
Loading

0 comments on commit f39f571

Please sign in to comment.