Core Damped Least Squares iteration algorithm.
Implements the Levenberg-Marquardt style damped pseudoinverse:
Δθ = J^T (J J^T + λ²I)^(-1) ewhere:
- J is the Jacobian matrix
- e is the pose error vector
- λ is the damping factor
- Δθ is the joint update
The damping factor prevents instability near kinematic singularities where J J^T becomes ill-conditioned.
Summary
Functions
Compute the damped pseudoinverse update.
Run the DLS iteration loop until convergence or max iterations.
Types
@type iterate_result() :: {:ok, map(), %{iterations: non_neg_integer(), converged: boolean()}} | {:error, :max_iterations, %{iterations: non_neg_integer(), positions: map()}}
Functions
Compute the damped pseudoinverse update.
Uses the formula: Δθ = J^T (J J^T + λ²I)^(-1) e
This is a defn function for performance.
@spec iterate( BB.Robot.t(), map(), atom(), BB.Math.Vec3.t(), BB.Math.Quaternion.t() | nil, [atom()], config() ) :: iterate_result()
Run the DLS iteration loop until convergence or max iterations.
Parameters
robot- The BB.Robot structinitial_positions- Starting joint positionstarget_link- End-effector link nametarget_position- Target position as Vec3target_orientation- Target orientation as Quaternion (or nil for position-only)joint_names- Ordered list of joint namesconfig- Solver configuration map
Returns
{:ok, positions, meta}- Converged successfully{:error, :max_iterations, meta}- Failed to converge