Screws¶
Overview¶
In the early 1800s, Chasles proved that any change in the configuration of a rigid body can be parameterized in terms of a helical motion along a fixed axis [2]. Poinsot is credited with the discovery that a system of forces acting on a rigid body can be resolved as a force acting along a line combined with a torque acting about the same line [15]. Chasles’ and Poinsot’s work was later developed by Sir Robert Ball into the theory of screws [1]. Screws represent angular and translational quantities in a single 6x1 vector quantity. Not only do screws provide a systematic framework for kinematics and dynamics of mechanisms, their compact representation is well-suited for compact computer storage and facilitates vectorization.
Linear and angular velocity can be combined into a single 6x1 quantity as:
In 1873, Clifford coined the word motor to refer to this screw quantity (i.e. a combination of motion and vector) [4]. Later, Ball referred to this screw quantity as a twist [1]. The term twist is used more frequently in modern literature, and therefore is used in the present work.
Adjoint Matrix \([Ad]\)¶
The \(6 \times 6\) adjoint transformation matrix, \([Ad]\), for transforming twists from one coordinate system to another can be formed from \(SE(3)\) matrices. The derivation is briefly summarized below:
Consider a displacement about the \(z\) axis given by the Special Orthogonal \(SO(3)\) matrix:
Then
Where \(\tilde{\omega}_z\) is a skew symmetric matrix and the spatial velocity is given by
The derivation can be extended to \(SE(3)\) matrices for rigid body transformations:
and
simplifying yields:
Which yields a \(6\times 1\) velocity screw, also known as a twist, \(\underline{\mathbf{v}}\), where
In the language of modern differential geometry, velocity screws are known as the Lie algebra of the SE(3) group; their group is designated as \(se(3)\) [13]. The quantity in Eq. (5) can be expressed in other coordinate systems by a similarity transformation.
In computer implementation of the spatial velocity transformation, it is not necessary to perform the entire sequence of \(4\times4\) matrix operations. Not only can one exploit the matrix sparsity, but it is also possible to take advantage of the following identity to reduce the number of operations required. As the quantity \(R\Omega R^T\) is skew symmetric, it is only necessary to compute the \(\omega'\) terms as
R is orthonormal and therefore the second row of R crossed with the third row yields the first row, and the following is true:
and therefore:
and
Using this information, a \(6\times6\) adjoint transformation matrix can be generated to transform twists as
The matrix \([Ad]\) forms a \(6\times6\) screw basis. A similar matrix operator for transforming spatial velocities was introduced by Yuan and Freudenstein in 1970 [23]. Some authors put \(\underline\omega\) above \(\underline v\) as Yuan did. The form of spatial velocity specified in Eq. (22) was chosen in this work as it is the original order specified in Clifford’s Algebra [3] and is commonly used in flexible multibody dynamics formulations [17].
In the language of differential geometry, \([Ad]\) is known as the adjoint representation and provides a linear mapping of elements of a Lie algebra.
The \(6\times6\) screw basis, \([Ad]\), provides a convenient and compact notation for transforming screws, and therefore in computer implementation of the transformation, it is tempting to carry out full \(6\times6\) matrix algebra to transform twists. However, it is strongly emphasized that the full \(6\times6\) matrix algebra should never be carried out in computer code, and additionally that the full \(6\times6 [Ad]\) adjoint transformation matrix need not be stored or created in computer memory. In the present work, rigid body displacements are stored as a 12x1 array with the entries of a SO(3) rotation matrix stored in column-major order in the first 9 entries of the array, followed by a translation vector in the last 3 entries of the array. When computing \(v'\) and \(\omega'\) in Eq. (22), it is only necessary to multiply the non-zero terms of the various quantities as:
The number of floating point operations required to compute the Eq. (23) are shown below:
Operation |
Multiplies |
Adds |
Notes |
|---|---|---|---|
\(R\underline{\omega}\) |
9 |
6 |
|
\(\tilde{r}R\underline{\omega}\) |
6 |
3 |
\(R\underline{\omega}\) computed above |
\(R\underline{v}\) |
9 |
6 |
|
\(\tilde{r}R{\underline{\omega}} + R\underline{v}\) |
0 |
3 |
|
total |
24 |
18 |
On the other hand, carrying out full, dense matrix algebra requires the following operations:
Operation |
Multiplies |
Adds |
Notes |
|---|---|---|---|
\(\tilde{r}R\) |
27 |
18 |
Counts refers to the full, dense version. |
Full, dense Eq. (22) |
36 |
30 |
|
total |
63 |
48 |
Carrying out the minimal required operations to transform screw quantities requires 62% fewer operations, 66% less memory and many of the matrix-matrix and matrix-vector operations benefit from vectorization. The above example illustrates that although the notational convention of Lie algebra provides a convenient and compact representation of kinematic and dynamic quantities, care should be taken in the computer implementation of the operations described here. KSL consists of a custom, sparse, vectorized kinematics library consisting of over 200 functions for processing screw quantities and SE(3) displacements that uses the minimal set of operations as described above.
Derivative operator matrices: \([ad]\)¶
In Eq. (8), the derivative operator of the SE(3) group was found. Similarly, the derivative operator matrices for the \(6 \times 6\) transformation matrices, \([Ad]\) and \([Ad]^*\) can be found as follows:
Similarly, the left derivative operator for \([Ad]^*\) matrices is:
Previously, it was discussed how the derivative operators form the Lie algebra of the SE(3) group. Similarly, the \(6\times6\) \([Ad]\) matrices themselves fulfill the necessary requirements of a Lie group [16]. The \([ad]\) and \([ad]^*\) matrices comprise their respective Lie algebras.
Acceleration of a body point¶
The spatial acceleration \(\dot{\boldsymbol{\underline{v}}} = \{\dot{\underline{v}};\ \dot{\underline{\omega}}\}\) of a body is the time derivative of its spatial velocity \(\boldsymbol{\underline{v}} = \{\underline{v};\ \underline{\omega}\}\) taken at a point fixed in space, the origin of the reference frame. Its linear part is not the acceleration of a material point of the body. The velocity of the body point that is at \(\underline{r}\) is \(\underline{v} + \underline{\omega}\times\underline{r}\), and differentiating it with \(\dot{\underline{r}}\) equal to that velocity gives
where \(\dot{\underline{v}}_{,p}\) and \(\underline{v}_{,p}\) are the linear parts of
the two screws taken at the point by \([Ad]\). At the origin itself the acceleration
differs from \(\dot{\underline{v}}\) by \(\underline{\omega}\times\underline{v}\); the
two agree only where the velocity of the point is zero or parallel to
\(\underline{\omega}\), on the instantaneous screw axis. ksl_screw_pointAcceleration()
evaluates Eq. (26) at the origin of a frame \(\Phi\), in the
coordinates of that frame.
Influence coefficient matrices¶
An important tool in the analysis of mechanisms and multibody systems is a map of a particular joint’s velocity to the body velocity. From Eqs. (4) and (9), it is possible to find the velocity screw associated with a revolute joint. The joint is aligned with \(z\) axis of reference frame \(a\).
Here \(\underline{h}_a\) is the influence coefficient matrix [20] associated with the joint. Note that the influence coefficient matrix taken at the joint’s origin is simply a unit twist, \(\omega_z\), about the \(z\) axis.
Usually it is desirable to express the influence coefficient matrix with respect to other coordinate systems, such as the inertial reference frame. Using the \([Ad]\) operator in Eq. (9) yields:
These influence coefficient matrices taken with respect to the inertial reference frame form elements of the Jacobian matrix of a mechanism. As a mechanism moves through varying configurations, \(\underline{h}_f\) changes, and may require updating many millions of times in the course of a simulation. Equation (28) reveals important insight that allows one to reduce the number of floating point operations (FLOPs) required to update the influence coefficient matrix of primitive joints.
Once the position and orientation of each joint in a mechanism has been computed, the influence coefficient matrix can be computed simply by forming the corresponding column of \([Ad]\), which requires only 9 additional FLOPs for revolute joints and no additional FLOPs for prismatic joints. Additionally, if SE(3) displacements and the Jacobian matrix are stored in column-major order, updating the influence coefficient matrices and elements Jacobian matrix can be vectorized with a stride of 1, which is optimal in terms of memory access.
Unit screws and amplitude¶
A twist is the product of a unit screw and an amplitude, \(\underline{\mathbf{v}} = \hat{\underline{\mathbf{s}}}\,\dot\theta\) [8, 11, 12]. The amplitude is not the length of the \(6\times1\) vector: the linear and angular parts have different units, and their relative size changes with the length unit and with the origin of the coordinate system, so that length has no physical meaning. Instead:
if \(\underline\omega \neq 0\), the amplitude is \(\dot\theta = \lVert\underline\omega\rVert\), the rate of rotation about the screw axis, and the unit screw is
\[\begin{split}\hat{\underline{\mathbf{s}}} = \frac{\underline{\mathbf{v}}}{\lVert\underline\omega\rVert} = \begin{Bmatrix} \underline{r} \times \underline{s} + h\,\underline{s} \\ \underline{s} \end{Bmatrix}\end{split}\]where \(\underline{s}\) is the unit vector along the screw axis, \(\underline{r}\) is any point on the axis, and \(h = \underline\omega \cdot \underline v / \lVert\underline\omega\rVert^2\) is the pitch;
if \(\underline\omega = 0\), the twist is a pure translation (infinite pitch), \(\dot\theta = \lVert\underline v\rVert\), and \(\hat{\underline{\mathbf{s}}} = \{\underline v / \lVert\underline v\rVert, \underline 0\}\).
Both give the same unit screw in any coordinate system and any length unit.
ksl_screw_norm() returns the amplitude and ksl_screw_normalize()
divides by it. ksl_screw_pitch() returns \(h\) and ksl_screw_axisPoint() the
point of the axis nearest the reference point,
\(\underline\omega \times \underline v / \lVert\underline\omega\rVert^2\). Dividing instead by the dual magnitude
\(\lVert\underline\omega\rVert + \varepsilon\,\underline\omega\cdot
\underline v / \lVert\underline\omega\rVert\) would also remove the pitch,
leaving the Plücker coordinates of the screw axis, a line rather than a unit
twist.
Exponential and logarithm¶
A twist held constant for unit time carries a frame through a screw motion. With \(\boldsymbol{\underline{\xi}} = \{\underline{\rho};\ \theta\underline{u}\}\), where \(\underline{u}\) is a unit vector, the displacement reached is the matrix exponential
computed by ksl_screw_exp(). Its inverse, ksl_screw_log(), takes the rotation vector
\(\theta\underline{u}\) of \(R\) with \(0 \le \theta \le \pi\) and
The logarithm is the screw of the displacement (Chasles): its axis passes through
\(\underline{u}\times\underline{\rho}/\theta\) and its pitch is
\(\underline{u}^{T}\underline{\rho}/\theta\). Scaling it by \(t\) interpolates the
screw motion, \(\Phi_1\exp\bigl(t\log(\Phi_1^{-1}\Phi_2)\bigr)\), which is
ksl_SE3_sclerp() [9]; ksl_SE3_squad_keys() extends it to a
sequence of key displacements in the way squad extends slerp
[19] [14], with a velocity screw that is
continuous at the keys. ksl_SE3_exp() and ksl_SE3_log() are the same functions as
ksl_screw_exp() and ksl_screw_log().
Double precision¶
double precision screw consisting of a linear and angular vector pair in configuration space |
|
double precision screw constructor |
|
allocate n double precision screw quantities on the heap, must be freed by the user. |
|
Amplitude of a screw: the length of its angular part, or of its linear part if it is a pure translation. |
|
Normalize a screw in place, to a unit screw. |
|
Compute a unit screw from a screw. |
|
Pitch of a screw. |
|
Point of the screw axis nearest the reference point of a screw. |
|
Classical acceleration of a body point from the spatial velocity and spatial acceleration of the body. |
|
compute double precision dot product between a coscrew and screw |
|
Scale a screw in place: s = a * s. |
|
Copy double precision ksl_screw_t si to so. |
|
Invert (i.e. negate) a ksl_screw_t in place. |
|
Returns the inverse of a ksl_screw_t. |
|
compute axpy (y = a * x + y) operation for double precision screws |
|
Add a screw to another in place: so = so + s1i. |
|
Subtract a screw from another in place: so = so - s1i. |
|
Scale a screw: so = k * si. |
|
Add two screws: so = s1i + s2i. |
|
Subtract two screws: so = s1i - s2i. |
|
Add a pure translation screw to a screw: so = si1 + {si2.lin, 0}. |
|
Compute the screw of a prismatic joint along the z axis of a frame: ho = Ad(Di) * {ez, 0}. |
|
Compute the screw of a revolute joint about the x axis of a frame: ho = Ad(Di) * {0, ex}. |
|
Compute the screw of a revolute joint about the y axis of a frame: ho = Ad(Di) * {0, ey}. |
|
Compute the screw of a revolute joint about the z axis of a frame: ho = Ad(Di) * {0, ez}. |
|
Compute the screw of a prismatic joint along the negative x axis of a frame: ho = Ad(Di) * {-ex, 0}. |
|
Compute the screw of a prismatic joint along the negative y axis of a frame: ho = Ad(Di) * {-ey, 0}. |
|
Compute the screw of a prismatic joint along the negative z axis of a frame: ho = Ad(Di) * {-ez, 0}. |
|
Compute the screw of a revolute joint about the negative x axis of a frame: ho = Ad(Di) * {0, -ex}. |
|
Compute the screw of a revolute joint about the negative y axis of a frame: ho = Ad(Di) * {0, -ey}. |
|
Compute the screw of a revolute joint about the negative z axis of a frame: ho = Ad(Di) * {0, -ez}. |
|
double precision screw cross product |
|
Screw cross product with a pure translation screw: so = s1i x {s2i.lin, 0} = {s1i.ang x s2i.lin, 0}. |
|
Rotate a double precision screw. |
|
Rotate the inverse of a double precision screw. |
|
Perform inverse rotation of a double precision screw. |
|
Translate a double precision screw. |
|
Transform a screw by the adjoint of an inverse translation: so = Ad(T(ti)^-1) * si. |
|
Transform a negated screw by the adjoint of a translation: so = Ad(T(ti)) (-si). |
|
Transform a double precision screw by the adjoint of an SE3 transformation. |
|
Transform a negated screw by the adjoint of an SE3 transformation: so = Ad(Di) * (-si). |
|
Transform a screw by the adjoint of an inverse SE3 transformation: so = Ad(Di^-1) * si. |
|
Exponential of a screw: the displacement \(\Phi = \exp\boldsymbol{\underline{\xi}}\) . |
|
Logarithm of a displacement: the screw \(\boldsymbol{\underline{\xi}} = \log\Phi\) . |
|
Compute the screw of a revolute joint about an arbitrary axis of a frame: ho = Ad(Di) * {0, axis}. |
|
Compute the screw of a revolute joint about a negated arbitrary axis of a frame: ho = Ad(Di) * {0, -axis}. |
|
Compute the screw of a prismatic joint along an arbitrary axis of a frame: ho = Ad(Di) * {axis, 0}. |
|
Compute the screw of a prismatic joint along a negated arbitrary axis of a frame: ho = Ad(Di) * {-axis, 0}. |
|
Compute the screw of a prismatic joint along the x axis of a frame: ho = Ad(Di) * {ex, 0}. |
|
Compute the screw of a prismatic joint along the y axis of a frame: ho = Ad(Di) * {ey, 0}. |
|
Copy a double precision screw into a column-major ordered double precision array at specified row and column index as a column vector. |
|
Copy a double precision screw into a row-major ordered double precision array at specified row and column index as a column vector. |
|
Copy the negative (i..e inverse) of a double precision screw into a column-major ordered double precision array at specified row and column index as a column vector. |
|
Copy the negative (i.e. inverse) of a double precision screw into a row-major ordered double precision array at specified row and column index as a column vector. |
-
union ksl_screw_t¶
- #include <types.h>
double precision screw consisting of a linear and angular vector pair in configuration space
Public Members
-
double at[6]¶
- struct ksl_screw_t
anonymous union allows accessing screw quantities at specified index
-
ksl_vec3_t lin¶
free linear vector, e.g. linear velocity or acceleration
-
ksl_vec3_t ang¶
bound angular vector, e.g. angular velocity or angular acceleration
- struct ksl_screw_t
anonymous union allows accessing screw quantities by linear or angular vector components
-
double m0¶
-
double m1¶
-
double m2¶
-
double m3¶
-
double m4¶
-
double m5¶
- struct ksl_screw_t
anonymous union allows accessing screw quantities by field name
-
double at[6]¶
-
static inline ksl_screw_t ksl_screw(const double m0, const double m1, const double m2, const double m3, const double m4, const double m5)¶
double precision screw constructor
-
ksl_screw_t *ksl_screw_alloc(int n)¶
allocate n double precision screw quantities on the heap, must be freed by the user.
-
static inline double ksl_screw_norm(const ksl_screw_t *s)¶
Amplitude of a screw: the length of its angular part, or of its linear part if it is a pure translation.
A screw \(\{\underline{v}, \underline{\omega}\}\) (linear part first) is the product of a unit screw and an amplitude \(\dot\theta\) (Hunt, 1978; Murray et al., 1994; Lynch and Park, 2017; see the References). The length of all six components is not used: the angular and linear parts have different units, and their relative size depends on the length unit and on the origin of the coordinate system. Instead,
if \(\underline{\omega} \neq 0\), \(\dot\theta = \lVert\underline{\omega}\rVert\), the rate of rotation about the screw axis;
if \(\underline{\omega} = 0\) (a pure translation, infinite pitch), \(\dot\theta = \lVert\underline{v}\rVert\).
The angular part is taken as zero when its length is at most \(10^{-12}\) times that of the linear part in double precision, or \(10^{-5}\) times in single precision. Then \(\lVert\underline{v}\rVert / \lVert\underline{\omega}\rVert\) is at least \(10^{12}\) length units (in single precision, \(10^5\)): the screw axis lies that far from the origin or the pitch is that large, and the screw is a translation to within round-off. Because the test compares the two parts with each other rather than with a fixed number, screws of any size are classified the same way. A zero screw has amplitude zero.
- Parameters:
s – [in] screw
- Returns:
amplitude of s
-
static inline void ksl_screw_normalize(ksl_screw_t *s)¶
Normalize a screw in place, to a unit screw.
Divides the screw by its amplitude, ksl_screw_norm(). If the angular part is not zero, the result has a unit angular part \(\underline{s}\) along the screw axis and linear part \(\underline{r} \times \underline{s} + h\,\underline{s}\), where \(\underline{r}\) is a point on the axis and \(h = \underline{\omega}\cdot\underline{v} / \lVert\underline{\omega}\rVert^2\) is the pitch; the axis and pitch are unchanged. A pure translation becomes \(\{\underline{v} / \lVert\underline{v}\rVert, \underline{0}\}\). A zero screw is left unchanged.
- Parameters:
s – [in,out] screw
-
static inline void ksl_screw_normalized(const ksl_screw_t *si, ksl_screw_t *so)¶
Compute a unit screw from a screw.
The copy is normalized with ksl_screw_normalize().
- Parameters:
si – [in] screw
so – [out] normalized copy of si
-
static inline double ksl_screw_pitch(const ksl_screw_t *s)¶
Pitch of a screw.
For a screw \(\{\underline{v}, \underline{\omega}\}\) (linear part first),
\[ h = \frac{\underline{\omega}^{T}\underline{v}}{\underline{\omega}^{T}\underline{\omega}}, \]the translation along the screw axis per unit rotation about it. The pitch does not depend on the reference point or the coordinate system of the screw, nor on its amplitude. A pure translation ( \(\underline{\omega} = 0\), classified as in ksl_screw_norm()) has infinite pitch, and INFINITY is returned; a zero screw has pitch 0.
- Parameters:
s – [in] screw
- Returns:
pitch of s
-
static inline int ksl_screw_axisPoint(const ksl_screw_t *s, ksl_vec3_t *r)¶
Point of the screw axis nearest the reference point of a screw.
A screw \(\{\underline{v}, \underline{\omega}\}\) at a reference point has linear part \(\underline{v} = \tilde{r}\underline{\omega} + h\underline{\omega}\), where \(\underline{r}\) locates a point of its axis relative to the reference point and \(h\) is the pitch, ksl_screw_pitch(). The point of the axis nearest the reference point is
\[ \underline{r} = \frac{\tilde{\omega}\underline{v}}{\underline{\omega}^{T}\underline{\omega}}, \]in the coordinates of the screw. A pure translation or a zero screw has no axis (classified as in ksl_screw_norm()); then r is not set and 1 is returned.
- Parameters:
s – [in] screw
r – [out] point of the axis nearest the reference point, relative to it
- Returns:
0, or 1 if s has no axis
-
static inline void ksl_screw_pointAcceleration(const ksl_SE3_t *D, const ksl_screw_t *v, const ksl_screw_t *a, ksl_vec3_t *r_ddot)¶
Classical acceleration of a body point from the spatial velocity and spatial acceleration of the body.
The spatial velocity \(\boldsymbol{\underline{v}} = \{\underline{v}, \underline{\omega}\}\) and the spatial acceleration \(\dot{\boldsymbol{\underline{v}}} = \{\dot{\underline{v}}, \dot{\underline{\omega}}\}\) of a body are given at the origin of a frame \(f\) fixed in space, in coordinates of \(f\); \(\dot{\boldsymbol{\underline{v}}}\) is the time derivative of \(\boldsymbol{\underline{v}}\). The point \(p\) is the origin of the frame \(\Phi_{fp}\), given by D. Both screws are taken at \(p\) in coordinates of \(p\) by ksl_product_Adinvs(), and the acceleration of the material point of the body at \(p\) is
\[ \ddot{\underline{r}}_{fp}^{p} = \dot{\underline{v}}_{,p}^{p} + \tilde{\omega}^{p}\underline{v}_{,p}^{p}, \]the linear part of the spatial acceleration at \(p\) plus the cross product of the angular velocity with the velocity of the point. The second term vanishes only where the velocity of the point is zero or parallel to \(\underline{\omega}\) (on the instantaneous screw axis), so the linear part of the spatial acceleration is not in general the acceleration of a point, not even at the origin of \(f\). For the result in coordinates of \(f\), give D the identity rotation and the position of \(p\) in \(f\) as its translation.
- Parameters:
D – [in] frame of the point p in f, \(\Phi_{fp}\)
v – [in] spatial velocity of the body at the origin of f, in coordinates of f
a – [in] spatial acceleration of the body at the origin of f, in coordinates of f
r_ddot – [out] acceleration of the body point at p, in coordinates of p
-
static inline double ksl_dot_cs(const ksl_coscrew_t *ci, const ksl_screw_t *si)¶
compute double precision dot product between a coscrew and screw
-
static inline void ksl_screw_scale(ksl_screw_t *s, const double a)¶
Scale a screw in place: s = a * s.
- Parameters:
s – [in,out] screw
a – [in] scale factor
-
static inline void ksl_screw_copy(const ksl_screw_t *si, ksl_screw_t *so)¶
Copy double precision ksl_screw_t si to so.
\(S_i \rightarrow S_o\)
- Parameters:
si – [in] screw to copy
so – [out] si is copied to so
-
static inline void ksl_screw_invert(ksl_screw_t *si)¶
Invert (i.e. negate) a ksl_screw_t in place.
\(\mathbf{\underline{s}}^{-1} \rightarrow \mathbf{\underline{s}}\)
\(-\mathbf{\underline{s}} \rightarrow \mathbf{\underline{s}}\)
- Parameters:
si – [in/out] screw to invert
-
static inline void ksl_screw_inverted(const ksl_screw_t *si, ksl_screw_t *so)¶
Returns the inverse of a ksl_screw_t.
\(\mathbf{\underline{s}}_i^{-1} \rightarrow \mathbf{\underline{s}}_o\)
- Parameters:
si – [in] screw to invert
so – [out] inverse of si
-
static inline void ksl_axpy_ss(const double, const ksl_screw_t*, ksl_screw_t*)¶
compute axpy (y = a * x + y) operation for double precision screws
-
static inline void ksl_xpy_ss(const ksl_screw_t*, ksl_screw_t*)¶
Add a screw to another in place: so = so + s1i.
-
static inline void ksl_nxpy_ss(const ksl_screw_t*, ksl_screw_t*)¶
Subtract a screw from another in place: so = so - s1i.
-
static inline void ksl_product_as(const double k, const ksl_screw_t *si, ksl_screw_t *so)¶
Scale a screw: so = k * si.
- Parameters:
k – [in] scale factor
si – [in] screw
so – [out] scaled screw
-
static inline void ksl_add_ss(const ksl_screw_t *s1i, const ksl_screw_t *s2i, ksl_screw_t *so)¶
Add two screws: so = s1i + s2i.
- Parameters:
s1i – [in] first screw
s2i – [in] second screw
so – [out] sum
-
static inline void ksl_subtract_ss(const ksl_screw_t *s1i, const ksl_screw_t *s2i, ksl_screw_t *so)¶
Subtract two screws: so = s1i - s2i.
- Parameters:
s1i – [in] first screw
s2i – [in] screw to subtract
so – [out] difference
-
static inline void ksl_add_sst(const ksl_screw_t *si1, const ksl_screw_t *si2, ksl_screw_t *so)¶
Add a pure translation screw to a screw: so = si1 + {si2.lin, 0}.
- Parameters:
si1 – [in] screw
si2 – [in] screw whose linear part is added; its angular part is ignored
so – [out] sum
-
static inline void ksl_hstz(const ksl_SE3_t *Di, ksl_screw_t *ho)¶
Compute the screw of a prismatic joint along the z axis of a frame: ho = Ad(Di) * {ez, 0}.
This is the column of the Jacobian (influence coefficient) of a prismatic joint.
- Parameters:
Di – [in] pose of the joint frame
ho – [out] {rz, 0}, where rz is the z column of the rotation of Di
-
static inline void ksl_hsrx(const ksl_SE3_t *Di, ksl_screw_t *ho)¶
Compute the screw of a revolute joint about the x axis of a frame: ho = Ad(Di) * {0, ex}.
This is the column of the Jacobian (influence coefficient) of a revolute joint.
- Parameters:
Di – [in] pose of the joint frame
ho – [out] {t x rx, rx}, where rx is the x column of the rotation of Di
-
static inline void ksl_hsry(const ksl_SE3_t *Di, ksl_screw_t *ho)¶
Compute the screw of a revolute joint about the y axis of a frame: ho = Ad(Di) * {0, ey}.
This is the column of the Jacobian (influence coefficient) of a revolute joint.
- Parameters:
Di – [in] pose of the joint frame
ho – [out] {t x ry, ry}, where ry is the y column of the rotation of Di
-
static inline void ksl_hsrz(const ksl_SE3_t *Di, ksl_screw_t *ho)¶
Compute the screw of a revolute joint about the z axis of a frame: ho = Ad(Di) * {0, ez}.
This is the column of the Jacobian (influence coefficient) of a revolute joint.
- Parameters:
Di – [in] pose of the joint frame
ho – [out] {t x rz, rz}, where rz is the z column of the rotation of Di
-
static inline void ksl_hstxinv(const ksl_SE3_t *Di, ksl_screw_t *ho)¶
Compute the screw of a prismatic joint along the negative x axis of a frame: ho = Ad(Di) * {-ex, 0}.
- Parameters:
Di – [in] pose of the joint frame
ho – [out] {-rx, 0}, where rx is the x column of the rotation of Di
-
static inline void ksl_hstyinv(const ksl_SE3_t *Di, ksl_screw_t *ho)¶
Compute the screw of a prismatic joint along the negative y axis of a frame: ho = Ad(Di) * {-ey, 0}.
- Parameters:
Di – [in] pose of the joint frame
ho – [out] {-ry, 0}, where ry is the y column of the rotation of Di
-
static inline void ksl_hstzinv(const ksl_SE3_t *Di, ksl_screw_t *ho)¶
Compute the screw of a prismatic joint along the negative z axis of a frame: ho = Ad(Di) * {-ez, 0}.
- Parameters:
Di – [in] pose of the joint frame
ho – [out] {-rz, 0}, where rz is the z column of the rotation of Di
-
static inline void ksl_hsrxinv(const ksl_SE3_t *Di, ksl_screw_t *ho)¶
Compute the screw of a revolute joint about the negative x axis of a frame: ho = Ad(Di) * {0, -ex}.
- Parameters:
Di – [in] pose of the joint frame
ho – [out] {-t x rx, -rx}, where rx is the x column of the rotation of Di
-
static inline void ksl_hsryinv(const ksl_SE3_t *Di, ksl_screw_t *ho)¶
Compute the screw of a revolute joint about the negative y axis of a frame: ho = Ad(Di) * {0, -ey}.
- Parameters:
Di – [in] pose of the joint frame
ho – [out] {-t x ry, -ry}, where ry is the y column of the rotation of Di
-
static inline void ksl_hsrzinv(const ksl_SE3_t *Di, ksl_screw_t *ho)¶
Compute the screw of a revolute joint about the negative z axis of a frame: ho = Ad(Di) * {0, -ez}.
- Parameters:
Di – [in] pose of the joint frame
ho – [out] {-t x rz, -rz}, where rz is the z column of the rotation of Di
-
static inline void ksl_cross_ss(const ksl_screw_t *s1i, const ksl_screw_t *s2i, ksl_screw_t *so)¶
double precision screw cross product
-
static inline void ksl_cross_sst(const ksl_screw_t *s1i, const ksl_screw_t *s2i, ksl_screw_t *so)¶
Screw cross product with a pure translation screw: so = s1i x {s2i.lin, 0} = {s1i.ang x s2i.lin, 0}.
- Parameters:
s1i – [in] first screw
s2i – [in] screw whose linear part is used; its angular part is ignored
so – [out] cross product
-
static inline void ksl_product_Adrs(const ksl_mat3x3_t *r_oi, const ksl_screw_t *s_i, ksl_screw_t *s_o)¶
Rotate a double precision screw.
Store product of direction cosine matrix
r_oiand screws_iins_o.\( [Ad]_{(R^{oi})} \mathbf{\underline{s}}_{io,i}^i \rightarrow \mathbf{\underline{s}}_{io,i}^o \)
\( \begin{bmatrix} R^{oi} & 0\\0 & R^{oi} \end{bmatrix} \begin{Bmatrix} \underline{v}_{io,i}^i \\ \underline{\omega}_{io}^i \end{Bmatrix} \rightarrow \begin{Bmatrix} \underline{v}_{io,i}^o \\ \underline{\omega}_{io}^o \end{Bmatrix}\)
\( R^{oi} \underline{v}_{io,i}^i \rightarrow \underline{v}_{io,i}^i, R^{oi} \underline{\omega}_{io}^i \rightarrow \underline{\omega}_{io}^o \)
- Parameters:
r_oi – [in] an SO3 rotation matrix
s_i – [in] a 6x1 screw
s_o – [out] the product of r_oi * s_i is returned in s_o
-
static inline void ksl_product_Adrsinv(const ksl_mat3x3_t *r_oi, const ksl_screw_t *s_i, ksl_screw_t *s_o)¶
Rotate the inverse of a double precision screw.
Store product of direction cosine matrix
r_oiand the inverse of screws_iins_o.\( [Ad]_{(R^{oi})} (-\mathbf{\underline{s}}_{io,i}^i) \rightarrow \mathbf{\underline{s}}_{io,i}^o \)
\( -[Ad]_{(R^{oi})} \mathbf{\underline{s}}_{io,i}^i \rightarrow \mathbf{\underline{s}}_{io,i}^o \)
\( \begin{bmatrix} R^{oi} & 0\\0 & R^{oi} \end{bmatrix} \begin{Bmatrix} -\underline{v}_{io,i}^i \\ -\underline{\omega}_{io}^i \end{Bmatrix} \rightarrow \begin{Bmatrix} \underline{v}_{io,i}^o \\ \underline{\omega}_{io}^o \end{Bmatrix}\)
\( \begin{bmatrix} -R^{oi} & 0\\0 & -R^{oi} \end{bmatrix} \begin{Bmatrix} \underline{v}_{io,i}^i \\ \underline{\omega}_{io}^i \end{Bmatrix} \rightarrow \begin{Bmatrix} \underline{v}_{io,i}^o \\ \underline{\omega}_{io}^o \end{Bmatrix}\)
\( -R^{oi} \underline{v}_{io,i}^i \rightarrow \underline{v}_{io,i}^i, -R^{oi} \underline{\omega}_{io}^i \rightarrow \underline{\omega}_{io}^o \)
- Parameters:
r_oi – [in] an SO3 rotation matrix
s_i – [in] a 6x1 screw
s_o – [out] the product of r_oi * s_i is returned in s_o
-
static inline void ksl_product_Adrinvs(const ksl_mat3x3_t *r_io, const ksl_screw_t *s_i, ksl_screw_t *s_o)¶
Perform inverse rotation of a double precision screw.
Store product of the inverse of direction cosine matrix
r_iowith screws_iins_o, wherer_iois a member of SO(3).\( [Ad]_{(R^{io})^{-1}} \mathbf{\underline{s}}_{io,i}^i \rightarrow \mathbf{\underline{s}}_{io,i}^o \)
\( [Ad]_{(R^{oi})} \mathbf{\underline{s}}_{io,i}^i \rightarrow \mathbf{\underline{s}}_{io,i}^o \)
\( \begin{bmatrix} (R^{io})^{-1} & 0\\0 & (R^{io})^{-1} \end{bmatrix} \begin{Bmatrix} \underline{v}_{io,i}^i \\ \underline{\omega}_{io}^i \end{Bmatrix} \rightarrow \begin{Bmatrix} \underline{v}_{io,i}^o \\ \underline{\omega}_{io}^o \end{Bmatrix}\)
\( \begin{bmatrix} R^{oi} & 0\\0 & R^{oi} \end{bmatrix} \begin{Bmatrix} \underline{v}_{io,i}^i \\ \underline{\omega}_{io}^i \end{Bmatrix} \rightarrow \begin{Bmatrix} \underline{v}_{io,i}^o \\ \underline{\omega}_{io}^o \end{Bmatrix}\)
\( (R^{io})^{-1} \underline{v}_{io,i}^i \rightarrow \underline{v}_{io,i}^i, (R^{io})^{-1} \underline{\omega}_{io}^i \rightarrow \underline{\omega}_{io}^o \)
\( R^{oi} \underline{v}_{io,i}^i \rightarrow \underline{v}_{io,i}^i, R^{oi} \underline{\omega}_{io}^i \rightarrow \underline{\omega}_{io}^o \)
- Parameters:
r_io – [in] an SO3 rotation matrix
s_i – [in] a 6x1 screw
s_o – [out] the product of r_oi * s_i is returned in s_o
-
static inline void ksl_product_Adts(const ksl_vec3_t *t_oi, const ksl_screw_t *s_i, ksl_screw_t *s_o)¶
Translate a double precision screw.
Perform a spatial translation of screw
s_iusing the translation vectort_oi, storing results ins_o.\( [Ad]_{(\underline{t}_{oi}^i)} \mathbf{\underline{s}}_{io,i}^i \rightarrow \mathbf{\underline{s}}_{io,o}^i \)
\( \begin{bmatrix} I & \underline{\tilde{r}}_{oi}^i \\0 & I \end{bmatrix} \begin{Bmatrix} \underline{v}_{io,i}^i \\ \underline{\omega}_{io}^i \end{Bmatrix} \rightarrow \begin{Bmatrix} \underline{v}_{io,o}^i \\ \underline{\omega}_{io}^i \end{Bmatrix}\)
\( \underline{v}_{io,i}^i + \underline{\tilde{r}}_{oi}^i \underline{\omega}_{io}^i \rightarrow \underline{v}_{io,o}^i, \underline{\omega}_{io}^i \rightarrow \underline{\omega}_{io}^i \)
-
static inline void ksl_product_Adtinvs(const ksl_vec3_t *ti, const ksl_screw_t *si, ksl_screw_t *so)¶
Transform a screw by the adjoint of an inverse translation: so = Ad(T(ti)^-1) * si.
- Parameters:
ti – [in] translation
si – [in] screw
so – [out] {si.lin - ti x si.ang, si.ang}
-
static inline void ksl_product_Adtsinv(const ksl_vec3_t *ti, const ksl_screw_t *si, ksl_screw_t *so)¶
Transform a negated screw by the adjoint of a translation: so = Ad(T(ti)) (-si).
- Parameters:
ti – [in] translation
si – [in] screw
so – [out] -{si.lin + ti x si.ang, si.ang}
-
static inline void ksl_product_Ads(const ksl_SE3_t *Di, const ksl_screw_t *si, ksl_screw_t *so)¶
Transform a double precision screw by the adjoint of an SE3 transformation.
Computes so = Ad(Di) si, where Di = {R, t}:
\( s_o = \{R v + t \times R \omega,\; R \omega\}\)
with \( v \) the linear part and \( \omega \) the angular part of si.
- Parameters:
Di – [in] SE3 transformation
si – [in] screw
so – [out] transformed screw
-
static inline void ksl_product_Adsinv(const ksl_SE3_t *Di, const ksl_screw_t *si, ksl_screw_t *so)¶
Transform a negated screw by the adjoint of an SE3 transformation: so = Ad(Di) * (-si).
- Parameters:
Di – [in] SE3 transformation
si – [in] screw
so – [out] transformed, negated screw
-
static inline void ksl_product_Adinvs(const ksl_SE3_t *Di, const ksl_screw_t *si, ksl_screw_t *so)¶
Transform a screw by the adjoint of an inverse SE3 transformation: so = Ad(Di^-1) * si.
Expresses a screw given in the reference frame in the frame of Di.
- Parameters:
Di – [in] SE3 transformation to invert
si – [in] screw
so – [out] transformed screw
-
void ksl_screw_exp(const ksl_screw_t *si, ksl_SE3_t *Do)¶
Exponential of a screw: the displacement \(\Phi = \exp\boldsymbol{\underline{\xi}}\).
For the screw \(\boldsymbol{\underline{\xi}} = \{\underline{\rho};\ \theta\underline{u}\}\) (si->lin = \(\underline{\rho}\), si->ang = \(\theta\underline{u}\), with \(\underline{u}\) a unit vector), computes
\[\begin{split} \Phi = \exp\begin{bmatrix} \theta\tilde{u} & \underline{\rho} \\ 0 & 0 \end{bmatrix} = \begin{bmatrix} R & V\underline{\rho} \\ 0 & 1 \end{bmatrix}, \qquad \begin{aligned} R &= I + \sin\theta\,\tilde{u} + (1 - \cos\theta)\,\tilde{u}\tilde{u}, \\ V &= I + \frac{1 - \cos\theta}{\theta}\,\tilde{u} + \frac{\theta - \sin\theta}{\theta}\,\tilde{u}\tilde{u}, \end{aligned} \end{split}\]the displacement reached by moving for unit time with the constant velocity screw \(\boldsymbol{\underline{\xi}}\), taken at the origin of the moving frame in its own coordinates: a rotation by \(\theta\) about a line parallel to \(\underline{u}\) together with a translation along that line (Chasles). For \(\theta = 0\) it is the translation by \(\underline{\rho}\). Series are used for small \(\theta\). The inverse of ksl_screw_log() for \(0 \le \theta \le \pi\). Scaling the screw by \(t\) before the exponential, \(\exp(t\boldsymbol{\underline{\xi}})\), gives the displacement after the fraction \(t\) of the screw motion, the basis of ksl_SE3_sclerp().
- Parameters:
si – [in] screw \(\boldsymbol{\underline{\xi}}\)
Do – [out] displacement \(\exp\boldsymbol{\underline{\xi}}\)
-
void ksl_screw_log(const ksl_SE3_t *Di, ksl_screw_t *so)¶
Logarithm of a displacement: the screw \(\boldsymbol{\underline{\xi}} = \log\Phi\).
For \(\Phi = [R\ \ \underline{r};\ 0\ \ 1]\), the angular part \(\theta\underline{u}\) is the rotation vector of \(R\) with \(0 \le \theta \le \pi\) (the shorter rotation), and the linear part is \(\underline{\rho} = V^{-1}\underline{r}\) with
\[ V^{-1} = I - \frac{\theta}{2}\,\tilde{u} + \left(1 - \frac{\theta}{2}\cot\frac{\theta}{2}\right)\tilde{u}\tilde{u}. \]so->lin = \(\underline{\rho}\) and so->ang = \(\theta\underline{u}\). The screw has the same coordinates in both frames of \(\Phi\), since \(\Phi\) commutes with its logarithm. Its axis is the screw axis of the displacement, through the point \(\underline{u}\times\underline{\rho}/\theta\), and its pitch is \(\underline{u}^{T}\underline{\rho}/\theta\). At \(\theta = \pi\) the direction of \(\underline{u}\) is a choice and either sign is a logarithm. The inverse of ksl_screw_exp().
- Parameters:
Di – [in] displacement \(\Phi\)
so – [out] screw \(\log\Phi\)
-
static inline void ksl_hsra(const ksl_SE3_t *Di, const ksl_vec3_t *axis, ksl_screw_t *ho)¶
Compute the screw of a revolute joint about an arbitrary axis of a frame: ho = Ad(Di) * {0, axis}.
- Parameters:
Di – [in] pose of the joint frame
axis – [in] joint axis, expressed in the frame of Di
ho – [out] joint screw in the reference frame
-
static inline void ksl_hsrainv(const ksl_SE3_t *Di, const ksl_vec3_t *axis, ksl_screw_t *ho)¶
Compute the screw of a revolute joint about a negated arbitrary axis of a frame: ho = Ad(Di) * {0, -axis}.
- Parameters:
Di – [in] pose of the joint frame
axis – [in] joint axis, expressed in the frame of Di
ho – [out] joint screw in the reference frame
-
static inline void ksl_hsta(const ksl_SE3_t *Di, const ksl_vec3_t *axis, ksl_screw_t *ho)¶
Compute the screw of a prismatic joint along an arbitrary axis of a frame: ho = Ad(Di) * {axis, 0}.
- Parameters:
Di – [in] pose of the joint frame
axis – [in] joint axis, expressed in the frame of Di
ho – [out] joint screw in the reference frame
-
static inline void ksl_hstainv(const ksl_SE3_t *Di, const ksl_vec3_t *axis, ksl_screw_t *ho)¶
Compute the screw of a prismatic joint along a negated arbitrary axis of a frame: ho = Ad(Di) * {-axis, 0}.
- Parameters:
Di – [in] pose of the joint frame
axis – [in] joint axis, expressed in the frame of Di
ho – [out] joint screw in the reference frame
-
static inline void ksl_hstx(const ksl_SE3_t *Di, ksl_screw_t *ho)¶
Compute the screw of a prismatic joint along the x axis of a frame: ho = Ad(Di) * {ex, 0}.
This is the column of the Jacobian (influence coefficient) of a prismatic joint.
- Parameters:
Di – [in] pose of the joint frame
ho – [out] {rx, 0}, where rx is the x column of the rotation of Di
-
static inline void ksl_hsty(const ksl_SE3_t *Di, ksl_screw_t *ho)¶
Compute the screw of a prismatic joint along the y axis of a frame: ho = Ad(Di) * {ey, 0}.
This is the column of the Jacobian (influence coefficient) of a prismatic joint.
- Parameters:
Di – [in] pose of the joint frame
ho – [out] {ry, 0}, where ry is the y column of the rotation of Di
-
static inline void ksl_screw_copy_cmo(const ksl_screw_t *si, double *A, int rowIndex, int columnIndex, int stride)¶
Copy a double precision screw into a column-major ordered double precision array at specified row and column index as a column vector.
-
inline void ksl_screw_copy_rmo(const ksl_screw_t *si, double *A, int rowIndex, int columnIndex, int stride)¶
Copy a double precision screw into a row-major ordered double precision array at specified row and column index as a column vector.
-
void ksl_screw_ncopy_cmo(const ksl_screw_t *si, double *A, int rowIndex, int columnIndex, int stride)¶
Copy the negative (i..e inverse) of a double precision screw into a column-major ordered double precision array at specified row and column index as a column vector.
-
inline void ksl_screw_ncopy_rmo(const ksl_screw_t *si, double *A, int rowIndex, int columnIndex, int stride)¶
Copy the negative (i.e. inverse) of a double precision screw into a row-major ordered double precision array at specified row and column index as a column vector.
Single precision¶
single precision screw consisting of a linear and angular vector pair in configuration space |
|
single precision screw constructor |
|
allocate n single precision screw quantities on the heap, must be freed by the user. |
|
Single precision version of ksl_screw_norm(). |
|
Single precision version of ksl_screw_normalize(). |
|
Single precision version of ksl_screw_pitch(). |
|
Single precision version of ksl_screw_axisPoint(). |
|
Single precision version of ksl_screw_pointAcceleration(). |
|
compute single precision dot product between a coscrew and screw |
|
Single precision version of ksl_screw_scale(). |
|
Copy single precision ksl_screwf_t si to so. |
|
Invert (i.e. negate) a ksl_screwf_t in place. |
|
Returns the inverse of a ksl_screwf_t. |
|
compute axpy (y = a * x + y) operation for single precision screws |
|
Single precision version of ksl_xpy_ss(). |
|
Single precision version of ksl_nxpy_ss(). |
|
Single precision version of ksl_product_as(). |
|
Single precision version of ksl_add_ss(). |
|
Single precision version of ksl_subtract_ss(). |
|
Single precision version of ksl_add_sst(). |
|
Single precision version of ksl_hstz(). |
|
Single precision version of ksl_hsrx(). |
|
Single precision version of ksl_hsry(). |
|
Single precision version of ksl_hsrz(). |
|
Single precision version of ksl_hstxinv(). |
|
Single precision version of ksl_hstyinv(). |
|
Single precision version of ksl_hstzinv(). |
|
Single precision version of ksl_hsrxinv(). |
|
Single precision version of ksl_hsryinv(). |
|
Single precision version of ksl_hsrzinv(). |
|
single precision screw cross product |
|
Single precision version of ksl_cross_sst(). |
|
Rotate a single precision screw. |
|
Rotate the inverse of a single precision screw. |
|
Perform inverse rotation of a single precision screw. |
|
Translate a single precision screw. |
|
Single precision version of ksl_product_Adtinvs(). |
|
Single precision version of ksl_product_Adtsinv(). |
|
Transform a single precision screw by the adjoint of an SE3 transformation. |
|
Single precision version of ksl_product_Adsinv(). |
|
Single precision version of ksl_product_Adinvs(). |
|
Single precision version of ksl_screw_exp(), computed in double precision. |
|
Single precision version of ksl_screw_log(), computed in double precision. |
|
Single precision version of ksl_hsra(). |
|
Single precision version of ksl_hsrainv(). |
|
Single precision version of ksl_hsta(). |
|
Single precision version of ksl_hstainv(). |
|
Copy a single precision screw into a column-major ordered double precision array at specified row and column index as a column vector. |
|
Copy a single precision screw into a row-major ordered double precision array at specified row and column index as a column vector. |
|
Copy the negative (i.e. inverse) of a single precision screw into a column-major ordered double precision array at specified row and column index as a column vector. |
|
Copy the negative (i.e. inverse) of a single precision screw into a row-major ordered double precision array at specified row and column index as a column vector. |
|
Single precision version of ksl_screw_normalized(). |
|
Single precision version of ksl_hstx(). |
|
Single precision version of ksl_hsty(). |
-
union ksl_screwf_t¶
- #include <types.h>
single precision screw consisting of a linear and angular vector pair in configuration space
Public Members
-
float at[6]¶
allows accessing screw quantities at specified index
- struct ksl_screwf_t
anonymous union allows accessing screw quantities at specified index
-
ksl_vec3f_t lin¶
free linear vector, e.g. linear velocity or acceleration
-
ksl_vec3f_t ang¶
bound angular vector, e.g. angular velocity or angular acceleration
- struct ksl_screwf_t
anonymous union allows accessing screw quantities by linear or angular vector components
-
float m0¶
-
float m1¶
-
float m2¶
-
float m3¶
-
float m4¶
-
float m5¶
- struct ksl_screwf_t
anonymous union allows accessing screw quantities by field name
-
float at[6]¶
-
static inline ksl_screwf_t ksl_screwf(const float m0, const float m1, const float m2, const float m3, const float m4, const float m5)¶
single precision screw constructor
-
ksl_screwf_t *ksl_screwf_alloc(int n)¶
allocate n single precision screw quantities on the heap, must be freed by the user.
-
static inline float ksl_screwf_norm(const ksl_screwf_t *s)¶
Single precision version of ksl_screw_norm().
-
static inline void ksl_screwf_normalize(ksl_screwf_t *s)¶
Single precision version of ksl_screw_normalize().
-
static inline float ksl_screwf_pitch(const ksl_screwf_t *s)¶
Single precision version of ksl_screw_pitch().
-
static inline int ksl_screwf_axisPoint(const ksl_screwf_t *s, ksl_vec3f_t *r)¶
Single precision version of ksl_screw_axisPoint().
-
static inline void ksl_screwf_pointAcceleration(const ksl_SE3f_t *D, const ksl_screwf_t *v, const ksl_screwf_t *a, ksl_vec3f_t *r_ddot)¶
Single precision version of ksl_screw_pointAcceleration().
-
static inline float ksl_dot_csf(const ksl_coscrewf_t *ci, const ksl_screwf_t *si)¶
compute single precision dot product between a coscrew and screw
-
static inline void ksl_screwf_scale(ksl_screwf_t *s, const float a)¶
Single precision version of ksl_screw_scale().
-
static inline void ksl_screwf_copy(const ksl_screwf_t *si, ksl_screwf_t *so)¶
Copy single precision ksl_screwf_t si to so.
\(S_i \rightarrow S_o\)
- Parameters:
si – [in] screw to copy
so – [out] si is copied to so
-
static inline void ksl_screwf_invert(ksl_screwf_t *si)¶
Invert (i.e. negate) a ksl_screwf_t in place.
\(\mathbf{\underline{s}}^{-1} \rightarrow \mathbf{\underline{s}}\)
\(-\mathbf{\underline{s}} \rightarrow \mathbf{\underline{s}}\)
- Parameters:
si – [in/out] screw to invert
-
static inline void ksl_screwf_inverted(const ksl_screwf_t *si, ksl_screwf_t *so)¶
Returns the inverse of a ksl_screwf_t.
\(\mathbf{\underline{s}}_i^{-1} \rightarrow \mathbf{\underline{s}}_o\)
- Parameters:
si – [in] screw to invert
so – [out] inverse of si
-
static inline void ksl_axpy_ssf(const float, const ksl_screwf_t*, ksl_screwf_t*)¶
compute axpy (y = a * x + y) operation for single precision screws
-
static inline void ksl_xpy_ssf(const ksl_screwf_t*, ksl_screwf_t*)¶
Single precision version of ksl_xpy_ss().
-
static inline void ksl_nxpy_ssf(const ksl_screwf_t*, ksl_screwf_t*)¶
Single precision version of ksl_nxpy_ss().
-
static inline void ksl_product_asf(const float k, const ksl_screwf_t *si, ksl_screwf_t *so)¶
Single precision version of ksl_product_as().
-
static inline void ksl_add_ssf(const ksl_screwf_t *s1i, const ksl_screwf_t *s2i, ksl_screwf_t *so)¶
Single precision version of ksl_add_ss().
-
static inline void ksl_subtract_ssf(const ksl_screwf_t *s1i, const ksl_screwf_t *s2i, ksl_screwf_t *so)¶
Single precision version of ksl_subtract_ss().
-
static inline void ksl_add_sstf(const ksl_screwf_t *si1, const ksl_screwf_t *si2, ksl_screwf_t *so)¶
Single precision version of ksl_add_sst().
-
static inline void ksl_hstzf(const ksl_SE3f_t *Di, ksl_screwf_t *ho)¶
Single precision version of ksl_hstz().
-
static inline void ksl_hsrxf(const ksl_SE3f_t *Di, ksl_screwf_t *ho)¶
Single precision version of ksl_hsrx().
-
static inline void ksl_hsryf(const ksl_SE3f_t *Di, ksl_screwf_t *ho)¶
Single precision version of ksl_hsry().
-
static inline void ksl_hsrzf(const ksl_SE3f_t *Di, ksl_screwf_t *ho)¶
Single precision version of ksl_hsrz().
-
static inline void ksl_hstxinvf(const ksl_SE3f_t *Di, ksl_screwf_t *ho)¶
Single precision version of ksl_hstxinv().
-
static inline void ksl_hstyinvf(const ksl_SE3f_t *Di, ksl_screwf_t *ho)¶
Single precision version of ksl_hstyinv().
-
static inline void ksl_hstzinvf(const ksl_SE3f_t *Di, ksl_screwf_t *ho)¶
Single precision version of ksl_hstzinv().
-
static inline void ksl_hsrxinvf(const ksl_SE3f_t *Di, ksl_screwf_t *ho)¶
Single precision version of ksl_hsrxinv().
-
static inline void ksl_hsryinvf(const ksl_SE3f_t *Di, ksl_screwf_t *ho)¶
Single precision version of ksl_hsryinv().
-
static inline void ksl_hsrzinvf(const ksl_SE3f_t *Di, ksl_screwf_t *ho)¶
Single precision version of ksl_hsrzinv().
-
static inline void ksl_cross_ssf(const ksl_screwf_t *s1i, const ksl_screwf_t *s2i, ksl_screwf_t *so)¶
single precision screw cross product
-
static inline void ksl_cross_sstf(const ksl_screwf_t *s1i, const ksl_screwf_t *s2i, ksl_screwf_t *so)¶
Single precision version of ksl_cross_sst().
-
static inline void ksl_product_Adrsf(const ksl_mat3x3f_t *r_oi, const ksl_screwf_t *s_i, ksl_screwf_t *s_o)¶
Rotate a single precision screw.
Store product of direction cosine matrix
r_oiand screws_iins_o.\( [Ad]_{(R^{oi})} \mathbf{\underline{s}}_{io,i}^i \rightarrow \mathbf{\underline{s}}_{io,i}^o \)
\( \begin{bmatrix} R^{oi} & 0\\0 & R^{oi} \end{bmatrix} \begin{Bmatrix} \underline{v}_{io,i}^i \\ \underline{\omega}_{io}^i \end{Bmatrix} \rightarrow \begin{Bmatrix} \underline{v}_{io,i}^o \\ \underline{\omega}_{io}^o \end{Bmatrix}\)
\( R^{oi} \underline{v}_{io,i}^i \rightarrow \underline{v}_{io,i}^i, R^{oi} \underline{\omega}_{io}^i \rightarrow \underline{\omega}_{io}^o \)
- Parameters:
r_oi – [in] an SO3 rotation matrix
s_i – [in] a 6x1 screw
s_o – [out] the product of r_oi * s_i is returned in s_o
-
static inline void ksl_product_Adrsinvf(const ksl_mat3x3f_t *r_oi, const ksl_screwf_t *s_i, ksl_screwf_t *s_o)¶
Rotate the inverse of a single precision screw.
Store product of direction cosine matrix
r_oiand the inverse of screws_iins_o.\( [Ad]_{(R^{oi})} (-\mathbf{\underline{s}}_{io,i}^i) \rightarrow \mathbf{\underline{s}}_{io,i}^o \)
\( -[Ad]_{(R^{oi})} \mathbf{\underline{s}}_{io,i}^i \rightarrow \mathbf{\underline{s}}_{io,i}^o \)
\( \begin{bmatrix} R^{oi} & 0\\0 & R^{oi} \end{bmatrix} \begin{Bmatrix} -\underline{v}_{io,i}^i \\ -\underline{\omega}_{io}^i \end{Bmatrix} \rightarrow \begin{Bmatrix} \underline{v}_{io,i}^o \\ \underline{\omega}_{io}^o \end{Bmatrix}\)
\( \begin{bmatrix} -R^{oi} & 0\\0 & -R^{oi} \end{bmatrix} \begin{Bmatrix} \underline{v}_{io,i}^i \\ \underline{\omega}_{io}^i \end{Bmatrix} \rightarrow \begin{Bmatrix} \underline{v}_{io,i}^o \\ \underline{\omega}_{io}^o \end{Bmatrix}\)
\( -R^{oi} \underline{v}_{io,i}^i \rightarrow \underline{v}_{io,i}^i, -R^{oi} \underline{\omega}_{io}^i \rightarrow \underline{\omega}_{io}^o \)
- Parameters:
r_oi – [in] an SO3 rotation matrix
s_i – [in] a 6x1 screw
s_o – [out] the product of r_oi * s_i is returned in s_o
-
static inline void ksl_product_Adrinvsf(const ksl_mat3x3f_t *r_io, const ksl_screwf_t *s_i, ksl_screwf_t *s_o)¶
Perform inverse rotation of a single precision screw.
Store product of the inverse of direction cosine matrix
r_iowith screws_iins_o, wherer_iois a member of SO(3).\( [Ad]_{(R^{io})^{-1}} \mathbf{\underline{s}}_{io,i}^i \rightarrow \mathbf{\underline{s}}_{io,i}^o \)
\( [Ad]_{(R^{oi})} \mathbf{\underline{s}}_{io,i}^i \rightarrow \mathbf{\underline{s}}_{io,i}^o \)
\( \begin{bmatrix} (R^{io})^{-1} & 0\\0 & (R^{io})^{-1} \end{bmatrix} \begin{Bmatrix} \underline{v}_{io,i}^i \\ \underline{\omega}_{io}^i \end{Bmatrix} \rightarrow \begin{Bmatrix} \underline{v}_{io,i}^o \\ \underline{\omega}_{io}^o \end{Bmatrix}\)
\( \begin{bmatrix} R^{oi} & 0\\0 & R^{oi} \end{bmatrix} \begin{Bmatrix} \underline{v}_{io,i}^i \\ \underline{\omega}_{io}^i \end{Bmatrix} \rightarrow \begin{Bmatrix} \underline{v}_{io,i}^o \\ \underline{\omega}_{io}^o \end{Bmatrix}\)
\( (R^{io})^{-1} \underline{v}_{io,i}^i \rightarrow \underline{v}_{io,i}^i, (R^{io})^{-1} \underline{\omega}_{io}^i \rightarrow \underline{\omega}_{io}^o \)
\( R^{oi} \underline{v}_{io,i}^i \rightarrow \underline{v}_{io,i}^i, R^{oi} \underline{\omega}_{io}^i \rightarrow \underline{\omega}_{io}^o \)
- Parameters:
r_io – [in] an SO3 rotation matrix
s_i – [in] a 6x1 screw
s_o – [out] the product of r_oi * s_i is returned in s_o
-
static inline void ksl_product_Adtsf(const ksl_vec3f_t *ti, const ksl_screwf_t *si, ksl_screwf_t *so)¶
Translate a single precision screw.
Perform a spatial translation of screw
s_iusing the translation vectort_oi, storing results ins_o.\( [Ad]_{(\underline{t}_{oi}^i)} \mathbf{\underline{s}}_{io,i}^i \rightarrow \mathbf{\underline{s}}_{io,o}^i \)
\( \begin{bmatrix} I & \underline{\tilde{r}}_{oi}^i \\0 & I \end{bmatrix} \begin{Bmatrix} \underline{v}_{io,i}^i \\ \underline{\omega}_{io}^i \end{Bmatrix} \rightarrow \begin{Bmatrix} \underline{v}_{io,o}^i \\ \underline{\omega}_{io}^i \end{Bmatrix}\)
\( \underline{v}_{io,i}^i + \underline{\tilde{r}}_{oi}^i \underline{\omega}_{io}^i \rightarrow \underline{v}_{io,o}^i, \underline{\omega}_{io}^i \rightarrow \underline{\omega}_{io}^i \)
-
static inline void ksl_product_Adtinvsf(const ksl_vec3f_t *ti, const ksl_screwf_t *si, ksl_screwf_t *so)¶
Single precision version of ksl_product_Adtinvs().
-
static inline void ksl_product_Adtsinvf(const ksl_vec3f_t *ti, const ksl_screwf_t *si, ksl_screwf_t *so)¶
Single precision version of ksl_product_Adtsinv().
-
static inline void ksl_product_Adsf(const ksl_SE3f_t *Di, const ksl_screwf_t *si, ksl_screwf_t *so)¶
Transform a single precision screw by the adjoint of an SE3 transformation.
Computes so = Ad(Di) si, where Di = {R, t}:
\( s_o = \{R v + t \times R \omega,\; R \omega\}\)
with \( v \) the linear part and \( \omega \) the angular part of si.
- Parameters:
Di – [in] SE3 transformation
si – [in] screw
so – [out] transformed screw
-
static inline void ksl_product_Adsinvf(const ksl_SE3f_t *Di, const ksl_screwf_t *si, ksl_screwf_t *so)¶
Single precision version of ksl_product_Adsinv().
-
static inline void ksl_product_Adinvsf(const ksl_SE3f_t *Di, const ksl_screwf_t *si, ksl_screwf_t *so)¶
Single precision version of ksl_product_Adinvs().
-
void ksl_screwf_exp(const ksl_screwf_t *si, ksl_SE3f_t *Do)¶
Single precision version of ksl_screw_exp(), computed in double precision.
-
void ksl_screwf_log(const ksl_SE3f_t *Di, ksl_screwf_t *so)¶
Single precision version of ksl_screw_log(), computed in double precision.
-
static inline void ksl_hsraf(const ksl_SE3f_t *Di, const ksl_vec3f_t *axis, ksl_screwf_t *ho)¶
Single precision version of ksl_hsra().
-
static inline void ksl_hsrainvf(const ksl_SE3f_t *Di, const ksl_vec3f_t *axis, ksl_screwf_t *ho)¶
Single precision version of ksl_hsrainv().
-
static inline void ksl_hstaf(const ksl_SE3f_t *Di, const ksl_vec3f_t *axis, ksl_screwf_t *ho)¶
Single precision version of ksl_hsta().
-
static inline void ksl_hstainvf(const ksl_SE3f_t *Di, const ksl_vec3f_t *axis, ksl_screwf_t *ho)¶
Single precision version of ksl_hstainv().
-
static inline void ksl_screwf_copy_cmo(const ksl_screwf_t *si, float *A, int rowIndex, int columnIndex, int stride)¶
Copy a single precision screw into a column-major ordered double precision array at specified row and column index as a column vector.
-
void ksl_screwf_copy_rmo(const ksl_screwf_t *si, float *A, int rowIndex, int columnIndex, int stride)¶
Copy a single precision screw into a row-major ordered double precision array at specified row and column index as a column vector.
-
void ksl_screwf_ncopy_cmo(const ksl_screwf_t *si, float *A, int rowIndex, int columnIndex, int stride)¶
Copy the negative (i.e. inverse) of a single precision screw into a column-major ordered double precision array at specified row and column index as a column vector.
-
void ksl_screwf_ncopy_rmo(const ksl_screwf_t *si, float *A, int rowIndex, int columnIndex, int stride)¶
Copy the negative (i.e. inverse) of a single precision screw into a row-major ordered double precision array at specified row and column index as a column vector.
-
static inline void ksl_screwf_normalized(const ksl_screwf_t *si, ksl_screwf_t *so)¶
Single precision version of ksl_screw_normalized().
-
static inline void ksl_hstxf(const ksl_SE3f_t *Di, ksl_screwf_t *ho)¶
Single precision version of ksl_hstx().
-
static inline void ksl_hstyf(const ksl_SE3f_t *Di, ksl_screwf_t *ho)¶
Single precision version of ksl_hsty().