Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dartsim: Add support for joints in worlds #501

Merged
merged 6 commits into from
May 19, 2023
Merged

Conversation

azeey
Copy link
Contributor

@azeey azeey commented Mar 30, 2023

🎉 New feature

Closes #457

Summary

As of gazebosim/sdformat#1117, SDFormat supports joints under world (//world/joint in xpath). But in gz-physics, Entities such as joints are only available in a Model. To support world joints, instead of creating a new type of entity, we have chosen to implement a scheme where the world behaves like a model via the WorldModelFeature feature. Given a world, w, we can do model = w->GetWorldModel() to get the model proxy. We can then use any of the APIs supported by the features available in the physics engine, e.g., model->GetJoint("j1") where "j1" is a joint directly under <world> in the SDFormat.

Some refactoring of Base.hh has already been split out into #500, so that should be merged first.

Test it

Tests have been added to tests test/common_test/joint_features.cc and test/common_test/world_features.cc

Checklist

  • Signed all commits for DCO
  • 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)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

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

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@github-actions github-actions bot added 🌱 garden Ignition Garden 🎵 harmonic Gazebo Harmonic labels Mar 30, 2023
@azeey azeey requested a review from marcoag March 30, 2023 22:59
@azeey azeey changed the title Add support for joints in worlds dartsim: Add support for joints in worlds Mar 30, 2023
@codecov
Copy link

codecov bot commented Mar 30, 2023

Codecov Report

Merging #501 (0926e48) into gz-physics6 (63a7486) will increase coverage by 0.44%.
The diff coverage is 77.61%.

❗ Current head 0926e48 differs from pull request most recent head 6b70010. Consider uploading reports for the commit 6b70010 to get more accurate results

@@               Coverage Diff               @@
##           gz-physics6     #501      +/-   ##
===============================================
+ Coverage        75.71%   76.16%   +0.44%     
===============================================
  Files              142      142              
  Lines             7199     7251      +52     
===============================================
+ Hits              5451     5523      +72     
+ Misses            1748     1728      -20     
Impacted Files Coverage Δ
dartsim/src/SDFFeatures.cc 64.71% <60.34%> (+2.05%) ⬆️
dartsim/src/Base.hh 95.85% <89.74%> (+0.85%) ⬆️
dartsim/src/EntityManagementFeatures.cc 86.52% <90.90%> (+3.45%) ⬆️
include/gz/physics/detail/GetEntities.hh 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey azeey self-assigned this Apr 12, 2023
dartsim/src/SDFFeatures.cc Outdated Show resolved Hide resolved
test/common_test/world_features.cc Show resolved Hide resolved
test/common_test/world_features.cc Show resolved Hide resolved
test/common_test/world_features.cc Show resolved Hide resolved
@marcoag marcoag self-requested a review May 4, 2023 05:37
azeey added 3 commits May 9, 2023 17:32
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey azeey merged commit c80d4d7 into gz-physics6 May 19, 2023
@azeey azeey deleted the azeey/world_joint branch May 19, 2023 00:39
traversaro pushed a commit to traversaro/ign-physics that referenced this pull request Jun 8, 2023
As of gazebosim/sdformat#1117, SDFormat supports joints under world (//world/joint in xpath). But in gz-physics, Entities such as joints are only available in a Model. To support world joints, instead of creating a new type of entity, we have chosen to implement a scheme where the world behaves like a model via the WorldModelFeature feature. Given a world, `w`, we can do `model = w->GetWorldModel()` to get the model proxy. We can then use any of the APIs supported by the features available in the physics engine, e.g., `model->GetJoint("j1")` where "j1" is a joint directly under <world> in the SDFormat.

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Co-authored-by: Marco A. Gutierrez <marcogg@marcogg.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden 🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Should support world joints
2 participants