Skip to content

Commit

Permalink
Fix Nans from RevoluteJoint::angle()
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdunelm committed Sep 21, 2024
1 parent e7e196d commit 5629688
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dynamics/joint/revolute_joint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ impl RevoluteJoint {

#[cfg(feature = "dim3")]
if joint_rot1.dot(&joint_rot2) < 0.0 {
-ang_err.i.asin() * 2.0
-ang_err.i.clamp(-1.0, 1.0).asin() * 2.0
} else {
ang_err.i.asin() * 2.0
ang_err.i.clamp(-1.0, 1.0).asin() * 2.0
}

#[cfg(feature = "dim2")]
Expand Down

0 comments on commit 5629688

Please sign in to comment.