Coscrews¶
Overview¶
- Just as the linear and angular velocities can be combined into a single \(6 \times 1\) column vector, forces and moments can be combined in a single quantity called a wrench. A wrench is dual to a screw, i.e., it is a linear operator on a screw. In older literature, a wrench is often referred to as another kind of screw. In modern literature, a wrenches are referred to as a coscrews [16]. A superscript \(^*\) is used to distinguish a coscrew from a screw. A wrench,
\(\underline{\mathbf{f}}^*\), is defined as
Coadjoint Matrix \([Ad]^*\)¶
As coscrews are dual to screws, they are transformed differently than screws. The following simple example illustrates how coscrews are transformed. The power imparted by a linear combination of a wrench and screw is invariant, regardless of the coordinate system in which it is expressed. The power imparted by a given wrench and screw, the scalar quantity \(p\), is given as
Recall that the operator for transforming screw quantities is
Therefore
And
Therefore, the \(6\times6\) coadjoint transformation matrix for transforming coscrews is [1] :
Constraint Forces¶
Consider two bodies pinned together by a revolute joint aligned with the \(z\) axis of its local coordinate frame, \(a\). If the joint is modeled without friction, then no torques about the joint axis can be transmitted from the first body to the second body. The only forces that can be imparted from one joint to the next are those orthogonal to the joint’s axis. If a spatial wrench \(\underline{\mathbf{f}}^*_a\) is applied to the joint, the non–working joint reaction forces are given by
The coadjoint transformation matrix, \([Ad]^*\), from Eq. (6) provides a convenient and compact method to express constraint forces in other coordinate systems.
Second, consider the case where working forces may be applied in a joint, such as in a robotic actuator. The torque provided by the motor required to resist the applied wrench \(\underline{f}_a^*\) is given by
From Eqs. (8) and (9) it follows that
and additionally that
as each of the columns of \(\bar{H}^*\) are orthogonal to \(\underline{\mathbf{h}}^*\).
In the present example, \([\bar{H}^* \cup \underline{\mathbf{h}}^*]=[\bar{H}^* \underline{\mathbf{h}}^*]\), as \(\underline{\mathbf{h}}^*\) occurs in the last column of \([Ad]^*\), however in the general case, \(\underline{\mathbf{h}}^*\) may occur in a different column of \([Ad]^*\), corresponding to the type of primitive joint. In the following discussion, the \(\cup\) symbol is dropped with the understanding that the matrix \(\underline{\mathbf{h}}^*\) occurs in its respective column, interspersed within the columns of \(\bar{H}^*\).
Derivative operator matrices: \([ad]^*\)¶
The left derivative operator for \([Ad]^*\) matrices is:
Unit coscrews and amplitude¶
As with twists (see Screws), a wrench
\(\{\underline f, \underline n\}\) is the product of a unit coscrew
and an amplitude [4, 8], and the length
of the \(6\times1\) vector is not used, since force and moment have
different units. If \(\underline f \neq 0\), the amplitude is
\(\lVert\underline f\rVert\), and the unit coscrew has a unit force
along the line of action; if \(\underline f = 0\), the wrench is a pure
couple (infinite pitch) and the amplitude is \(\lVert\underline
n\rVert\). ksl_coscrew_norm() returns the amplitude and
ksl_coscrew_normalize() divides by it. ksl_coscrew_pitch() returns the pitch
\(h = \underline f \cdot \underline n / \lVert\underline f\rVert^2\) and
ksl_coscrew_axisPoint() the point of the line of action nearest the reference point,
\(\underline f \times \underline n / \lVert\underline f\rVert^2\).
Double precision¶
double precision coscrew (i.e. a linear operator on a screw), consisting of a linear and angular vector pair in function space. |
|
double precision screw constructor |
|
Allocates n double precision coscrew quantities on the heap. Must be freed by the user. |
|
Copy double precision ksl_coscrew_t. |
|
Scale a double precision ksl_coscrew_t. |
|
Returns the inverse of a ksl_coscrew_t. |
|
Invert (i.e. negate) a ksl_coscrew_t in place. |
|
In-place add a double precision coscrew multiplied with a scalar to an existing coscrew. |
|
In-place add a double precision coscrew to an existing coscrew. This is a variant of axpy where the scalar term a is 1. |
|
In-place subtract a double precision coscrew x from an coscrew y. This is a variant of axpy where the scalar term is -1. |
|
Scale a double precision coscrew. |
|
Compute the sum of two double precision coscrews. |
|
Compute the difference between two double precision coscrews. |
|
Cross product of a screw and a coscrew: co = si x* ci = {w x f, w x n + v x f}. |
|
Performs a double precision spatial translation of a coscrew. Performs a Coadjoint transformation of a coscrew, where CoAdjoint transformation matrix consists of only a translation component. |
|
Performs a double precision spatial translation of the inverse of a coscrew. Performs a Coadjoint transformation of the inverse of a coscrew, where CoAdjoint transformation matrix consists of only a translation component. |
|
Performs a double precision spatial rotation of a coscrew. Performs a Coadjoint transformation of a coscrew, where CoAdjoint transformation matrix consists of only a rotation component. |
|
Performs a double precision spatial rotation of a coscrew, using the transpose of the input rotation matrix. Performs a Coadjoint transformation of a coscrew, where CoAdjoint transformation matrix consists of only a rotation component transposed. |
|
Performs a double precision spatial transformation of a coscrew. Performs a Coadjoint transformation of a coscrew, where CoAdjoint transformation matrix consists of a rotation and translation component. |
|
Performs the inverse single precision spatial transformation of a coscrew. Performs the inverse of a Coadjoint transformation of a coscrew, where the CoAdjoint transformation matrix consists of a rotation and translation component. |
|
Add the linear part of a coscrew to a coscrew: co = ci1 + {ci2.lin, 0}. |
|
Amplitude of a coscrew: the length of its force, or of its moment if it is a pure couple. |
|
Normalize a coscrew in place, to a unit coscrew. |
|
Pitch of a coscrew. |
|
Point of the line of action nearest the reference point of a coscrew. |
|
Cross product of a screw with the angular part of a coscrew: co = {0, s1i.ang x c2i.ang}. |
|
Compute the unit moment coscrew about the x axis of a frame: co = CoAd(Di) * {0, ex}. |
|
Compute the unit moment coscrew about the negative x axis of a frame: co = CoAd(Di) * {0, -ex}. |
|
Compute the unit moment coscrew about the y axis of a frame: co = CoAd(Di) * {0, ey}. |
|
Compute the unit moment coscrew about the negative y axis of a frame: co = CoAd(Di) * {0, -ey}. |
|
Compute the unit moment coscrew about the z axis of a frame: co = CoAd(Di) * {0, ez}. |
|
Compute the unit moment coscrew about the negative z axis of a frame: co = CoAd(Di) * {0, -ez}. |
|
Compute the unit force coscrew along the x axis of a frame: co = CoAd(Di) {ex, 0}. |
|
Compute the unit force coscrew along the negative x axis of a frame: co = CoAd(Di) * {-ex, 0}. |
|
Compute the unit force coscrew along the y axis of a frame: co = CoAd(Di) {ey, 0}. |
|
Compute the unit force coscrew along the negative y axis of a frame: co = CoAd(Di) * {-ey, 0}. |
|
Compute the unit force coscrew along the z axis of a frame: co = CoAd(Di) {ez, 0}. |
|
Compute the unit force coscrew along the negative z axis of a frame: co = CoAd(Di) * {-ez, 0}. |
|
Transform a negated coscrew by the coadjoint of an SE3 transformation: co = CoAd(Di) * (-ci). |
|
Rotate a negated coscrew: co = CoAd(ri) * (-ci) = {-ri * ci.lin, -ri * ci.ang}. |
|
Transform a coscrew by the coadjoint of an inverse translation: co = CoAd(T(ti)^-1) * ci. |
-
union ksl_coscrew_t¶
- #include <types.h>
double precision coscrew (i.e. a linear operator on a screw), consisting of a linear and angular vector pair in function space.
Public Members
-
double at[6]¶
- struct ksl_coscrew_t
anyonymous union allows accessing coscrew quantities at specified index
-
ksl_vec3_t lin¶
bound linear vector, e.g. force or linear momentum
-
ksl_vec3_t ang¶
free angular vector, e.g. moment/torque or angular momentum
- struct ksl_coscrew_t
anyonymous union allows accessing coscrew quantities by its linear and angular vector components
-
double m0¶
-
double m1¶
-
double m2¶
-
double m3¶
-
double m4¶
-
double m5¶
- struct ksl_coscrew_t
anonymous union allows accessing coscrew quantities by field name
-
double at[6]¶
-
static inline ksl_coscrew_t ksl_coscrew(const double m0, const double m1, const double m2, const double m3, const double m4, const double m5)¶
double precision screw constructor
-
ksl_coscrew_t *ksl_coscrew_alloc(int n)¶
Allocates n double precision coscrew quantities on the heap. Must be freed by the user.
-
static inline void ksl_coscrew_copy(const ksl_coscrew_t *ci, ksl_coscrew_t *co)¶
Copy double precision ksl_coscrew_t.
\(\mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
- Parameters:
ci – [in] screw to copy
co – [out] input screw is copied to co
-
static inline void ksl_coscrew_scale(ksl_coscrew_t *self, const double a)¶
Scale a double precision ksl_coscrew_t.
\(\mathbf{\underline{c}}_{i}^* * a \rightarrow \mathbf{\underline{c}}_i^*\)
- Parameters:
self – [in] coscrew to invert
a – [out] amount to scale the screw
-
static inline void ksl_coscrew_inverted(const ksl_coscrew_t *ci, ksl_coscrew_t *co)¶
Returns the inverse of a ksl_coscrew_t.
\(-\mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
- Parameters:
ci – [in] coscrew to invert
co – [out] inverse of ci
-
static inline void ksl_coscrew_invert(ksl_coscrew_t *self)¶
Invert (i.e. negate) a ksl_coscrew_t in place.
\(-\mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_i^*\)
- Parameters:
self – [in/out] coscrew to invert
-
static inline void ksl_axpy_cc(const double a, const ksl_coscrew_t *x, ksl_coscrew_t *y)¶
In-place add a double precision coscrew multiplied with a scalar to an existing coscrew.
\(a * \mathbf{\underline{c}}_{x}^* + \mathbf{\underline{c}}_y^* \rightarrow \mathbf{\underline{c}}_y^*\)
- Parameters:
a – [in]
x – [in]
y – [in/out] coscrew to add
-
static inline void ksl_xpy_cc(const ksl_coscrew_t *x, ksl_coscrew_t *y)¶
In-place add a double precision coscrew to an existing coscrew. This is a variant of axpy where the scalar term a is 1.
\( \mathbf{\underline{c}}_{x}^* + \mathbf{\underline{c}}_y^* \rightarrow \mathbf{\underline{c}}_y^*\)
- Parameters:
x – [in] coscrew to add
y – [in,out] coscrew that x is added to
-
static inline void ksl_nxpy_cc(const ksl_coscrew_t *x, ksl_coscrew_t *y)¶
In-place subtract a double precision coscrew x from an coscrew y. This is a variant of axpy where the scalar term is -1.
\( -\mathbf{\underline{c}}_{x}^* + \mathbf{\underline{c}}_y^* \rightarrow \mathbf{\underline{c}}_y^*\)
- Parameters:
x – [in] coscrew to subtract
y – [in,out] coscrew that x is subtracted from
-
static inline void ksl_product_ac(const double a, const ksl_coscrew_t *ci, ksl_coscrew_t *co)¶
Scale a double precision coscrew.
\( \mathbf{\underline{c}}_i^* * a \rightarrow \mathbf{\underline{c}}_o^*\)
- Parameters:
a – [in] scale factor
ci – [in] coscrew to scale
co – [out] scaled coscrew
-
static inline void ksl_add_cc(const ksl_coscrew_t *c1i, const ksl_coscrew_t *c2i, ksl_coscrew_t *co)¶
Compute the sum of two double precision coscrews.
\(\mathbf{\underline{c}}_{1i}^* + \mathbf{\underline{c}}_{2i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
- Parameters:
c1i – [in] first coscrew to add
c2i – [in] second coscrew to add
co – [out] sum of c1i and c2i
-
static inline void ksl_subtract_cc(const ksl_coscrew_t *c1i, const ksl_coscrew_t *c2i, ksl_coscrew_t *co)¶
Compute the difference between two double precision coscrews.
\(\mathbf{\underline{c}}_{1i}^* - \mathbf{\underline{c}}_{2i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
- Parameters:
c1i – [in] first coscrew
c2i – [in] second coscrew
co – [out] c1i minus c2i
-
static inline void ksl_cross_sc(const ksl_screw_t *s1i, const ksl_coscrew_t *c2i, ksl_coscrew_t *co)¶
Cross product of a screw and a coscrew: co = si x* ci = {w x f, w x n + v x f}.
This is the dual (force) cross product used to compute the rate of change of a coscrew, such as momentum, in a moving frame.
- Parameters:
s1i – [in] screw {v, w}
c2i – [in] coscrew {f, n}
co – [out] cross product
-
static inline void ksl_product_CoAdtc(const ksl_vec3_t *ti, const ksl_coscrew_t *ci, ksl_coscrew_t *co)¶
Performs a double precision spatial translation of a coscrew. Performs a Coadjoint transformation of a coscrew, where CoAdjoint transformation matrix consists of only a translation component.
\( [Ad]^*(\underline{t}_i) \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
\(\ \begin{bmatrix} I & 0\\ \underline{\tilde{t}}_i & I \end{bmatrix} \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
- Parameters:
ti – [in] translation vector
ci – [in] input coscrew
co – [out] output coscrew
-
static inline void ksl_product_CoAdtcinv(const ksl_vec3_t *ti, const ksl_coscrew_t *ci, ksl_coscrew_t *co)¶
Performs a double precision spatial translation of the inverse of a coscrew. Performs a Coadjoint transformation of the inverse of a coscrew, where CoAdjoint transformation matrix consists of only a translation component.
\( [Ad]^*(\underline{t}_i) * -\mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
\( -[Ad]^*(\underline{t}_i) \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
\(\ -\begin{bmatrix} I & 0\\ \underline{\tilde{t}}_i & I \end{bmatrix} \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
- Parameters:
ti – [in] translation vector
ci – [in] input coscrew
co – [out] output coscrew
-
static inline void ksl_product_CoAdrc(const ksl_mat3x3_t *Ri, const ksl_coscrew_t *ci, ksl_coscrew_t *co)¶
Performs a double precision spatial rotation of a coscrew. Performs a Coadjoint transformation of a coscrew, where CoAdjoint transformation matrix consists of only a rotation component.
\( [Ad]^*(R_i) \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
\(\ \begin{bmatrix} R_i & 0\\ 0 & R_i \end{bmatrix} \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
- Parameters:
Ri – [in] input rotation matrix
ci – [in] input coscrew
co – [out] output coscrew
-
static inline void ksl_product_CoAdrinvc(const ksl_mat3x3_t *Ri, const ksl_coscrew_t *ci, ksl_coscrew_t *co)¶
Performs a double precision spatial rotation of a coscrew, using the transpose of the input rotation matrix. Performs a Coadjoint transformation of a coscrew, where CoAdjoint transformation matrix consists of only a rotation component transposed.
\( [Ad]^*(R_i^T) \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
\( \left([Ad]^*(R_i) \right)^{-1} \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
\(\ \begin{bmatrix} R_i^T & 0\\ 0 & R_i^T \end{bmatrix} \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
- Parameters:
Ri – [in] input rotation matrix
ci – [in] input coscrew
co – [out] output coscrew
-
static inline void ksl_product_CoAdc(const ksl_SE3_t *Di, const ksl_coscrew_t *ci, ksl_coscrew_t *co)¶
Performs a double precision spatial transformation of a coscrew. Performs a Coadjoint transformation of a coscrew, where CoAdjoint transformation matrix consists of a rotation and translation component.
\( [Ad]^*(\Phi_{Di}) \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
\( [Ad]^*(R_i, \underline{t}_i) \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
\(\ \begin{bmatrix} R_i & 0\\ \tilde{\underline{t}}_i R_i & R_i \end{bmatrix} \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
- Parameters:
Di – [in] SE3 transformation
ci – [in] input coscrew
co – [out] output coscrew
-
static inline void ksl_product_CoAdinvc(const ksl_SE3_t *Di, const ksl_coscrew_t *ci, ksl_coscrew_t *co)¶
Performs the inverse single precision spatial transformation of a coscrew. Performs the inverse of a Coadjoint transformation of a coscrew, where the CoAdjoint transformation matrix consists of a rotation and translation component.
\( [Ad]^*(\Phi_{Di}^{-1}) \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
\( \left( [Ad]^*(\Phi_{Di}) \right)^{-1} \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
\( [Ad]^*(R_i^T, -\underline{t}_i) \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
\(\ \begin{bmatrix} R_i^T & 0\\ -\tilde{\underline{t}}_i R_i^T & R_i^T \end{bmatrix} \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
- Parameters:
Di – [in] input SE3 matrix
ci – [in] input coscrew
co – [out] output coscrew
-
static inline void ksl_add_cct(const ksl_coscrew_t *ci1, const ksl_coscrew_t *ci2, ksl_coscrew_t *co)¶
Add the linear part of a coscrew to a coscrew: co = ci1 + {ci2.lin, 0}.
- Parameters:
ci1 – [in] coscrew
ci2 – [in] coscrew whose linear part is added; its angular part is ignored
co – [out] sum
-
static inline double ksl_coscrew_norm(const ksl_coscrew_t *v)¶
Amplitude of a coscrew: the length of its force, or of its moment if it is a pure couple.
The dual of ksl_screw_norm(). A coscrew (wrench) \(\{\underline{f}, \underline{n}\}\) (force first) is the product of a unit coscrew and an amplitude (Hunt, 1978; Davidson and Hunt, 2004; see the References); the length of all six components is not used, since force and moment have different units. Instead,
if \(\underline{f} \neq 0\), the amplitude is \(\lVert\underline{f}\rVert\), the force along the line of action;
if \(\underline{f} = 0\) (a pure couple, infinite pitch), it is \(\lVert\underline{n}\rVert\).
The force is taken as zero when its length is at most \(10^{-12}\) times that of the moment in double precision, or \(10^{-5}\) times in single precision. Because the test compares the two parts with each other rather than with a fixed number, coscrews of any size are classified the same way. A zero coscrew has amplitude zero.
- Parameters:
v – [in] coscrew
- Returns:
amplitude of v
-
static inline void ksl_coscrew_normalize(ksl_coscrew_t *v)¶
Normalize a coscrew in place, to a unit coscrew.
Divides the coscrew by its amplitude, ksl_coscrew_norm(). If the force is not zero, the result has a unit force along the line of action, and the line of action and pitch are unchanged. A pure couple becomes \(\{\underline{0}, \underline{n} / \lVert\underline{n}\rVert\}\). A zero coscrew is left unchanged.
- Parameters:
v – [in,out] coscrew
-
static inline double ksl_coscrew_pitch(const ksl_coscrew_t *c)¶
Pitch of a coscrew.
The dual of ksl_screw_pitch(). For a coscrew (wrench) \(\{\underline{f}, \underline{n}\}\) (force first),
\[ h = \frac{\underline{f}^{T}\underline{n}}{\underline{f}^{T}\underline{f}}, \]the moment about the line of action per unit force along it. The pitch does not depend on the reference point or the coordinate system of the coscrew, nor on its amplitude. A pure couple ( \(\underline{f} = 0\), classified as in ksl_coscrew_norm()) has infinite pitch, and INFINITY is returned; a zero coscrew has pitch 0.
- Parameters:
c – [in] coscrew
- Returns:
pitch of c
-
static inline int ksl_coscrew_axisPoint(const ksl_coscrew_t *c, ksl_vec3_t *r)¶
Point of the line of action nearest the reference point of a coscrew.
The dual of ksl_screw_axisPoint(). A coscrew \(\{\underline{f}, \underline{n}\}\) at a reference point has moment \(\underline{n} = \tilde{r}\underline{f} + h\underline{f}\), where \(\underline{r}\) locates a point of its line of action (the central axis of Poinsot) relative to the reference point and \(h\) is the pitch, ksl_coscrew_pitch(). The point of the line nearest the reference point is
\[ \underline{r} = \frac{\tilde{f}\underline{n}}{\underline{f}^{T}\underline{f}}, \]in the coordinates of the coscrew. A pure couple or a zero coscrew has no line of action (classified as in ksl_coscrew_norm()); then r is not set and 1 is returned.
- Parameters:
c – [in] coscrew
r – [out] point of the line of action nearest the reference point, relative to it
- Returns:
0, or 1 if c has no line of action
-
static inline void ksl_cross_sca(const ksl_screw_t *s1i, const ksl_coscrew_t *c2i, ksl_coscrew_t *co)¶
Cross product of a screw with the angular part of a coscrew: co = {0, s1i.ang x c2i.ang}.
- Parameters:
s1i – [in] screw
c2i – [in] coscrew whose angular part is used; its linear part is ignored
co – [out] cross product
-
static inline void ksl_hcrx(const ksl_SE3_t *Di, ksl_coscrew_t *co)¶
Compute the unit moment coscrew about the x axis of a frame: co = CoAd(Di) * {0, ex}.
- Parameters:
Di – [in] pose of the frame
co – [out] {0, rx}, where rx is the x column of the rotation
-
static inline void ksl_hcrxinv(const ksl_SE3_t *Di, ksl_coscrew_t *co)¶
Compute the unit moment coscrew about the negative x axis of a frame: co = CoAd(Di) * {0, -ex}.
- Parameters:
Di – [in] pose of the frame
co – [out] {0, -rx}, where rx is the x column of the rotation
-
static inline void ksl_hcry(const ksl_SE3_t *Di, ksl_coscrew_t *co)¶
Compute the unit moment coscrew about the y axis of a frame: co = CoAd(Di) * {0, ey}.
- Parameters:
Di – [in] pose of the frame
co – [out] {0, ry}, where ry is the y column of the rotation
-
static inline void ksl_hcryinv(const ksl_SE3_t *Di, ksl_coscrew_t *co)¶
Compute the unit moment coscrew about the negative y axis of a frame: co = CoAd(Di) * {0, -ey}.
- Parameters:
Di – [in] pose of the frame
co – [out] {0, -ry}, where ry is the y column of the rotation
-
static inline void ksl_hcrz(const ksl_SE3_t *Di, ksl_coscrew_t *co)¶
Compute the unit moment coscrew about the z axis of a frame: co = CoAd(Di) * {0, ez}.
- Parameters:
Di – [in] pose of the frame
co – [out] {0, rz}, where rz is the z column of the rotation
-
static inline void ksl_hcrzinv(const ksl_SE3_t *Di, ksl_coscrew_t *co)¶
Compute the unit moment coscrew about the negative z axis of a frame: co = CoAd(Di) * {0, -ez}.
- Parameters:
Di – [in] pose of the frame
co – [out] {0, -rz}, where rz is the z column of the rotation
-
static inline void ksl_hctx(const ksl_SE3_t *Di, ksl_coscrew_t *co)¶
Compute the unit force coscrew along the x axis of a frame: co = CoAd(Di) {ex, 0}.
This is the constraint force direction of a joint that resists translation along the axis.
- Parameters:
Di – [in] pose of the frame
co – [out] {rx, t x rx}, where rx is the x column of the rotation
-
static inline void ksl_hctxinv(const ksl_SE3_t *Di, ksl_coscrew_t *co)¶
Compute the unit force coscrew along the negative x axis of a frame: co = CoAd(Di) * {-ex, 0}.
- Parameters:
Di – [in] pose of the frame
co – [out] {-rx, -t x rx}, where rx is the x column of the rotation
-
static inline void ksl_hcty(const ksl_SE3_t *Di, ksl_coscrew_t *co)¶
Compute the unit force coscrew along the y axis of a frame: co = CoAd(Di) {ey, 0}.
This is the constraint force direction of a joint that resists translation along the axis.
- Parameters:
Di – [in] pose of the frame
co – [out] {ry, t x ry}, where ry is the y column of the rotation
-
static inline void ksl_hctyinv(const ksl_SE3_t *Di, ksl_coscrew_t *co)¶
Compute the unit force coscrew along the negative y axis of a frame: co = CoAd(Di) * {-ey, 0}.
- Parameters:
Di – [in] pose of the frame
co – [out] {-ry, -t x ry}, where ry is the y column of the rotation
-
static inline void ksl_hctz(const ksl_SE3_t *Di, ksl_coscrew_t *co)¶
Compute the unit force coscrew along the z axis of a frame: co = CoAd(Di) {ez, 0}.
This is the constraint force direction of a joint that resists translation along the axis.
- Parameters:
Di – [in] pose of the frame
co – [out] {rz, t x rz}, where rz is the z column of the rotation
-
static inline void ksl_hctzinv(const ksl_SE3_t *Di, ksl_coscrew_t *co)¶
Compute the unit force coscrew along the negative z axis of a frame: co = CoAd(Di) * {-ez, 0}.
- Parameters:
Di – [in] pose of the frame
co – [out] {-rz, -t x rz}, where rz is the z column of the rotation
-
static inline void ksl_product_CoAdcinv(const ksl_SE3_t *Di, const ksl_coscrew_t *ci, ksl_coscrew_t *co)¶
Transform a negated coscrew by the coadjoint of an SE3 transformation: co = CoAd(Di) * (-ci).
- Parameters:
Di – [in] SE3 transformation
ci – [in] coscrew
co – [out] transformed, negated coscrew
-
static inline void ksl_product_CoAdrcinv(const ksl_mat3x3_t *ri, const ksl_coscrew_t *ci, ksl_coscrew_t *co)¶
Rotate a negated coscrew: co = CoAd(ri) * (-ci) = {-ri * ci.lin, -ri * ci.ang}.
- Parameters:
ri – [in] rotation matrix
ci – [in] coscrew
co – [out] rotated, negated coscrew
-
static inline void ksl_product_CoAdtinvc(const ksl_vec3_t *ti, const ksl_coscrew_t *ci, ksl_coscrew_t *co)¶
Transform a coscrew by the coadjoint of an inverse translation: co = CoAd(T(ti)^-1) * ci.
Transforms the coordinates of a force coscrew so its moment is expressed about the point ti instead of the origin.
- Parameters:
ti – [in] translation
ci – [in] coscrew
co – [out] {ci.lin, ci.ang - ti x ci.lin}
Single precision¶
single precision coscrew (i.e. a linear operator on a screw), consisting of a linear and angular vector pair in function space. |
|
single precision screwf constructor |
|
Allocate n single precision coscrew quantities on the heap. Must be freed by the user. |
|
Copy single precision ksl_coscrewf_t ci to co. |
|
Scale a single precision ksl_coscrew_t. |
|
Returns the inverse of a ksl_coscrewf_t. |
|
Invert (i.e. negate) a ksl_coscrewf_t in place. |
|
In-place add a single precision coscrew multiplied with a scalar to an existing coscrew. |
|
In-place add a single precision coscrew to an existing coscrew. This is a variant of axpy where there the scalar term is 1. |
|
In-place subtract a single precision coscrew from an existing coscrew. This is a variant of axpy where the scalar term is -1. |
|
Scale a single precision coscrew. |
|
Compute the sum of two single precision coscrews. |
|
Compute the difference between two double precision coscrews. |
|
Single precision version of ksl_cross_sc(). |
|
Performs a single precision spatial translation of a coscrew. Performs a Coadjoint transformation of a coscrew, where CoAdjoint transformation matrix consists of only a translation component. |
|
Performs a single precision spatial translation of the inverse of a coscrew. Performs a Coadjoint transformation of the inverse of a coscrew, where CoAdjoint transformation matrix consists of only a translation component. |
|
Performs a single precision spatial rotation of a coscrew. Performs a Coadjoint transformation of a coscrew, where CoAdjoint transformation matrix consists of only a rotation component. |
|
Performs a single precision spatial rotation of a coscrew, using the transpose of the input rotation matrix. Performs a Coadjoint transformation of a coscrew, where CoAdjoint transformation matrix consists of only a rotation component transposed. |
|
Performs a single precision spatial transformation of a coscrew. Performs a Coadjoint transformation of a coscrew, where CoAdjoint transformation matrix consists of a rotation and translation component. |
|
Performs the inverse single precision spatial transformation of a coscrew. Performs the inverse of a Coadjoint transformation of a coscrew, where the CoAdjoint transformation matrix consists of a rotation and translation component. |
|
Single precision version of ksl_add_cct(). |
|
Single precision version of ksl_coscrew_norm(). |
|
Single precision version of ksl_coscrew_normalize(). |
|
Single precision version of ksl_coscrew_pitch(). |
|
Single precision version of ksl_coscrew_axisPoint(). |
|
Single precision version of ksl_cross_sca(). |
|
Single precision version of ksl_hcrx(). |
|
Single precision version of ksl_hcrxinv(). |
|
Single precision version of ksl_hcry(). |
|
Single precision version of ksl_hcryinv(). |
|
Single precision version of ksl_hcrz(). |
|
Single precision version of ksl_hcrzinv(). |
|
Single precision version of ksl_hctx(). |
|
Single precision version of ksl_hctxinv(). |
|
Single precision version of ksl_hcty(). |
|
Single precision version of ksl_hctyinv(). |
|
Single precision version of ksl_hctz(). |
|
Single precision version of ksl_hctzinv(). |
|
Single precision version of ksl_product_CoAdcinv(). |
|
Single precision version of ksl_product_CoAdrcinv(). |
|
Single precision version of ksl_product_CoAdtinvc(). |
-
union ksl_coscrewf_t¶
- #include <types.h>
single precision coscrew (i.e. a linear operator on a screw), consisting of a linear and angular vector pair in function space.
Public Members
-
float at[6]¶
- struct ksl_coscrewf_t
anonymous union allows accessing coscrew quantities at specified index
-
ksl_vec3f_t lin¶
bound linear vector, e.g. force or linear momentum
-
ksl_vec3f_t ang¶
free angular vector, e.g. moment/torque or angular momentum
- struct ksl_coscrewf_t
anyonymous union allows accessing coscrew quantities by its linear and angular vector components
-
float m0¶
-
float m1¶
-
float m2¶
-
float m3¶
-
float m4¶
-
float m5¶
- struct ksl_coscrewf_t
anonymous union allows accessing coscrew quantities by field name
-
float at[6]¶
-
static inline ksl_coscrewf_t ksl_coscrewf(const float m0, const float m1, const float m2, const float m3, const float m4, const float m5)¶
single precision screwf constructor
-
ksl_coscrewf_t *ksl_coscrewf_alloc(int n)¶
Allocate n single precision coscrew quantities on the heap. Must be freed by the user.
-
static inline void ksl_coscrewf_copy(const ksl_coscrewf_t *self, ksl_coscrewf_t *co)¶
Copy single precision ksl_coscrewf_t ci to co.
\(\mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
- Parameters:
self – [in] screw to copy
co – [out] ci is copied to co
-
static inline void ksl_coscrewf_scale(ksl_coscrewf_t *self, const float a)¶
Scale a single precision ksl_coscrew_t.
\(\mathbf{\underline{c}}_{i}^* * a \rightarrow \mathbf{\underline{c}}_i^*\)
- Parameters:
self – [in] coscrew to invert
a – [out] inverse of ci
-
static inline void ksl_coscrewf_inverted(const ksl_coscrewf_t *self, ksl_coscrewf_t *co)¶
Returns the inverse of a ksl_coscrewf_t.
\(-\mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
- Parameters:
self – [in] coscrew to invert
co – [out] inverse of ci
-
static inline void ksl_coscrewf_invert(ksl_coscrewf_t *self)¶
Invert (i.e. negate) a ksl_coscrewf_t in place.
\(-\mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_i^*\)
- Parameters:
self – [in/out] coscrew to invert
-
static inline void ksl_axpy_ccf(const float a, const ksl_coscrewf_t *x, ksl_coscrewf_t *y)¶
In-place add a single precision coscrew multiplied with a scalar to an existing coscrew.
\(a * \mathbf{\underline{c}}_{x}^* + \mathbf{\underline{c}}_y^* \rightarrow \mathbf{\underline{c}}_y^*\)
- Parameters:
a – [in]
x – [in]
y – [in/out]
-
static inline void ksl_xpy_ccf(const ksl_coscrewf_t *x, ksl_coscrewf_t *y)¶
In-place add a single precision coscrew to an existing coscrew. This is a variant of axpy where there the scalar term is 1.
\( \mathbf{\underline{c}}_{x}^* + \mathbf{\underline{c}}_y^* \rightarrow \mathbf{\underline{c}}_y^*\)
- Parameters:
x – [in] coscrew to add
y – [in,out] coscrew that x is added to
-
static inline void ksl_nxpy_ccf(const ksl_coscrewf_t *x, ksl_coscrewf_t *y)¶
In-place subtract a single precision coscrew from an existing coscrew. This is a variant of axpy where the scalar term is -1.
\( -\mathbf{\underline{c}}_{x}^* + \mathbf{\underline{c}}_y^* \rightarrow \mathbf{\underline{c}}_y^*\)
- Parameters:
x – [in] coscrew to subtract
y – [in,out] coscrew that x is subtracted from
-
static inline void ksl_product_acf(const float a, const ksl_coscrewf_t *ci, ksl_coscrewf_t *co)¶
Scale a single precision coscrew.
\( \mathbf{\underline{c}}_i^* * a \rightarrow \mathbf{\underline{c}}_o^*\)
- Parameters:
a – [in] scale factor
ci – [in] coscrew to scale
co – [out] scaled coscrew
-
static inline void ksl_add_ccf(const ksl_coscrewf_t *c1i, const ksl_coscrewf_t *c2i, ksl_coscrewf_t *co)¶
Compute the sum of two single precision coscrews.
\(\mathbf{\underline{c}}_{1i}^* + \mathbf{\underline{c}}_{2i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
- Parameters:
c1i – [in] first coscrew to add
c2i – [in] second coscrew to add
co – [out] sum of c1i and c2i
-
static inline void ksl_subtract_ccf(const ksl_coscrewf_t *c1i, const ksl_coscrewf_t *c2i, ksl_coscrewf_t *co)¶
Compute the difference between two double precision coscrews.
\(\mathbf{\underline{c}}_{1i}^* - \mathbf{\underline{c}}_{2i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
- Parameters:
c1i – [in] first coscrew
c2i – [in] second coscrew
co – [out] result of c1i minus c2i
-
static inline void ksl_cross_scf(const ksl_screwf_t *s1i, const ksl_coscrewf_t *c2i, ksl_coscrewf_t *co)¶
Single precision version of ksl_cross_sc().
-
static inline void ksl_product_CoAdtcf(const ksl_vec3f_t *ti, const ksl_coscrewf_t *ci, ksl_coscrewf_t *co)¶
Performs a single precision spatial translation of a coscrew. Performs a Coadjoint transformation of a coscrew, where CoAdjoint transformation matrix consists of only a translation component.
\( [Ad]^*(\underline{t}_i) \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
\(\ \begin{bmatrix} I & 0\\ \underline{\tilde{t}}_i & I \end{bmatrix} \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
- Parameters:
ti – [in] translation vector
ci – [in] input coscrew
co – [out] output coscrew
-
static inline void ksl_product_CoAdtcinvf(const ksl_vec3f_t *ti, const ksl_coscrewf_t *ci, ksl_coscrewf_t *co)¶
Performs a single precision spatial translation of the inverse of a coscrew. Performs a Coadjoint transformation of the inverse of a coscrew, where CoAdjoint transformation matrix consists of only a translation component.
\( [Ad]^*(\underline{t}_i) * -\mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
\( -[Ad]^*(\underline{t}_i) \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
\(\ -\begin{bmatrix} I & 0\\ \underline{\tilde{t}}_i & I \end{bmatrix} \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
- Parameters:
ti – [in] translation vector
ci – [in] input coscrew
co – [out] output coscrew
-
static inline void ksl_product_CoAdrcf(const ksl_mat3x3f_t *Ri, const ksl_coscrewf_t *ci, ksl_coscrewf_t *co)¶
Performs a single precision spatial rotation of a coscrew. Performs a Coadjoint transformation of a coscrew, where CoAdjoint transformation matrix consists of only a rotation component.
\( [Ad]^*(R_i) \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
\(\ \begin{bmatrix} R_i & 0\\ 0 & R_i \end{bmatrix} \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
- Parameters:
Ri – [in] input rotation matrix
ci – [in] input coscrew
co – [out] output coscrew
-
static inline void ksl_product_CoAdrinvcf(const ksl_mat3x3f_t *Ri, const ksl_coscrewf_t *ci, ksl_coscrewf_t *co)¶
Performs a single precision spatial rotation of a coscrew, using the transpose of the input rotation matrix. Performs a Coadjoint transformation of a coscrew, where CoAdjoint transformation matrix consists of only a rotation component transposed.
\( [Ad]^*(R_i^T) \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
\( \left([Ad]^*(R_i) \right)^{-1} \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
\(\ \begin{bmatrix} R_i^T & 0\\ 0 & R_i^T \end{bmatrix} \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
- Parameters:
Ri – [in] input rotation matrix
ci – [in] input coscrew
co – [out] output coscrew
-
static inline void ksl_product_CoAdcf(const ksl_SE3f_t *Di, const ksl_coscrewf_t *ci, ksl_coscrewf_t *co)¶
Performs a single precision spatial transformation of a coscrew. Performs a Coadjoint transformation of a coscrew, where CoAdjoint transformation matrix consists of a rotation and translation component.
\( [Ad]^*(\Phi_{Di}) \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
\( [Ad]^*(R_i, \underline{t}_i) \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
\(\ \begin{bmatrix} R_i & 0\\ \tilde{\underline{t}}_i R_i & R_i \end{bmatrix} \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
- Parameters:
Di – [in] input SE3 matrix
ci – [in] input coscrew
co – [out] output coscrew
-
static inline void ksl_product_CoAdinvcf(const ksl_SE3f_t *Di, const ksl_coscrewf_t *ci, ksl_coscrewf_t *co)¶
Performs the inverse single precision spatial transformation of a coscrew. Performs the inverse of a Coadjoint transformation of a coscrew, where the CoAdjoint transformation matrix consists of a rotation and translation component.
\( [Ad]^*(\Phi_{Di}^{-1}) \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
\( \left( [Ad]^*(\Phi_{Di}) \right)^{-1} \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
\( [Ad]^*(R_i^T, -\underline{t}_i) \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
\(\ \begin{bmatrix} R_i^T & 0\\ -\tilde{\underline{t}}_i R_i^T & R_i^T \end{bmatrix} \mathbf{\underline{c}}_{i}^* \rightarrow \mathbf{\underline{c}}_o^*\)
- Parameters:
Di – [in] input SE3 matrix
ci – [in] input coscrew
co – [out] output coscrew
-
static inline void ksl_add_cctf(const ksl_coscrewf_t *ci1, const ksl_coscrewf_t *ci2, ksl_coscrewf_t *co)¶
Single precision version of ksl_add_cct().
-
static inline float ksl_coscrewf_norm(const ksl_coscrewf_t *v)¶
Single precision version of ksl_coscrew_norm().
-
static inline void ksl_coscrewf_normalize(ksl_coscrewf_t *v)¶
Single precision version of ksl_coscrew_normalize().
-
static inline float ksl_coscrewf_pitch(const ksl_coscrewf_t *c)¶
Single precision version of ksl_coscrew_pitch().
-
static inline int ksl_coscrewf_axisPoint(const ksl_coscrewf_t *c, ksl_vec3f_t *r)¶
Single precision version of ksl_coscrew_axisPoint().
-
static inline void ksl_cross_scaf(const ksl_screwf_t *s1i, const ksl_coscrewf_t *c2i, ksl_coscrewf_t *co)¶
Single precision version of ksl_cross_sca().
-
static inline void ksl_hcrxf(const ksl_SE3f_t *Di, ksl_coscrewf_t *co)¶
Single precision version of ksl_hcrx().
-
static inline void ksl_hcrxinvf(const ksl_SE3f_t *Di, ksl_coscrewf_t *co)¶
Single precision version of ksl_hcrxinv().
-
static inline void ksl_hcryf(const ksl_SE3f_t *Di, ksl_coscrewf_t *co)¶
Single precision version of ksl_hcry().
-
static inline void ksl_hcryinvf(const ksl_SE3f_t *Di, ksl_coscrewf_t *co)¶
Single precision version of ksl_hcryinv().
-
static inline void ksl_hcrzf(const ksl_SE3f_t *Di, ksl_coscrewf_t *co)¶
Single precision version of ksl_hcrz().
-
static inline void ksl_hcrzinvf(const ksl_SE3f_t *Di, ksl_coscrewf_t *co)¶
Single precision version of ksl_hcrzinv().
-
static inline void ksl_hctxf(const ksl_SE3f_t *Di, ksl_coscrewf_t *co)¶
Single precision version of ksl_hctx().
-
static inline void ksl_hctxinvf(const ksl_SE3f_t *Di, ksl_coscrewf_t *co)¶
Single precision version of ksl_hctxinv().
-
static inline void ksl_hctyf(const ksl_SE3f_t *Di, ksl_coscrewf_t *co)¶
Single precision version of ksl_hcty().
-
static inline void ksl_hctyinvf(const ksl_SE3f_t *Di, ksl_coscrewf_t *co)¶
Single precision version of ksl_hctyinv().
-
static inline void ksl_hctzf(const ksl_SE3f_t *Di, ksl_coscrewf_t *co)¶
Single precision version of ksl_hctz().
-
static inline void ksl_hctzinvf(const ksl_SE3f_t *Di, ksl_coscrewf_t *co)¶
Single precision version of ksl_hctzinv().
-
static inline void ksl_product_CoAdcinvf(const ksl_SE3f_t *Di, const ksl_coscrewf_t *ci, ksl_coscrewf_t *co)¶
Single precision version of ksl_product_CoAdcinv().
-
static inline void ksl_product_CoAdrcinvf(const ksl_mat3x3f_t *ri, const ksl_coscrewf_t *ci, ksl_coscrewf_t *co)¶
Single precision version of ksl_product_CoAdrcinv().
-
static inline void ksl_product_CoAdtinvcf(const ksl_vec3f_t *ti, const ksl_coscrewf_t *ci, ksl_coscrewf_t *co)¶
Single precision version of ksl_product_CoAdtinvc().