Skip to content

Commit

Permalink
Merge pull request #1457 from gazebosim/scpeters/merge_14_main
Browse files Browse the repository at this point in the history
Merge sdf14 ➡️  main
  • Loading branch information
scpeters authored Jul 10, 2024
2 parents 1779253 + b0f0205 commit 133b430
Show file tree
Hide file tree
Showing 55 changed files with 2,518 additions and 144 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
push:
branches:
- 'sdf[0-9]?'
- 'sdf[1-9]?[0-9]'
- 'main'

jobs:
Expand Down
100 changes: 100 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,47 @@

## libsdformat 14.X

### libsdformat 14.4.0 (2024-06-20)

1. Add Cone as a primitive parametric shape.
* [Pull request #1415](https://github.com/gazebosim/sdformat/pull/1415)
* Thanks to Benjamin Perseghetti

1. Add custom attribute to custom element in test
* [Pull request #1406](https://github.com/gazebosim/sdformat/pull/1406)

### 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 @@ -132,6 +173,50 @@

## libsdformat 13.X

### libsdformat 13.8.0 (2024-06-25)

1. Added `World::ActorByName`
* [Pull request #1436](https://github.com/gazebosim/sdformat/pull/1436)

1. Backport #1367 to Garden: Fix find Python3 logic.
* [Pull request #1370](https://github.com/gazebosim/sdformat/pull/1370)

### 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 @@ -594,6 +679,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 @@ -69,6 +69,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 this link is kinematic only
/// \return true if the link is kinematic only, false otherwise.
public: bool Kinematic() const;
Expand Down
94 changes: 94 additions & 0 deletions include/sdf/SDFImpl.hh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,34 @@ namespace sdf
bool _searchLocalPath = true,
bool _useCallback = false);

/// \brief Find the absolute path of a file.
///
/// The search order in the function is as follows:
/// 1. Using the global URI path map, search in paths associated with the URI
/// scheme of the input.
/// 2. Seach in the path defined by the macro `SDF_SHARE_PATH`.
/// 3. Search in the the libsdformat install path. The path is formed by
/// has the pattern `SDF_SHARE_PATH/sdformat<major version>/<version>/`
/// 4. Directly check if the input path exists in the filesystem.
/// 5. Seach in the path defined by the environment variable `SDF_PATH`.
/// 6. If enabled via _searchLocalPath, prepend the input with the current
/// working directory and check if the result path exists.
/// 7. If enabled via _useCallback and the global callback function is set,
/// invoke the function and return its result.
///
/// \param[out] _errors Vector of errors.
/// \param[in] _filename Name of the file to find.
/// \param[in] _searchLocalPath True to search for the file in the current
/// working directory.
/// \param[in] _useCallback True to find a file based on a registered
/// callback if the file is not found via the normal mechanism.
/// \return File's full path.
SDFORMAT_VISIBLE
std::string findFile(sdf::Errors &_errors,
const std::string &_filename,
bool _searchLocalPath = true,
bool _useCallback = false);

/// \brief Find the absolute path of a file.
///
/// This overload uses the URI path map and and the callback function
Expand All @@ -99,6 +127,26 @@ namespace sdf
bool _useCallback,
const ParserConfig &_config);

/// \brief Find the absolute path of a file.
///
/// This overload uses the URI path map and and the callback function
/// configured in the input ParserConfig object instead of their global
/// counterparts.
///
/// \param[out] _errors Vector of errors.
/// \param[in] _filename Name of the file to find.
/// \param[in] _searchLocalPath True to search for the file in the current
/// working directory.
/// \param[in] _useCallback True to find a file based on a registered
/// callback if the file is not found via the normal mechanism.
/// \param[in] _config Custom parser configuration.
/// \return File's full path.
SDFORMAT_VISIBLE
std::string findFile(sdf::Errors &_errors,
const std::string &_filename,
bool _searchLocalPath,
bool _useCallback,
const ParserConfig &_config);

/// \brief Associate paths to a URI.
/// Example paramters: "model://", "/usr/share/models:~/.gazebo/models"
Expand All @@ -121,22 +169,45 @@ namespace sdf
/// \brief Destructor
public: ~SDF();
public: void PrintDescription();
public: void PrintDescription(sdf::Errors &_errors);
public: void PrintDoc();
public: void Write(const std::string &_filename);
public: void Write(sdf::Errors &_errors, const std::string &_filename);

/// \brief Output SDF's values to stdout.
/// \param[in] _config Configuration for printing the values.
public: void PrintValues(const PrintConfig &_config = PrintConfig());

/// \brief Output SDF's values to stdout.
/// \param[out] _errors Vector of errrors.
/// \param[in] _config Configuration for printing the values.
public: void PrintValues(sdf::Errors &_errors,
const PrintConfig &_config = PrintConfig());

/// \brief Convert the SDF values to a string representation.
/// \param[in] _config Configuration for printing the values.
/// \return The string representation.
public: std::string ToString(
const PrintConfig &_config = PrintConfig()) const;

/// \brief Convert the SDF values to a string representation.
/// \param[out] _errors Vector of errors.
/// \param[in] _config Configuration for printing the values.
/// \return The string representation.
public: std::string ToString(
sdf::Errors &_errors,
const PrintConfig &_config = PrintConfig()) const;

/// \brief Set SDF values from a string
/// \param[in] sdfData String with the values to load.
public: void SetFromString(const std::string &_sdfData);

/// \brief Set SDF values from a string
/// \param[out] _errors Vector of errors.
/// \param[in] sdfData String with the values to load.
public: void SetFromString(sdf::Errors &_Errors,
const std::string &_sdfData);

/// \brief Clear the data in this object.
public: void Clear();

Expand Down Expand Up @@ -177,6 +248,13 @@ namespace sdf
/// \return a wrapped clone of the SDF element
public: static ElementPtr WrapInRoot(const ElementPtr &_sdf);

/// \brief wraps the SDF element into a root element with the version info.
/// \param[out] _errors Vector of errors.
/// \param[in] _sdf the sdf element. Will be cloned by this function.
/// \return a wrapped clone of the SDF element
public: static ElementPtr WrapInRoot(sdf::Errors &_errors,
const ElementPtr &_sdf);

/// \brief Get a string representation of an SDF specification file.
/// This function uses a built-in version of a .sdf file located in
/// the sdf directory. The parser.cc code uses this function, which avoids
Expand All @@ -193,6 +271,22 @@ namespace sdf
public: static const std::string &EmbeddedSpec(
const std::string &_filename, const bool _quiet);

/// \brief Get a string representation of an SDF specification file.
/// This function uses a built-in version of a .sdf file located in
/// the sdf directory. The parser.cc code uses this function, which avoids
/// touching the filesystem.
///
/// Most people should not use this function.
///
/// \param[out] _errors Vector of errors.
/// \param[in] _filename Base name of the SDF specification file to
/// load. For example "root.sdf" or "world.sdf".
/// \return A string that contains the contents of the specified
/// _filename. An empty string is returned if the _filename could not be
/// found.
public: static const std::string &EmbeddedSpec(
sdf::Errors &_errors, const std::string &_filename);

/// \internal
/// \brief Pointer to private data.
private: std::unique_ptr<SDFPrivate> dataPtr;
Expand Down
Loading

0 comments on commit 133b430

Please sign in to comment.