Skip to content

Commit

Permalink
Added: Newton decay to geodesic IK+
Browse files Browse the repository at this point in the history
  • Loading branch information
KanishkNavale committed Feb 4, 2024
1 parent dfb10ec commit 5fc648f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions heimdall/robotics/inverse_kinematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,15 @@ def compute_geodesic_trajectory(
jacobian = jacobian_function(q_current)
p_current = forward_kinematics_function(q_current)

smooth_factor = pose_geodesic_distance(p_target, p_current)
jacobian_inverse = compute_stable_inverse_jacobian(jacobian)
q_next = q_current + jacobian_inverse @ relative_pose(p_current, p_target)
q_next = q_current + smooth_factor * jacobian_inverse @ relative_pose(
p_current, p_target
)

joint_trajectory.append(q_next)

pose_distance = pose_geodesic_distance(p_target, p_current)
pose_distance = smooth_factor
if torch.allclose(pose_distance, torch.zeros_like(pose_distance), atol=1e-4):
break

Expand Down

0 comments on commit 5fc648f

Please sign in to comment.