Skip to content

Extract EntityStorage to a shared location so it can be used by other physics engines#894

Merged
azeey merged 3 commits intogazebosim:mainfrom
azeey:entity_storage
Mar 10, 2026
Merged

Extract EntityStorage to a shared location so it can be used by other physics engines#894
azeey merged 3 commits intogazebosim:mainfrom
azeey:entity_storage

Conversation

@azeey
Copy link
Contributor

@azeey azeey commented Mar 10, 2026

Summary

Split out of #811

The EntityStorage class is useful for tracking mappings between gz-physics entities and the underlying physics engine. This PR moves it out of the dartsim component and puts it in the include/gz/physics/details directory so that it can be used by all physics engine plugins. I put it in details since it is meant to be used internally by the engine plugins.

This also fixes a couple of SDF warnings.

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.)

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.

Backports: If this is a backport, please use Rebase and Merge instead.

… physics engines

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
/// parent ID to a vector of object IDs. This is used to determine the index of
/// an entity within the container. However, if EntityStorage objects are
/// hierarchically stored in `*Info` structs, the indexInContainerToID will only
/// have one entry. See the Mujoco plugin implementation for reference.
Copy link
Member

Choose a reason for hiding this comment

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

nit: this comment references Mujoco though it hasn't been merged yet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

d049a67. I'll add it back with the mujoco implementation.

@github-project-automation github-project-automation bot moved this from Inbox to In review in Core development Mar 10, 2026
Addisu Z. Taddese added 2 commits March 9, 2026 23:20
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey azeey merged commit a9ea56c into gazebosim:main Mar 10, 2026
12 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in Core development Mar 10, 2026
@azeey azeey deleted the entity_storage branch March 10, 2026 15:57
@azeey
Copy link
Contributor Author

azeey commented Mar 10, 2026

@Mergifyio backport gz-physics7 gz-physics8 gz-physics9 ign-physics5

@mergify
Copy link

mergify bot commented Mar 10, 2026

backport gz-physics7 gz-physics8 gz-physics9 ign-physics5

✅ Backports have been created

Details

Cherry-pick of a9ea56c has failed:

On branch mergify/bp/gz-physics7/pr-894
Your branch is up to date with 'origin/gz-physics7'.

You are currently cherry-picking commit a9ea56c.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   include/gz/physics/detail/EntityStorage.hh
	modified:   test/common_test/simulation_features.cc

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   dartsim/src/Base.hh
	both modified:   dartsim/src/SDFFeatures_TEST.cc
	both modified:   test/common_test/worlds/test.world

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Cherry-pick of a9ea56c has failed:

On branch mergify/bp/gz-physics8/pr-894
Your branch is up to date with 'origin/gz-physics8'.

You are currently cherry-picking commit a9ea56c.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   dartsim/src/SDFFeatures_TEST.cc
	new file:   include/gz/physics/detail/EntityStorage.hh
	modified:   test/common_test/simulation_features.cc
	modified:   test/common_test/worlds/test.world

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   dartsim/src/Base.hh

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Cherry-pick of a9ea56c has failed:

On branch mergify/bp/gz-physics9/pr-894
Your branch is up to date with 'origin/gz-physics9'.

You are currently cherry-picking commit a9ea56c.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   dartsim/src/SDFFeatures_TEST.cc
	new file:   include/gz/physics/detail/EntityStorage.hh
	modified:   test/common_test/simulation_features.cc
	modified:   test/common_test/worlds/test.world

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   dartsim/src/Base.hh

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Cherry-pick of a9ea56c has failed:

On branch mergify/bp/ign-physics5/pr-894
Your branch is up to date with 'origin/ign-physics5'.

You are currently cherry-picking commit a9ea56c.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   include/gz/physics/detail/EntityStorage.hh

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   dartsim/src/Base.hh
	both modified:   dartsim/src/SDFFeatures_TEST.cc
	both modified:   dartsim/worlds/test.world
	deleted by us:   test/common_test/simulation_features.cc

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

mergify bot pushed a commit that referenced this pull request Mar 10, 2026
… physics engines (#894)

Signed-off-by: Addisu Z. Taddese <addisuzt@intrinsic.ai>
(cherry picked from commit a9ea56c)

# Conflicts:
#	dartsim/src/Base.hh
#	dartsim/src/SDFFeatures_TEST.cc
#	test/common_test/worlds/test.world
mergify bot pushed a commit that referenced this pull request Mar 10, 2026
… physics engines (#894)

Signed-off-by: Addisu Z. Taddese <addisuzt@intrinsic.ai>
(cherry picked from commit a9ea56c)

# Conflicts:
#	dartsim/src/Base.hh
mergify bot pushed a commit that referenced this pull request Mar 10, 2026
… physics engines (#894)

Signed-off-by: Addisu Z. Taddese <addisuzt@intrinsic.ai>
(cherry picked from commit a9ea56c)

# Conflicts:
#	dartsim/src/Base.hh
mergify bot pushed a commit that referenced this pull request Mar 10, 2026
… physics engines (#894)

Signed-off-by: Addisu Z. Taddese <addisuzt@intrinsic.ai>
(cherry picked from commit a9ea56c)

# Conflicts:
#	dartsim/src/Base.hh
#	dartsim/src/SDFFeatures_TEST.cc
#	dartsim/worlds/test.world
#	test/common_test/simulation_features.cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants