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

DetachableJoint plugin: Reattached model when world is resetted #2131

Closed
wants to merge 1 commit into from

Conversation

ahcorde
Copy link
Contributor

@ahcorde ahcorde commented Sep 8, 2023

🦟 Bug fix

Fixes gazebosim/gazebo_test_cases#238

Summary

When a world with detachable joint is resetted the joint disappears, this should fix the issue

Checklist

  • Signed all commits for DCO
  • Added tests
  • 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.

@ahcorde ahcorde self-assigned this Sep 8, 2023
@ahcorde ahcorde requested a review from mjcarroll as a code owner September 8, 2023 14:13
@github-actions github-actions bot added the 🎵 harmonic Gazebo Harmonic label Sep 8, 2023
@codecov
Copy link

codecov bot commented Sep 8, 2023

Codecov Report

Merging #2131 (5c913d4) into gz-sim8 (923ccee) will increase coverage by 0.01%.
Report is 2 commits behind head on gz-sim8.
The diff coverage is 0.00%.

❗ Current head 5c913d4 differs from pull request most recent head 0769847. Consider uploading reports for the commit 0769847 to get more accurate results

@@             Coverage Diff             @@
##           gz-sim8    #2131      +/-   ##
===========================================
+ Coverage    65.45%   65.46%   +0.01%     
===========================================
  Files          323      323              
  Lines        30704    30708       +4     
===========================================
+ Hits         20097    20103       +6     
+ Misses       10607    10605       -2     
Files Changed Coverage Δ
src/systems/detachable_joint/DetachableJoint.cc 64.58% <0.00%> (-1.85%) ⬇️
src/systems/detachable_joint/DetachableJoint.hh 100.00% <ø> (ø)

... and 1 file with indirect coverage changes

📢 Have feedback on the report? Share it here.

@Voldivh
Copy link
Contributor

Voldivh commented Sep 8, 2023

I tried out the PR but I'm still getting that the detachable joints are disappearing when I press reset and creates new entities. This is the output I get when I click reset:

[Dbg] [SimulationRunner.cc:319] Rewinding simulation back to initial time.
[Dbg] [Physics.cc:925] Resetting Physics
[Dbg] [Physics.cc:2019] Detaching joint [45]
[Dbg] [Physics.cc:2019] Detaching joint [46]
[Dbg] [Physics.cc:2019] Detaching joint [47]
[Msg] Create service on [/world/detachable_joint/create]
[Msg] Remove service on [/world/detachable_joint/remove]
[Msg] Pose service on [/world/detachable_joint/set_pose]
[Msg] Pose service on [/world/detachable_joint/set_pose_vector]
[Msg] Light configuration service on [/world/detachable_joint/light_config]
[Msg] Physics service on [/world/detachable_joint/set_physics]
[Msg] SphericalCoordinates service on [/world/detachable_joint/set_spherical_coordinates]
[Msg] Enable collision service on [/world/detachable_joint/enable_collision]
[Msg] Disable collision service on [/world/detachable_joint/disable_collision]
[Msg] Material service on [/world/detachable_joint/visual_config]
[Msg] Material service on [/world/detachable_joint/wheel_slip]
[Dbg] [SystemManager.cc:74] Loaded system [gz::sim::systems::UserCommands] for entity [1]
[Msg] DiffDrive subscribing to twist messages on [/model/vehicle_blue/cmd_vel]
[Dbg] [SystemManager.cc:74] Loaded system [gz::sim::systems::DiffDrive] for entity [8]
[Dbg] [DetachableJoint.cc:268] Attaching entity: 48
[Dbg] [DetachableJoint.cc:268] Attaching entity: 49
[Dbg] [DetachableJoint.cc:268] Attaching entity: 50
[Dbg] [Physics.cc:1864] Creating detachable joint [48]
Msg [NameManager::issueNewName] (Skeleton::Joint | vehicle_blue) The name [fixed] is a duplicate, so it has been renamed to [fixed(1)]
[Dbg] [Physics.cc:1864] Creating detachable joint [49]
Msg [NameManager::issueNewName] (Skeleton::Joint | vehicle_blue) The name [fixed] is a duplicate, so it has been renamed to [fixed(2)]
[Dbg] [Physics.cc:1864] Creating detachable joint [50]
[GUI] [Wrn] [Model.hh:98] Unable to deserialize sdf::Model
[GUI] [Wrn] [Model.hh:98] Unable to deserialize sdf::Model
[GUI] [Wrn] [Model.hh:98] Unable to deserialize sdf::Model
[GUI] [Wrn] [Model.hh:98] Unable to deserialize sdf::Model

I'm not sure if this is the expected behavior.

@ahcorde
Copy link
Contributor Author

ahcorde commented Sep 8, 2023

yes, the Physics engine will remove the joint and the plugin will create a new one.

@scpeters or @azeey is this correct ?

@azeey azeey self-requested a review September 11, 2023 19:10
@azeey azeey added the beta Targeting beta release of upcoming collection label Sep 18, 2023
@azeey
Copy link
Contributor

azeey commented Sep 19, 2023

I'm not able to reproduce the problem locally. Reset seems to work as expected on detachable_joint.sdf.

Screen.recording.2023-09-19.15.43.16.webm

@azeey
Copy link
Contributor

azeey commented Sep 27, 2023

Removing beta from this since I can't reproduce this. I also haven't had a chance to review it.

@azeey azeey removed the beta Targeting beta release of upcoming collection label Sep 27, 2023
@azeey
Copy link
Contributor

azeey commented Mar 18, 2024

@ahcorde can you try this one more time?

@ahcorde ahcorde closed this Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

gz-sim: detachable_joint.sdf
3 participants