Skip to content

Commit

Permalink
Merge branch 'sdf13' into scpeters/pick_fix_find_python
Browse files Browse the repository at this point in the history
  • Loading branch information
scpeters authored Jun 24, 2024
2 parents c934030 + 7831063 commit 548d4fe
Show file tree
Hide file tree
Showing 37 changed files with 1,669 additions and 95 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0004 NEW)
endif(COMMAND CMAKE_POLICY)

project (sdformat13 VERSION 13.6.0)
project (sdformat13 VERSION 13.7.0)

# The protocol version has nothing to do with the package version.
# It represents the current version of SDFormat implemented by the software
Expand Down
51 changes: 51 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
## libsdformat 13.X

### libsdformat 13.7.0 (2024-06-13)

1. Add support for no gravity link
* [Pull request #1410](https://github.com/gazebosim/sdformat/pull/1410)
* [Pull request #1419](https://github.com/gazebosim/sdformat/pull/1419)

1. Fix macOS workflow and backport windows fix
* [Pull request #1409](https://github.com/gazebosim/sdformat/pull/1409)

1. Fix warning with pybind11 2.12
* [Pull request #1389](https://github.com/gazebosim/sdformat/pull/1389)

1. Add bullet and torsional friction DOM
* [Pull request #1351](https://github.com/gazebosim/sdformat/pull/1351)
* [Pull request #1427](https://github.com/gazebosim/sdformat/pull/1427)

1. Resolve URIs relative to file path
* [Pull request #1373](https://github.com/gazebosim/sdformat/pull/1373)

1. Bazel updates for Garden build
* [Pull request #1239](https://github.com/gazebosim/sdformat/pull/1239)

1. Fix static builds and optimize test compilation
* [Pull request #1343](https://github.com/gazebosim/sdformat/pull/1343)
* [Pull request #1347](https://github.com/gazebosim/sdformat/pull/1347)

1. Install ruby commands on Windows
* [Pull request #1339](https://github.com/gazebosim/sdformat/pull/1339)
* [Pull request #1341](https://github.com/gazebosim/sdformat/pull/1341)

1. Update github action workflows
* [Pull request #1345](https://github.com/gazebosim/sdformat/pull/1345)

1. URDF->SDF handle links with no inertia or small mass
* [Pull request #1238](https://github.com/gazebosim/sdformat/pull/1238)

### libsdformat 13.6.0 (2023-08-30)

1. Use relative path in an urdf include to avoid confusion between internal and system headers
Expand Down Expand Up @@ -462,6 +498,21 @@

## libsdformat 12.X

### libsdformat 12.8.0 (2024-06-06)

1. Add support for no gravity link
* [Pull request #1410](https://github.com/gazebosim/sdformat/pull/1410)

1. Add bullet and torsional friction DOM
* [Pull request #1351](https://github.com/gazebosim/sdformat/pull/1351)

1. Fix static builds and optimize test compilation
* [Pull request #1343](https://github.com/gazebosim/sdformat/pull/1343)
* [Pull request #1347](https://github.com/gazebosim/sdformat/pull/1347)

1. Update github action workflows
* [Pull request #1345](https://github.com/gazebosim/sdformat/pull/1345)

### libsdformat 12.7.2 (2023-09-01)

1. Fixed 1.9/light.sdf
Expand Down
10 changes: 10 additions & 0 deletions include/sdf/Link.hh
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,22 @@ namespace sdf
/// \sa bool Model::EnableWind
public: bool EnableWind() const;

/// \brief Check if this link should be subject to gravity.
/// If true, this link should be affected by gravity.
/// \return true if the model should be subject to gravity, false otherwise.
public: bool EnableGravity() const;

/// \brief Set whether this link should be subject to wind.
/// \param[in] _enableWind True or false depending on whether the link
/// should be subject to wind.
/// \sa Model::SetEnableWind(bool)
public: void SetEnableWind(bool _enableWind);

/// \brief Set whether this link should be subject to gravity.
/// \param[in] _enableGravity True or false depending on whether the link
/// should be subject to gravity.
public: void SetEnableGravity(bool _enableGravity);

/// \brief Add a collision to the link.
/// \param[in] _collision Collision to add.
/// \return True if successful, false if a collision with the name already
Expand Down
6 changes: 5 additions & 1 deletion include/sdf/ParserConfig.hh
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ class SDFORMAT_VISIBLE ParserConfig
/// and merge the child link into the parent.
public: bool URDFPreserveFixedJoint() const;

/// \brief Set the storeResolvedURIs flag value.
/// \sa SetStoreResolvedURIs
public: void SetStoreResovledURIs(bool _resolveURI);

/// \brief Set the storeResolvedURIs flag value.
/// \param[in] _resolveURI True to make the parser attempt to resolve any
/// URIs found and store them. False to preserve original URIs
Expand All @@ -188,7 +192,7 @@ class SDFORMAT_VISIBLE ParserConfig
/// If the FindFileCallback provides a non-empty string, the URI will be
/// stored in the DOM object, and the original (unresolved) URI will be
/// stored in the underlying Element.
public: void SetStoreResovledURIs(bool _resolveURI);
public: void SetStoreResolvedURIs(bool _resolveURI);

/// \brief Get the storeResolvedURIs flag value.
/// \return True if the parser will attempt to resolve any URIs found and
Expand Down
145 changes: 145 additions & 0 deletions include/sdf/Surface.hh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#ifndef SDF_SURFACE_HH_
#define SDF_SURFACE_HH_

#include <gz/math/Vector3.hh>
#include <gz/utils/ImplPtr.hh>
#include "sdf/Element.hh"
#include "sdf/Types.hh"
Expand Down Expand Up @@ -122,6 +123,132 @@ namespace sdf
GZ_UTILS_IMPL_PTR(dataPtr)
};

/// \brief BulletFriction information for a friction.
class SDFORMAT_VISIBLE BulletFriction
{
/// \brief Default constructor
public: BulletFriction();

/// \brief Load BulletFriction friction based on a element pointer. This is
/// *not* the usual entry point. Typical usage of the SDF DOM is through
/// the Root object.
/// \param[in] _sdf The SDF Element pointer
/// \return Errors, which is a vector of Error objects. Each Error includes
/// an error code and message. An empty vector indicates no error.
public: Errors Load(ElementPtr _sdf);

/// \brief Get the friction coefficient in first friction pyramid direction.
/// \returns Friction coefficient
public: double Friction() const;

/// \brief Set friction coefficient in first friction pyramid direction.
/// \param[in] _fricton Friction coefficient
public: void SetFriction(double _friction);

/// \brief Get the friction coefficient in second friction pyramid
/// direction.
/// \return Second friction coefficient
public: double Friction2() const;

/// \brief Set friction coefficient in second friction pyramid direction.
/// \param[in] _fricton Friction coefficient
public: void SetFriction2(double _friction);

/// \brief Get the first friction pyramid direction in collision-fixed
/// reference
/// \return First friction pyramid direction.
public: const gz::math::Vector3d &Fdir1() const;

/// \brief Set the first friction pyramid direction in collision-fixed
/// reference
/// \param[in] _fdir First friction pyramid direction.
public: void SetFdir1(const gz::math::Vector3d &_fdir);

/// \brief Get the rolling friction coefficient
/// \return Rolling friction coefficient
public: double RollingFriction() const;

/// \brief Set the rolling friction coefficient
/// \param[in] _slip1 Rolling friction coefficient
public: void SetRollingFriction(double _friction);

/// \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
/// not been called.
public: sdf::ElementPtr Element() const;

/// \brief Private data pointer.
GZ_UTILS_IMPL_PTR(dataPtr)
};

/// \brief Torsional friction
class SDFORMAT_VISIBLE Torsional
{
/// \brief Default constructor
public: Torsional();

/// \brief Load torsional friction based on a element pointer. This is *not*
/// the usual entry point. Typical usage of the SDF DOM is through the Root
/// object.
/// \param[in] _sdf The SDF Element pointer
/// \return Errors, which is a vector of Error objects. Each Error includes
/// an error code and message. An empty vector indicates no error.
public: Errors Load(ElementPtr _sdf);

/// \brief Get the torsional friction coefficient.
/// \return Torsional friction coefficient
public: double Coefficient() const;

/// \brief Set the torsional friction coefficient.
/// \param[in] _fricton Torsional friction coefficient
public: void SetCoefficient(double _coefficient);

/// \brief Get whether the patch radius is used to calculate torsional
/// friction.
/// \return True if patch radius is used.
public: bool UsePatchRadius() const;

/// \brief Set whether to use patch radius for torsional friction
/// calculation.
/// \param[in] _usePatchRadius True to use patch radius.
/// False to use surface radius.
public: void SetUsePatchRadius(bool _usePatchRadius);

/// \brief Get the radius of contact patch surface.
/// \return Patch radius
public: double PatchRadius() const;

/// \brief Set the radius of contact patch surface.
/// \param[in] _radius Patch radius
public: void SetPatchRadius(double _radius);

/// \brief Get the surface radius on the contact point
/// \return Surface radius
public: double SurfaceRadius() const;

/// \brief Set the surface radius on the contact point.
/// \param[in] _radius Surface radius
public: void SetSurfaceRadius(double _radius);

/// \brief Get the ODE force dependent slip for torsional friction
/// \return Force dependent slip for torsional friction.
public: double ODESlip() const;

/// \brief Set the ODE force dependent slip for torsional friction
/// \param[in] _slip Force dependent slip for torsional friction.
public: void SetODESlip(double _slip);

/// \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
/// not been called.
public: sdf::ElementPtr Element() const;

/// \brief Private data pointer.
GZ_UTILS_IMPL_PTR(dataPtr)
};

/// \brief Friction information for a surface.
class SDFORMAT_VISIBLE Friction
{
Expand All @@ -145,6 +272,24 @@ namespace sdf
/// \param[in] _ode The ODE object.
public: void SetODE(const sdf::ODE &_ode);

/// \brief Get the associated BulletFriction object
/// \return Pointer to the associated BulletFriction object,
/// nullptr if the Surface doesn't contain a BulletFriction element.
public: const sdf::BulletFriction *BulletFriction() const;

/// \brief Set the associated BulletFriction object.
/// \param[in] _bullet The BulletFriction object.
public: void SetBulletFriction(const sdf::BulletFriction &_bullet);

/// \brief Get the torsional friction
/// \return Pointer to the torsional friction
/// nullptr if the Surface doesn't contain a torsional friction element.
public: const sdf::Torsional *Torsional() const;

/// \brief Set the torsional friction
/// \param[in] _torsional The torsional friction.
public: void SetTorsional(const sdf::Torsional &_torsional);

/// \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
14 changes: 14 additions & 0 deletions include/sdf/World.hh
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,20 @@ namespace sdf
/// \return True if there exists an actor with the given name.
public: bool ActorNameExists(const std::string &_name) const;

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

/// \brief Get a mutable actor based on a name.
/// \param[in] _name Name of the actor.
/// \return Pointer to the actor. Nullptr if an actor with the given name
/// does not exist.
/// \sa bool ActorNameExists(const std::string &_name) const
public: Actor *ActorByName(const std::string &_name);

/// \brief Get the number of explicit frames that are immediate (not nested)
/// children of this World object.
/// \remark FrameByName() can find explicit frames that are not immediate
Expand Down
6 changes: 6 additions & 0 deletions python/src/sdf/_gz_sdformat_pybind11.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ PYBIND11_MODULE(BINDINGS_MODULE_NAME, m) {
sdf::python::defineAltimeter(m);
sdf::python::defineAtmosphere(m);
sdf::python::defineBox(m);
sdf::python::defineBulletFriction(m);
sdf::python::defineCamera(m);
sdf::python::defineCapsule(m);
sdf::python::defineCollision(m);
Expand Down Expand Up @@ -123,6 +124,7 @@ PYBIND11_MODULE(BINDINGS_MODULE_NAME, m) {
sdf::python::defineSky(m);
sdf::python::defineSphere(m);
sdf::python::defineSurface(m);
sdf::python::defineTorsional(m);
sdf::python::defineVisual(m);
sdf::python::defineWorld(m);

Expand All @@ -141,7 +143,11 @@ PYBIND11_MODULE(BINDINGS_MODULE_NAME, m) {
sdfErrorsException.attr("errors") = pybind11::cast(e.Errors());
// This has to be called last since it's the call that sets
// PyErr_SetString.
#if PYBIND11_VERSION_HEX >= 0x020C0000
pybind11::set_error(sdfErrorsException, e.what());
#else
sdfErrorsException(e.what());
#endif
}
});

Expand Down
7 changes: 7 additions & 0 deletions python/src/sdf/pyLink.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ void defineLink(pybind11::object module)
.def("set_enable_wind",
&sdf::Link::SetEnableWind,
"Set whether this link should be subject to wind.")
.def("enable_gravity",
&sdf::Link::EnableGravity,
"Check if this link should be subject to gravity. "
"If true, this link should be affected by gravity.")
.def("set_enable_gravity",
&sdf::Link::SetEnableGravity,
"Set whether this link should be subject to gravity.")
.def("add_collision",
&sdf::Link::AddCollision,
"Add a collision to the link.")
Expand Down
Loading

0 comments on commit 548d4fe

Please sign in to comment.