Skip to content

Commit

Permalink
Fix Nans from RevoluteJoint::angle() (#736)
Browse files Browse the repository at this point in the history
Fixes #735
  • Loading branch information
chrisdunelm authored Jan 8, 2025
1 parent dc4bd24 commit 564f7b7
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 564f7b7

Please sign in to comment.