Skip to content

Commit

Permalink
Merge pull request gazebosim#1337 from gazebosim/azeey/14_to_main
Browse files Browse the repository at this point in the history
Merge sdf14 ➡️  main
  • Loading branch information
azeey authored Oct 10, 2023
2 parents 92dd776 + 11205c9 commit 297e5a2
Show file tree
Hide file tree
Showing 73 changed files with 3,332 additions and 323 deletions.
1 change: 0 additions & 1 deletion .github/ci/packages.apt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ python3-gz-math7
python3-psutil
python3-pybind11
python3-pytest
ruby-dev
15 changes: 3 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,16 @@ name: Ubuntu
on: [push, pull_request]

jobs:
focal-ci:
jammy-ci:
runs-on: ubuntu-latest
name: Ubuntu Focal CI
name: Ubuntu Jammy CI
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Compile and test
id: ci
uses: gazebo-tooling/action-gz-ci@focal
uses: gazebo-tooling/action-gz-ci@jammy
with:
codecov-enabled: true
cppcheck-enabled: true
cpplint-enabled: true
jammy-ci:
runs-on: ubuntu-latest
name: Ubuntu Jammy CI
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Compile and test
id: ci
uses: gazebo-tooling/action-gz-ci@jammy
12 changes: 1 addition & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,6 @@ if (BUILD_SDF)
gz_build_warning("Python psutil package not found. Memory leak tests will be skipped")
endif()

################################################
# Find ruby executable to produce xml schemas
find_program(RUBY ruby)
if (NOT RUBY)
gz_build_error ("Ruby version 1.9 is needed to build xml schemas")
else()
message(STATUS "Found ruby executable: ${RUBY}")
endif()

########################################
# Find gz math
# Set a variable for generating ProjectConfig.cmake
Expand All @@ -133,8 +124,7 @@ if (BUILD_SDF)
########################################
# Python interfaces
if (NOT PYTHON3_FOUND)
GZ_BUILD_WARNING("Python is missing: Python interfaces are disabled.")
message (STATUS "Searching for Python - not found.")
GZ_BUILD_ERROR("Python is missing - Needed to build/embed xml schemas")
else()
message (STATUS "Searching for Python - found version ${Python3_VERSION}.")

Expand Down
91 changes: 90 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,98 @@
## libsdformat 14.X

### libsdformat 14.0.0 (202X-XX-XX)
### libsdformat 14.0.0 (2023-09-29)

1. Add missing conda dependencies
* [Pull request #1324](https://github.com/gazebosim/sdformat/pull/1324)

1. Correct spelling of Python variable in CMake
* [Pull request #1319](https://github.com/gazebosim/sdformat/pull/1319)

1. Remove hard dependence on ruby
* [Pull request #1323](https://github.com/gazebosim/sdformat/pull/1323)

1. Documentation fixes
* [Pull request #1322](https://github.com/gazebosim/sdformat/pull/1322)

1. Automatic Moment of Inertia Calculations for Basic Shapes
* [Pull request #1299](https://github.com/gazebosim/sdformat/pull/1299)
* [Pull request #1304](https://github.com/gazebosim/sdformat/pull/1304)
* [Pull request #1317](https://github.com/gazebosim/sdformat/pull/1317)
* [Pull request #1325](https://github.com/gazebosim/sdformat/pull/1325)

1. Joint axis mimic constraints: add `sdf` element
* [Pull request #1166](https://github.com/gazebosim/sdformat/pull/1166)

1. Add python bindings for `sdf::Element` and `sdf::Param`
* [Pull request #1303](https://github.com/gazebosim/sdformat/pull/1303)

1. World: handle name collisions like Model
* [Pull request #1311](https://github.com/gazebosim/sdformat/pull/1311)

1. ign -> gz
* [Pull request #1301](https://github.com/gazebosim/sdformat/pull/1301)

1. Copy 1.10 spec to 1.11 for sdformat14
* [Pull request #1298](https://github.com/gazebosim/sdformat/pull/1298)

1. Make sure the deprecated kSdfScopeDelimiter still works
* [Pull request #1305](https://github.com/gazebosim/sdformat/pull/1305)

1. Python script to replace ruby xmlschema generator
* [Pull request #1232](https://github.com/gazebosim/sdformat/pull/1232)

1. Make dataPtr private in sdf::Plugin
* [Pull request #1268](https://github.com/gazebosim/sdformat/pull/1268)

1. Fix GSG violations on non-trivially destructible types
* [Pull request #1264](https://github.com/gazebosim/sdformat/pull/1264)

1. Port embedSdf script from Ruby to Python3 and provide unittests
* [Pull request #884](https://github.com/gazebosim/sdformat/pull/884)
* [Pull request #1297](https://github.com/gazebosim/sdformat/pull/1297)

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

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

1. ⬆️ Bump main to 14.0.0~pre1
* [Pull request #1104](https://github.com/gazebosim/sdformat/pull/1104)

## libsdformat 13.X

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

1. Use relative path in an urdf include to avoid confusion between internal and system headers
* [Pull request #1259](https://github.com/gazebosim/sdformat/pull/1259)

1. parser.cc update calls to use sdf::Errors output
* [Pull request #1294](https://github.com/gazebosim/sdformat/pull/1294)

1. Fix deeply nested merge-include for custom parsed files
* [Pull request #1293](https://github.com/gazebosim/sdformat/pull/1293)

1. Updated findfile() to search localpath first
* [Pull request #1292](https://github.com/gazebosim/sdformat/pull/1292)

1. World requires a scene and atmosphere
* [Pull request #1308](https://github.com/gazebosim/sdformat/pull/1308)

1. Infrastructure
* [Pull request #1307](https://github.com/gazebosim/sdformat/pull/1307)
* [Pull request #1306](https://github.com/gazebosim/sdformat/pull/1306)

1. Remove robot not found error when parsing fails
* [Pull request #1290](https://github.com/gazebosim/sdformat/pull/1290)

1. Make some sdfdbg messages sdfmsgs
* [Pull request #1288](https://github.com/gazebosim/sdformat/pull/1288)

1. Minor clean up of tests
* [Pull request #1289](https://github.com/gazebosim/sdformat/pull/1289)

### libsdformat 13.5.0 (2023-05-18)

1. Added projector Python wrapper
Expand Down
27 changes: 24 additions & 3 deletions Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,17 @@ but with improved human-readability..
### Modifications

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
is 1.6 or earlier. Name collisions in newer files will cause `DUPLICATE_NAME`
errors, which now matches the behavior of the Model class.

1. Python is now required to build libsdformat instead of Ruby.

1. **sdf/ParserConfig.hh** The following new functions were added to support automatic calculation of moments of inertia.
+ ConfigureResolveAutoInertials CalculateInertialConfiguration() const
+ void SetCalculateInertialConfiguration(ConfigureResolveAutoInertials)
+ void RegisterCustomInertiaCalc(CustomInertiaCalculator)
+ const CustomInertiaCalculator &CustomInertiaCalc() const

## libsdformat 12.x to 13.x

### Additions
Expand All @@ -38,7 +46,7 @@ but with improved human-readability..

1. ParserConfig defaults to WARN instead of LOG when parsing unrecognized
elements.
2. Updated search order for `sdf::findFile()` making local path (current directory) the first to be searched.
2. Updated search order for `sdf::findFile()` making local path (current directory) the first to be searched.

### Deprecations

Expand Down Expand Up @@ -584,7 +592,20 @@ ABI was broken for `sdf::Element`, and restored on version 11.2.1.
+ `//mimic/offset`: parameter representing offset to follower position.
+ `//mimic/reference`: parameter representing reference for leader position before applying the multiplier.

1. **joint.sdf**:
1. **inertial.sdf**: A new attribute `//inertial/@auto` has been added
to specify whether the moment of inertia of a link should be calculated
automatically. In addition, the following elements have been added:
+ `//inertial/density`: Common mass density of all collision geometries.
+ `//inertial/auto_inertia_params`: Container for custom parameters passed
to the moment of inertia calculator.

1. **collision.sdf**: A new element `//collision/density` has been added
to specify the density of a material for automatic calculation of the moment
of inertia of the parent link. This parameter overrides the value in
`//inertial/density` of the parent link if specified. In addition,
`//collision/auto_inertia_params` can be used to override
`//inertial/auto_inertia_params` of the parent link.

## SDFormat specification 1.9 to 1.10

### Additions
Expand Down
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,22 @@ is recommended for most users.

## UNIX

#### Build from Source
### Prerequisites

Clone the repository
```sh
git clone https://github.com/gazebosim/sdformat -b sdf<#>
```
Be sure to replace `<#>` with a number value, such as 1 or 2, depending on
which version you need.

### Build from Source

Standard installation can be performed in UNIX systems using the following
steps:

```sh
cd sdformat
mkdir build
cd build
cmake .. # Consider specifying -DCMAKE_INSTALL_PREFIX=...
Expand Down Expand Up @@ -203,7 +213,7 @@ conda activate gz-ws

Install prerequisites:
```
conda install urdfdom --channel conda-forge
conda install tinyxml2 urdfdom --channel conda-forge
```

Install Gazebo dependencies:
Expand All @@ -215,7 +225,7 @@ conda search libsdformat --channel conda-forge --info

Install dependencies, replacing `<#>` with the desired versions:
```
conda install libgz-math<#> libgz-tools<#> --channel conda-forge
conda install libgz-cmake<#> libgz-math<#> libgz-tools<#> libgz-utils<#> --channel conda-forge
```

### Build from Source
Expand Down
11 changes: 11 additions & 0 deletions include/sdf/Box.hh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
#ifndef SDF_BOX_HH_
#define SDF_BOX_HH_

#include <optional>

#include <gz/math/Box.hh>
#include <gz/math/Vector3.hh>
#include <gz/math/Inertial.hh>
#include <gz/utils/ImplPtr.hh>
#include <sdf/Error.hh>
#include <sdf/Element.hh>
Expand Down Expand Up @@ -65,6 +68,14 @@ namespace sdf
/// \return A reference to a gz::math::Boxd object.
public: gz::math::Boxd &Shape();

/// \brief Calculate and return the Inertial values for the Box. In order
/// to calculate the inertial properties, the function mutates the object
/// by updating its material properties.
/// \param[in] _density Density of the box in kg/m^3
/// \return A std::optional with gz::math::Inertiald object or std::nullopt
public: std::optional<gz::math::Inertiald>
CalculateInertial(double _density);

/// \brief Create and return an SDF element filled with data from this
/// box.
/// Note that parameter passing functionality is not captured with this
Expand Down
11 changes: 11 additions & 0 deletions include/sdf/Capsule.hh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
#ifndef SDF_CAPSULE_HH_
#define SDF_CAPSULE_HH_

#include <optional>

#include <gz/math/Capsule.hh>
#include <gz/math/Inertial.hh>
#include <gz/utils/ImplPtr.hh>
#include <sdf/Error.hh>
#include <sdf/Element.hh>
Expand Down Expand Up @@ -72,6 +75,14 @@ namespace sdf
/// \return A reference to a gz::math::Capsuled object.
public: gz::math::Capsuled &Shape();

/// \brief Calculate and return the Inertial values for the Capsule.
/// In order to calculate the inertial properties, the function
/// mutates the object by updating its material properties.
/// \param[in] _density Density of the capsule in kg/m^3
/// \return A std::optional with gz::math::Inertiald object or std::nullopt
public: std::optional<gz::math::Inertiald> CalculateInertial(
double _density);

/// \brief Create and return an SDF element filled with data from this
/// capsule.
/// Note that parameter passing functionality is not captured with this
Expand Down
33 changes: 33 additions & 0 deletions include/sdf/Collision.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@
#include <memory>
#include <string>
#include <gz/math/Pose3.hh>
#include <gz/math/Vector3.hh>
#include <gz/math/Inertial.hh>
#include <gz/utils/ImplPtr.hh>
#include "sdf/Element.hh"
#include "sdf/SemanticPose.hh"
#include "sdf/Types.hh"
#include "sdf/sdf_config.h"
#include "sdf/system_util.hh"
#include "sdf/ParserConfig.hh"

namespace sdf
{
Expand Down Expand Up @@ -75,6 +78,26 @@ namespace sdf
/// \param[in] _name Name of the collision.
public: void SetName(const std::string &_name);

/// \brief Get the density of the collision.
/// \return Density of the collision.
public: double Density() const;

/// \brief Set the density of the collision.
/// \param[in] _density Density of the collision.
public: void SetDensity(double _density);

/// \brief Get the ElementPtr to the <auto_inertia_params> element
/// This element can be used as a parent element to hold user-defined
/// params for the custom moment of inertia calculator.
/// \return ElementPtr object for the <auto_inertia_params> element.
public: sdf::ElementPtr AutoInertiaParams() const;

/// \brief Function to set the auto inertia params using a
/// sdf ElementPtr object
/// \param[in] _autoInertiaParams ElementPtr to <auto_inertia_params>
/// element
public: void SetAutoInertiaParams(const sdf::ElementPtr _autoInertiaParams);

/// \brief Get a pointer to the collisions's geometry.
/// \return The collision's geometry.
public: const Geometry *Geom() const;
Expand Down Expand Up @@ -119,6 +142,16 @@ namespace sdf
/// \return SemanticPose object for this link.
public: sdf::SemanticPose SemanticPose() const;

/// \brief Calculate and return the MassMatrix for the collision
/// \param[out] _errors A vector of Errors objects. Each errors contains an
/// Error code and a message. An empty errors vector indicates no errors
/// \param[in] _config Custom parser configuration
/// \param[out] _inertial An inertial object which will be set with the
/// calculated inertial values
public: void CalculateInertial(sdf::Errors &_errors,
gz::math::Inertiald &_inertial,
const ParserConfig &_config);

/// \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
Loading

0 comments on commit 297e5a2

Please sign in to comment.