Skip to content

Commit

Permalink
Improve IK robustness with joint limits
Browse files Browse the repository at this point in the history
The past implementation often causes joint limit errors while the given problem is solvable. This is due to ignoring joint limits in iterations, and this commit resolves it: the IK solver explicitly considers joint limits in each iteration.

This change would not change the convergence ratio.
  • Loading branch information
ssr-yuki authored and OTL committed Sep 10, 2020
1 parent a913ea8 commit 5d49c04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ik.rs
Expand Up @@ -242,7 +242,7 @@ where
.as_slice(),
)
};
arm.set_joint_positions_unchecked(&positions_vec);
arm.set_joint_positions_clamped(&positions_vec);
Ok(calc_pose_diff_with_constraints(
target_pose,
&arm.end_transform(),
Expand Down Expand Up @@ -274,7 +274,7 @@ where
&& rot_diff.norm() < self.allowable_target_angle
{
let non_checked_positions = arm.joint_positions();
arm.set_joint_positions(&non_checked_positions)?;
arm.set_joint_positions_clamped(&non_checked_positions);
return Ok(());
}
last_target_distance = Some((len_diff, rot_diff));
Expand Down

0 comments on commit 5d49c04

Please sign in to comment.