# closed-chain-ik v0.0.7

Inverse kinematics solver for closed-chain and parallel mechanisms commonly found in robotics. Enables solving complex linkage systems like hexapod platforms, delta robots, and other parallel manipulators.

Source: https://github.com/gkjohnson/closed-chain-ik-js

```bash
npm install github:gkjohnson/closed-chain-ik-js#v0.0.7
```

## closed-chain-ik/core

### Classes

- [Frame](/tools/docs/closed-chain-ik/core/Frame.md): Base class for `Link`, `Joint`, and `Goal` representing a frame defined by a position and rotation in space.
- [Goal](/tools/docs/closed-chain-ik/core/Goal.md): A frame representing a target for a connected link to reach. The degrees of freedom set on a goal are the axes that are constrained, as opposed to the movable degrees of freedom of a joint. A goal cannot have children and can only be connected to a link with `makeClosure`.
- [Joint](/tools/docs/closed-chain-ik/core/Joint.md): A frame representing a kinematic joint with any combination of degrees of freedom. Each degree of freedom is an offset applied on top of the frame transform. Only links may be added as children and a joint may only have a single child.
- [Link](/tools/docs/closed-chain-ik/core/Link.md): A frame modeling a fixed connection between joints. Only joints may be added as children.
- [Solver](/tools/docs/closed-chain-ik/core/Solver.md): Solves the closure and joint target constraints of a system of frames using damped least squares. Every independent chain of joints found in the roots is solved separately.

### Functions

- [findRoots](/tools/docs/closed-chain-ik/core/functions.md): Finds the unique roots of the trees the given frames belong to, following closure connections so every connected tree is included.
- [saveRestPose](/tools/docs/closed-chain-ik/core/functions.md): Saves the current joint values of every joint in the tree as its rest pose and sets `restPoseSet` to `true`.

### Constants

- [DOF](/tools/docs/closed-chain-ik/core/constants.md): Degrees of freedom that can be assigned to a joint.
- [DOF_NAMES](/tools/docs/closed-chain-ik/core/constants.md): Names of the degrees of freedom indexed by `DOF` value.
- [SOLVE_STATUS](/tools/docs/closed-chain-ik/core/constants.md): Statuses returned for each independent chain by `Solver.solve`.
- [SOLVE_STATUS_NAMES](/tools/docs/closed-chain-ik/core/constants.md): Names of the solve statuses indexed by status value.

## closed-chain-ik/three

### Classes

- [IKRootsHelper](/tools/docs/closed-chain-ik/three/IKRootsHelper.md): Renders the frames of an IK system in a three.js scene. Frame relationships are drawn as lines and joints are drawn with indicators for their degrees of freedom.

### Functions

- [setIKFromUrdf](/tools/docs/closed-chain-ik/three/functions.md): Copies the root transform and joint values from the robot onto the IK tree, matching joints by name.
- [setUrdfFromIK](/tools/docs/closed-chain-ik/three/functions.md): Copies the root transform and joint values from the IK tree onto the robot, matching joints by name.
- [urdfRobotToIKRoot](/tools/docs/closed-chain-ik/three/functions.md): Builds an IK tree from a `URDFRobot` and returns its root joint, which has all six degrees of freedom set. Joint values on the robot are reflected in the tree.

## closed-chain-ik/worker

### Classes

- [WorkerSolver](/tools/docs/closed-chain-ik/worker/WorkerSolver.md): Runs the `Solver` asynchronously in a WebWorker. The worker owns a copy of the frames and the resulting joint values are copied back onto the frames on the main thread as solves complete.
