Skip to content

Commit

Permalink
Merge branch 'sdf14' into scpeters/custom_attribute_in_custom_element
Browse files Browse the repository at this point in the history
  • Loading branch information
scpeters authored Jun 18, 2024
2 parents cb28c5a + 37ca7fc commit a9024fa
Show file tree
Hide file tree
Showing 49 changed files with 2,205 additions and 116 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 (sdformat14 VERSION 14.2.0)
project (sdformat14 VERSION 14.3.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
83 changes: 83 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
## libsdformat 14.X

### libsdformat 14.3.0 (2024-06-14)

1. Backport voxel_resolution sdf element
* [Pull request #1429](https://github.com/gazebosim/sdformat/pull/1429)

1. Added Automatic Moment of Inertia Calculations for Basic Shapes Python wrappers
* [Pull request #1424](https://github.com/gazebosim/sdformat/pull/1424)

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. Update default camera instrinsics skew to 0, which matches spec
* [Pull request #1423](https://github.com/gazebosim/sdformat/pull/1423)
* [Pull request #1425](https://github.com/gazebosim/sdformat/pull/1425)

1. Allow empty strings in plugin and custom attributes
* [Pull request #1407](https://github.com/gazebosim/sdformat/pull/1407)

1. (Backport) Enable 24.04 CI, remove distutils dependency
* [Pull request #1413](https://github.com/gazebosim/sdformat/pull/1413)

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)

### libsdformat 14.2.0 (2024-04-23)

1. Fix trivial warning on 24.04 for JointAxis_TEST.cc
Expand Down Expand Up @@ -128,6 +160,42 @@

## 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 @@ -590,6 +658,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
3 changes: 3 additions & 0 deletions Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ but with improved human-readability..

### Modifications

1. The default camera lens intrinsics skew value in the Camera DOM class changed
from `1` to `0` to match the SDF specification.

1. World class only renames frames with name collisions if original file version
is 1.6 or earlier. Name collisions in newer files will cause `DUPLICATE_NAME`
errors, which now matches the behavior of the Model class.
Expand Down
10 changes: 10 additions & 0 deletions include/sdf/Link.hh
Original file line number Diff line number Diff line change
Expand Up @@ -408,12 +408,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 Check if the automatic calculation for the link inertial
/// is enabled or not.
/// \return True if automatic calculation is enabled. This can be done
Expand Down
12 changes: 12 additions & 0 deletions include/sdf/Mesh.hh
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,23 @@ namespace sdf
public: sdf::ElementPtr Element() const;

/// \brief Get the maximum number of convex hulls that can be generated.
/// \return Maximum number of convex hulls.
public: unsigned int MaxConvexHulls() const;

/// \brief Set the maximum number of convex hulls that can be generated.
/// \param[in] _maxConvexHulls Maximum number of convex hulls.
public: void SetMaxConvexHulls(unsigned int _maxConvexHulls);

/// Get the voxel resolution to use for representing the mesh. Applicable
/// only to voxel based convex decomposition methods.
/// \param[in] _voxelResolution Voxel resolution to use.
public: unsigned int VoxelResolution() const;

/// Set the voxel resolution to use for representing the mesh. Applicable
/// only to voxel based convex decomposition methods.
/// \param[in] _voxelResolution Voxel resolution to use.
public: void SetVoxelResolution(unsigned int _voxelResolution);

/// \brief Private data pointer.
GZ_UTILS_IMPL_PTR(dataPtr)
};
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
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package format="2">
<name>sdformat14</name>
<version>14.2.0</version>
<version>14.3.0</version>
<description>SDFormat is an XML file format that describes environments, objects, and robots
in a manner suitable for robotic applications</description>

Expand Down
2 changes: 2 additions & 0 deletions python/src/sdf/_gz_sdformat_pybind11.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,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 @@ -134,6 +135,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 Down
3 changes: 3 additions & 0 deletions python/src/sdf/pyBox.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "pyBox.hh"

#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include "sdf/Box.hh"

Expand All @@ -42,6 +43,8 @@ void defineBox(pybind11::object module)
pybind11::overload_cast<>(&sdf::Box::Shape, pybind11::const_),
pybind11::return_value_policy::reference,
"Get a mutable Gazebo Math representation of this Box.")
.def("calculate_inertial", &sdf::Box::CalculateInertial,
"Calculate and return the Inertial values for the Box.")
.def("__copy__", [](const sdf::Box &self) {
return sdf::Box(self);
})
Expand Down
3 changes: 3 additions & 0 deletions python/src/sdf/pyCapsule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "pyCapsule.hh"

#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include "sdf/Capsule.hh"

Expand All @@ -41,6 +42,8 @@ void defineCapsule(pybind11::object module)
"Get the capsule's length in meters.")
.def("set_length", &sdf::Capsule::SetLength,
"Set the capsule's length in meters.")
.def("calculate_inertial", &sdf::Capsule::CalculateInertial,
"Calculate and return the Inertial values for the Capsule.")
.def(
"shape",
pybind11::overload_cast<>(&sdf::Capsule::Shape, pybind11::const_),
Expand Down
Loading

0 comments on commit a9024fa

Please sign in to comment.