-
-
Notifications
You must be signed in to change notification settings - Fork 315
Crash when removing multibody #847
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
base: master
Are you sure you want to change the base?
Crash when removing multibody #847
Conversation
This currently crashes when removing last multibody joint, it seems that a link in MultibodyJointSet::multibodies should be removed
| use parry::math::Vector; | ||
|
|
||
| #[test] | ||
| fn multibody_joint_remove_and_step() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost same content as multibody::test_multibody_remove but adds a simulation step between each removal
…all joints (previously was keeping 1
| if let Some(link) = multibody_joints.rigid_body_link(*handle).copied() { | ||
| if multibody_joints | ||
| .get_multibody_mut_internal(link.multibody) | ||
| .is_none() | ||
| { | ||
| panic!("multibody_joints should be able to get all links returned from rigid_body_link."); | ||
| } | ||
| panic!("This test has only 1 link, it should lead to rigid_body_link returning `None` immediately after first removal."); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is added to catch at the earliest the original error of:
thread 'dynamics::joint::multibody_joint::test::multibody_joint_remove_and_step' panicked at crates/rapier2d/../../src/dynamics/solver/velocity_solver.rs:101:22:
called `Option::unwrap()` on a `None` value
cargo run --bin all_examples3-> hitting a few timesA(remove any 10% multibodies) with 2 scenari:MultibodyJointSetremove recursively therb2mbwhen it detects a removal leading to empty link?