Skip to content

Take II: Add GetEngineVersionInfo to GetEngineInfo (feature backport #821)#882

Open
j-rivero wants to merge 2 commits intogz-physics9from
jrivero/pr-821-variant-api
Open

Take II: Add GetEngineVersionInfo to GetEngineInfo (feature backport #821)#882
j-rivero wants to merge 2 commits intogz-physics9from
jrivero/pr-821-variant-api

Conversation

@j-rivero
Copy link
Contributor

🎉 New feature

Rework of #857 to respect API

Summary

API Changes:

  1. Add GetEngineVersionInfo feature for engine version reporting
    • Adds new GetEngineVersionInfo feature as a separate, opt-in feature
    • Adds GetVersion() method to GetEngineVersionInfo::Engine API returning gz::math::SemanticVersion
    • Adds GetEngineVersion() pure virtual method to GetEngineVersionInfo::Implementation
    • Implements GetEngineVersionInfo in all physics engine plugins:
      • bullet and bullet-featherstone: parse BT_BULLET_VERSION macro to return SemanticVersion(3, 24)
      • dartsim: parse DART_VERSION macro string to SemanticVersion
      • tpe: return SemanticVersion(1, 0)

Leaves GetEngineInfo unchanged to avoid breaking 3rd-party plugins, difference from #857

Test

Testing with gazebosim/gz-sim#3213, adding:

diff --git a/src/systems/physics/Physics.cc b/src/systems/physics/Physics.cc
index 98f4aa2fe..5bf7b510f 100644
--- a/src/systems/physics/Physics.cc
+++ b/src/systems/physics/Physics.cc
@@ -180,7 +180,8 @@ class gz::sim::systems::PhysicsPrivate
           physics::sdf::ConstructSdfWorld,
           physics::GetLinkFromModel,
           physics::GetShapeFromLink,
-          physics::GetEngineInfo
+          physics::GetEngineInfo,
+          physics::GetEngineVersionInfo
           >{};
 
   /// \brief Engine type with just the minimum features.

Checklist

  • Signed all commits for DCO
  • Added a screen capture or video to the PR description that demonstrates the feature
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • Updated Bazel files (if adding new files). Created an issue otherwise.
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers
  • Was GenAI used to generate this PR? If so, make sure to add "Generated-by" to your commits. (See this policy for more info.)

Generated-by: Opus/Sonnet 4.6

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by and Generated-by messages.

j-rivero and others added 2 commits January 23, 2026 19:35
API Changes:

* Added GetVersion() method to GetEngineInfo::Engine class for retrieving engine version
* Added GetEngineVersion() pure virtual method to GetEngineInfo::Implementation interface
*  Updated all physics engine plugins to implement version reporting:
  - bullet and bullet-featherstone: Parse BT_BULLET_VERSION macro to return version string (e.g., "3.24")
  - dartsim: Use DART_VERSION macro to return version string (e.g., "6.13.0")
  - tpe: Return "1.0" as version
*  Updated dartsim's GetEngineName() to return "dartsim" only (previously returned "dartsim-" + DART_VERSION)

Generated-by: Claude Opus 4.5
---------
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
Co-authored-by: Steve Peters <scpeters@openrobotics.org>
(cherry picked from commit 710546a)
Signed-off-by: Jose Luis Rivero <jrivero@honurobotics.com>

/////////////////////////////////////////////////
/// \brief This feature retrieves the physics engine version.
class GZ_PHYSICS_VISIBLE GetEngineVersionInfo : public virtual Feature
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is now API-compatible, but we don't have GetEngineVersionInfo on main. Should we add something like class GZ_PHYSICS_VISIBLE GetEngineVersionInfo : public virtual GetEngineInfo on main?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the solution in main in #821 is a good one instead of this workaround. So anything for Kura can use the API change in #821 while back-ports will use this approach.

- bullet and bullet-featherstone: parse `BT_BULLET_VERSION` macro to return SemanticVersion(3, 24)
- dartsim: parse `DART_VERSION` macro string to SemanticVersion
- tpe: return SemanticVersion(1, 0)
* Leaves `GetEngineInfo` unchanged to avoid breaking 3rd-party plugins
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this meant for the 9.x migration guide?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly to help us to remind that this is an alternative to #821 that we don't need to forward port. Maybe including more explicit warnings can help here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🪵 jetty Gazebo Jetty

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

2 participants