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

Impulsive joint having issue with the T12 example when flipped #733

Open
soraxas opened this issue Sep 18, 2024 · 0 comments
Open

Impulsive joint having issue with the T12 example when flipped #733

soraxas opened this issue Sep 18, 2024 · 0 comments
Assignees
Labels
3D The issue is specifically about the 3D version of Rapier. A-Dynamics C-Bug Something isn't working D-Medium P-High

Comments

@soraxas
Copy link
Contributor

soraxas commented Sep 18, 2024

After adding the support of dae via PR #732, and changing the example in https://github.com/dimforge/rapier/blob/master/examples3d/urdf3.rs to

diff --git a/examples3d/urdf3.rs b/examples3d/urdf3.rs
index 815cfb6..19dd423 100644
--- a/examples3d/urdf3.rs
+++ b/examples3d/urdf3.rs
@@ -24,7 +24,7 @@ pub fn init_world(testbed: &mut Testbed) {
     };
 
     let (mut robot, _) =
-        UrdfRobot::from_file("assets/3d/T12/urdf/T12.URDF", options, None).unwrap();
+        UrdfRobot::from_file("assets/panda/urdf/panda_relative.urdf", options, None).unwrap();
 
     // The robot can be inserted using impulse joints.
     // (We clone because we want to insert the same robot once more afterward.)

with the popular panda arm (asset uploaded here: panda.tar.gz), we can then obtain the following:

image

which seems to be upside down. I'm not 100% sure why, but that might be due to bevy being Y-up and with left-hand cooridnate system:

image


After further modifying the code to rotate the other way:

diff --git a/examples3d/urdf3.rs b/examples3d/urdf3.rs
index 815cfb6..89d084c 100644
--- a/examples3d/urdf3.rs
+++ b/examples3d/urdf3.rs
@@ -19,7 +19,7 @@ pub fn init_world(testbed: &mut Testbed) {
         create_colliders_from_collision_shapes: false,
         make_roots_fixed: true,
         // Z-up to Y-up.
-        shift: Isometry::rotation(Vector::x() * std::f32::consts::FRAC_PI_2),
+        shift: Isometry::rotation(Vector::x() * -std::f32::consts::FRAC_PI_2),
         ..Default::default()
     };

we can then obtain the following, which seems all good.

image


The following is the actual bug report, where, after all the previously described modification (and the reason for the inverted rotational vector), the original example with T12 looks like this:
Peek 2024-09-18 23-00

The impulsive joints version seems to have some issue when the model is inserted with the shift of Isometry::rotation(Vector::x() * -std::f32::consts::FRAC_PI_2).

@Vrixyz Vrixyz added C-Bug Something isn't working 3D The issue is specifically about the 3D version of Rapier. A-Dynamics P-High D-Medium labels Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3D The issue is specifically about the 3D version of Rapier. A-Dynamics C-Bug Something isn't working D-Medium P-High
Projects
None yet
Development

No branches or pull requests

3 participants