Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ramakarl/invk
Invk - Inverse Kinematics Library with Quaternions
https://github.com/ramakarl/invk
Last synced: 28 days ago
JSON representation
Invk - Inverse Kinematics Library with Quaternions
- Host: GitHub
- URL: https://github.com/ramakarl/invk
- Owner: ramakarl
- License: lgpl-3.0
- Created: 2019-05-06T23:33:18.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-05-08T20:14:17.000Z (over 5 years ago)
- Last Synced: 2024-05-02T19:21:44.770Z (7 months ago)
- Language: C
- Size: 558 KB
- Stars: 24
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- AwesomeCppGameDev - invk - Inverse Kinematics Library with Quaternions (Physics)
README
InvK - Inverse Kinematics Library using Quaternions
------------------------------------------------by Rama Hoetzlein ([ramakarl.com](http://ramakarl.com))
This is a simple library that demonsrates an efficient solution to
inverse kinematic chains using the Jacobian Transpose method over
quaternions. The goal of this library is to enable a baseline
implementation with few dependencies upon which to build larger projects.**Video demo here**:
[Youtube link](https://youtu.be/j6bwD-kF_BI)**Citations**:
You can cite this work as follows:
Hoetzlein, Rama. "INVK - A lightweight Inverse Kinematics Library using Quaternions", May 6th, 2019. Online at: github.com/ramakarl/invk
More useful reading material:
Steve Rotenberg, Inverse Kinematics (part 1), UCSB. [Slides](https://cseweb.ucsd.edu/classes/wi17/cse169-a/slides/CSE169_08.pdf)
Steve Rotenberg, Inverse Kinematics (part 2), UCSB. [Slides](https://cseweb.ucsd.edu/classes/wi17/cse169-a/slides/CSE169_09.pdf)
Andreas Aristidou and Joan Lasenby, Inverse Kinematics: a review of existing techniques and introduction of a new fast iterative solver. [Tech Report](http://www.andreasaristidou.com/publications/papers/CUEDF-INFENG,%20TR-632.pdf)IK and Quaternions
------------------
Quaternions allow for several benefits over Euler angles. First, axis boundaries are greatly simplified as quaternions can interpolate thru two arbitrary vectors. Second, IK requires incremental changes in angles which are well suited to quaternions. Third, quaternions are more efficient to compute for certain operations.There are two drawbacks to using quaternions for inverse kinematics. Per-axis angle range limits are more easily computed with Euler angles, so there is a conversion performed in the LimitQuaternion function to handle this. Finally, care must be taken to normalize the quaternions frequently during calculations.
Quaternions can represent an orientation (a local coordinate system), or they can represent a rotation (amount to rotate around a given axis), which makes it easy to compute changes in orientation. For example, a key operation during IK is to rotate a joint around its local coordinate X,Y or Z axis by an incremental angle. This is easily accomplished by observing that a joint which is oriented by a quaternion is **locally** rotated by performed a post-multiplying with a rotational quaternion.
P.fromAngleAxis ( angle, Vector3DF(0, 1, 0) ); // where angle is a scalar, vec<0,1,0> = Y-axis
Q = Q * P; // post-multiply to perform a rotation around the **local** Y-axis of Q.
Q = P * Q; // pre-multiply to perform a rotation around the **global** Y-axis of Q.
Where Q is a quaternion for local orientation, and P is a rotational quaternion. Notice the output Q is not a point but another quaternion (a new orientation).Revision History
--------
May 6, 2019 - v1.0 - Support for hinge and ball joints, with joint limits.How to Build
-------
* You will need to install cmake
1. Clone into a folder for invk
2. Create a build folder somewhere, eg. invk/build
3. From inside that folder: invk/build> cmake .. -DCMAKE_HELPERS_PATH=invk/helpers
4. When compile & generate succeed, run 'make'LICENSE
-------
This library is licensed under the LGPLv3 license.
https://www.gnu.org/licenses/lgpl-3.0.txtShort summary:
- Public changes to the library itself must be back-contributed or forked as LGPL
- Use in larger projects that are not LGPL are allowedRama Hoetzlein (c) May 2019