Algorithmcore
Exponential map of SE(3)
Also called exponential coordinates of rigid motion.
Turns a screw axis S and a distance theta into the rigid motion exp([S] theta) in closed form: Rodrigues' formula for the rotation and a matrix G(theta) for the translation.
- Time
- Θ(1) worst
- Space
- Θ(1) extra
- Where
- n = the size of the matrix, fixed at n = 4
- Model
- Real RAM
- Properties
- deterministicofflineiterative
- Evidence
- Proof sketchCode in 1 languages
- Origin
- Roger W. Brockett, 1984
The exponential map of SE(3) takes a twist, a 6-vector that describes a velocity of a rigid body, and returns the rigid motion that the body makes when it keeps this velocity for one unit of time. The result is a 4 by 4 homogeneous transformation matrix in the special Euclidean group SE(3). It is the matrix exponential of a matrix of a special form, and that form gives a closed formula with one sine and one cosine, with no series and no general matrix routine. The rotation part is Rodrigues' formula; the translation part needs one more matrix, . Geometrically, every result is a screw motion: a rotation about a fixed line and a translation along the same line. The map is the building block of the product of exponentials formula for robot arms.
In plain words
Think of a nut on a bolt. When you turn the nut, it turns about the axis of the bolt, and it also moves along the axis. The bolt axis, the amount of travel per turn, and the angle of the turn together fix where the nut ends up. A twist holds the same three things as six numbers. The exponential map takes these six numbers and gives the final position and orientation of the body, as a table of numbers that a computer can multiply. When there is no turn, the body slides along a straight line, and the map is a plain shift. When the angle is very small, the general formula would divide small numbers by small numbers, so a short series is used.
The problem
We use the conventions of Lynch and Park. A twist is , with the angular part first, and its matrix is
where is the skew-symmetric matrix of . A screw axis is a twist with , or with and . A rigid-body twist is a screw axis times a speed, so we can write it as .
Problem 1: given a screw axis and a number , compute . For a revolute motion, is an angle in radians; for a prismatic motion (), it is a distance in meters.
Problem 2: given any vector of exponential coordinates , compute . If , then with and .
The inverse problem, the logarithm, is: given , find with .
The algorithm
EXP-SCREW solves Problem 1. EXP-COORDS solves Problem 2 and calls EXP-SCREW, unless the angle is below the threshold .
EXP-SCREW(S, θ) ▷ S = (ω, v) a screw axis- 1
(ω, v) ← S - 2
if ω = 0 then ▷ prismatic: |v| = 1 - 3
return [[I, v θ], [0, 1]] ▷ a translation by v θ - 4
K ← [ω] - 5
R ← I + sin θ · K + (1 - cos θ) · K² ▷ Rodrigues' formula - 6
G ← I θ + (1 - cos θ) · K + (θ - sin θ) · K² - 7
p ← G v - 8
return [[R, p], [0, 1]]
EXP-COORDS(ξ) ▷ ξ = (w, u), any 6-vectorE1 (w, u) ← ξE2 θ ← |w|E3 if θ ≥ δ thenE4 return EXP-SCREW(ξ / θ, θ)E5 a ← 1 - θ²/6 + θ⁴/120 ; b ← 1/2 - θ²/24 + θ⁴/720 ; c ← 1/6 - θ²/120 + θ⁴/5040E6 K ← [w]E7 return [[I + a K + b K², (I + b K + c K²) u], [0, 1]]
Line L3 is the case of a pure translation. Lines L5 and L6 come from the power series of , as the correctness section shows. In EXP-COORDS, , and are the Taylor polynomials of , and . With these factors the result is the same matrix as in EXP-SCREW, but nothing is divided by , so is no special case.
The logarithm reverses the steps. First take with the logarithm map of SO(3), and . Then with , and for small . This matrix is the inverse of the matrix in line E7. In the form of Lynch and Park, with a unit , , and . If , then and the motion is a translation: and .
Example
Take the screw axis with and , and .
- Line L4: , and .
- Line L5: with and , .
- Line L6: .
- Line L7: , , and . So .
So turns the body by 90 degrees about the vertical and moves its origin to m. The geometry explains this. A screw axis with a unit and pitch through the point is . Here , and for . So the motion is a pure rotation by 90 degrees about the vertical line through . That rotation takes the origin, which is 1 m from the line in the direction, to the point 1 m from the line in the direction, which is .
With a pitch of m/rad about the same line, , and , the implementation gives and . The origin turns half way around the line to and rises by .
A prismatic axis with m gives the translation and .
The logarithm of the first returns , the input.
Correctness
By induction, for . So the power series of has the upper left block and the upper right block . If , only the term is left, which gives line L3. If , then , so the powers of repeat with a sign. Collecting the odd and the even powers gives the series of and in the rotation block, which is line L5. It gives the series of and in , which is line L6. For EXP-COORDS, the three series alternate with decreasing terms when , so the truncation errors of line E5 are below , which is below for . The proof below gives all steps, and also proves that the matrix of the logarithm is the inverse of .
Proof: EXP-SCREW and EXP-COORDS compute the exponential of a twistfull
We use the notation of the page. For with , the matrix of is
where is the skew-symmetric matrix of . The exponential of a square matrix is the series , which converges absolutely for every (see the page on the matrix exponential). The proof is in exact arithmetic, in the real RAM.
Powers of a twist matrix
Lemma 1. For every ,
Proof. For this is the definition, with . If it holds for , then
Lemma 2. If , then . So for , and .
Proof. For every , , because . So , and , because . The other two formulas follow by induction on .
The closed form
Theorem 1. Let and .
(a) If , then
(b) If , then
Proof. By Lemma 1,
Both series converge absolutely, so we may split and regroup them.
Case (b). If , then and for . The upper left block is , and only the term of the second series is left, which gives .
Case (a). The upper left block is by Rodrigues' formula; we repeat the short proof. Split the series of into the term , the odd terms and the even terms with , and use Lemma 2:
For the second series, write . The term is . The terms with odd give . The terms with even and at least 2 give . So .
EXP-SCREW
Corollary 2. If is a screw axis, that is , or and , then EXP-SCREW returns .
Proof. Line L1 splits . If , line L3 returns the matrix of Theorem 1(b). Else , lines L4 to L7 compute , and of Theorem 1(a), and line L8 returns the matrix of Theorem 1(a). The implementation checks the hypothesis on with a tolerance of and raises an error if it fails.
The result is in SE(3). is a rotation, because , for the trace-free , and .
EXP-COORDS
Theorem 3. For every , let . If or , EXP-COORDS returns . If , it returns with each of the three scalar factors changed by a relative amount below .
Proof. If , let . Then has a unit angular part, so it is a screw axis, and . Line E4 returns by Corollary 2.
If , put when . Theorem 1(a) with and gives
Indeed, , , and . The same formula also holds for , where and the result is the translation by , as in Theorem 1(b). Line E5 replaces , and by their Taylor polynomials of degree 4 in . The three series alternate, and their terms decrease in size for , so the error of each truncation is below the first omitted term: , and . For these are below , and relative to , and they are below . Lines E6 and E7 then compute the matrix above.
The inverse map
Theorem 4. Let with , and let be a vector with and , for example the output of the SO(3) logarithm, which has . Then the unique with is , where for , and for .
Proof. By the proof of Theorem 3, the translation part of is with and . We show that is the inverse of . If , then and . Else write with the unit vector . Both and are polynomials in . maps the line of to 0 and maps the plane orthogonal to to itself, so we can check on the line and on the plane separately. On the line of , , so . On the orthogonal plane, acts as , where is the rotation by about , with . Identify this plane with the complex numbers, so that is multiplication by . Then acts as the number . And acts as , with . Now , so . And . So , and on the plane. Hence , for , where .
So has the unique solution . The rotation part of is , so .
At the rotation logarithm has two values , and each of them gives one by Theorem 4. For near 0, the implementation uses the series , the start of the Taylor series of .
Complexity
The input has a fixed size, so the time and the space are in the real RAM. EXP-SCREW computes one sine and one cosine, one product (27 multiplications), two combinations of , and , and one product . That is fewer than 150 floating-point operations. The cost does not depend on .
The product of exponentials formula for an arm with joints calls the map times and multiplies matrices of size , so forward kinematics costs operations.
Properties
- One parameter subgroups. , because and commute.
- Derivative. . So a body that moves along has the twist , the same in the fixed frame and in the moving frame.
- Surjective. Every is for some ; the logarithm above constructs one. This is the algebraic form of Chasles' theorem.
- Not injective. Adding to the angle of a revolute screw gives the same , and at a rotation angle of there are two logarithms.
- Change of frame. , where is the adjoint map.
- Not a group morphism. In general , because the two matrices do not commute.
Variants and improvements
- Two separate exponentials. Some code computes and takes as the translation. That is a different map, the exponential of SO(3) times the translations, and it does not follow a screw motion. It is used in some filters; the two maps agree to first order only.
- Dual quaternions. A dual quaternion stores the same rigid motion in 8 numbers, and its exponential is the same screw motion.
- The plane. In SE(2), with , the translation is with .
- Jacobians. Optimization on SE(3) needs the derivative of the exponential with respect to , the left or right Jacobian. Sola, Deray and Atchuthan give the closed forms; see uncertainty on Lie groups.
When to use it
Use the exponential map to compute the forward kinematics of an arm with the product of exponentials formula, to integrate a constant twist over a time step exactly, and to apply a small correction to a pose in pose graph optimization or a filter on SE(3), with . Use the logarithm to measure the error between two poses as a 6-vector. If you only need the composition of known poses, multiply the matrices directly with the pose compounding operators.
Pitfalls
- The order of the twist. Lynch and Park put the angular part first; Murray, Li and Sastry put the linear part first. A mix of the two gives wrong results without a warning.
- v is not the velocity of the body origin. In the twist in the fixed frame, is the velocity of the body point that is at the origin of the fixed frame. For a rotation about a line through , , not 0.
- A screw that is not normalized. EXP-SCREW needs . If you pass a twist with , use EXP-COORDS, which normalizes.
- Small angles. The closed form loses digits to cancellation when is small; use the series below a threshold. The tests of the implementation check that the two branches agree to at the threshold (a measurement, not a proof).
- Integrating the translation separately. is not the translation followed by the rotation ; the translation of is , not .
Implementations
Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.
# SPDX-License-Identifier: MIT
# Shared helper of the robotics pages of https://algorithm.tamnd.com/. The authors are listed in prov/.
"""Small linear algebra, rotations, poses and quaternions for the robotics pages.
Conventions (Lynch and Park, Modern Robotics, 2017):
- A matrix is a list of rows. A vector is a flat list.
- hat3(w) is the skew-symmetric matrix [w], so that [w] x = w x x.
- A twist or screw is a 6-vector (omega, v), angular part first.
hat6(V) is the 4x4 matrix [[[omega], v], [0, 0]].
- A pose T is the 4x4 matrix [[R, p], [0, 1]].
- so3_exp and so3_log use exponential coordinates w = omega_hat * theta,
with theta = |w| in [0, pi] for so3_log.
- se3_exp and se3_log use 6-vectors (w, v) = S * theta.
- Quaternions are Hamilton, scalar first: q = (w, x, y, z), with i j = k.
- Angles are in radians.
The helper holds no algorithm of a robotics page except the four maps
so3_exp, so3_log, se3_exp and se3_log. The pages so3-logarithm-map and
se3-exponential-map hold their own complete versions with comments.
"""
import math
# Below this angle, the coefficient functions of the exponential and the
# logarithm are evaluated by their Taylor series. The first omitted term
# of each series is of order theta^6 and is below 3e-16 for theta < 1e-2;
# it also multiplies [w] or [w]^2, which are small. Above the threshold,
# the closed forms such as (1 - cos(theta)) / theta^2 lose at most about
# 1e-16 / theta^2 to cancellation, which [w] or [w]^2 brings to 1e-14.
SERIES_THETA = 1e-2
# Above pi - NEAR_PI, so3_log takes the axis from the symmetric part of R
# (which is (R + I) / 2 at theta = pi) and not from the skew part.
NEAR_PI = 1e-2
# A pivot whose magnitude is at most PIVOT_TOL times the largest entry of
# the matrix makes solve, inv and pinv_right raise ValueError.
PIVOT_TOL = 1e-12
# ---------------------------------------------------------------- matrices
def zeros(n, m):
"""Return the n by m zero matrix."""
return [[0.0] * m for _ in range(n)]
def eye(n):
"""Return the n by n identity matrix."""
return [[1.0 if i == j else 0.0 for j in range(n)] for i in range(n)]
def _is_matrix(a):
return len(a) > 0 and isinstance(a[0], list)
def add(a, b):
"""Return a + b for two vectors or two matrices of the same shape."""
if _is_matrix(a):
return [[x + y for x, y in zip(ra, rb)] for ra, rb in zip(a, b)]
return [x + y for x, y in zip(a, b)]
def sub(a, b):
"""Return a - b for two vectors or two matrices of the same shape."""
if _is_matrix(a):
return [[x - y for x, y in zip(ra, rb)] for ra, rb in zip(a, b)]
return [x - y for x, y in zip(a, b)]
def scale(a, s):
"""Return s * a for a vector or a matrix a and a number s."""
if _is_matrix(a):
return [[s * x for x in row] for row in a]
return [s * x for x in a]
def transpose(a):
"""Return the transpose of the matrix a."""
return [list(col) for col in zip(*a)]
def mul(a, b):
"""Return the matrix product a b."""
bt = transpose(b)
return [[sum(x * y for x, y in zip(row, col)) for col in bt] for row in a]
def matvec(a, x):
"""Return the product of the matrix a and the vector x."""
return [sum(p * q for p, q in zip(row, x)) for row in a]
def dot(x, y):
"""Return the dot product of two vectors."""
return sum(p * q for p, q in zip(x, y))
def norm(x):
"""Return the Euclidean norm of a vector."""
return math.sqrt(dot(x, x))
def cross(a, b):
"""Return the cross product a x b of two 3-vectors."""
return [
a[1] * b[2] - a[2] * b[1],
a[2] * b[0] - a[0] * b[2],
a[0] * b[1] - a[1] * b[0],
]
def _max_abs(a):
return max((abs(x) for row in a for x in row), default=0.0)
def solve(a, b):
"""Solve a x = b by Gaussian elimination with partial pivoting.
a is a square matrix. b is a vector or a matrix with one column per
right-hand side; the result has the same shape as b. Raise ValueError
if a pivot is at most PIVOT_TOL times the largest entry of a.
"""
n = len(a)
vec = not _is_matrix(b)
rhs = [[x] for x in b] if vec else [list(row) for row in b]
m = [list(map(float, row)) + list(map(float, r)) for row, r in zip(a, rhs)]
k = len(rhs[0]) if rhs else 0
tol = PIVOT_TOL * _max_abs(a)
for c in range(n):
piv = max(range(c, n), key=lambda r: abs(m[r][c]))
if abs(m[piv][c]) <= tol or m[piv][c] == 0.0:
raise ValueError("matrix is singular to working precision")
m[c], m[piv] = m[piv], m[c]
for r in range(c + 1, n):
f = m[r][c] / m[c][c]
if f != 0.0:
row_r, row_c = m[r], m[c]
for j in range(c, n + k):
row_r[j] -= f * row_c[j]
x = [[0.0] * k for _ in range(n)]
for r in range(n - 1, -1, -1):
for j in range(k):
s = m[r][n + j] - sum(m[r][i] * x[i][j] for i in range(r + 1, n))
x[r][j] = s / m[r][r]
return [row[0] for row in x] if vec else x
def inv(a):
"""Return the inverse of the square matrix a (see solve for errors)."""
return solve(a, eye(len(a)))
def det(a):
"""Return the determinant of the square matrix a by elimination."""
n = len(a)
m = [list(map(float, row)) for row in a]
d = 1.0
for c in range(n):
piv = max(range(c, n), key=lambda r: abs(m[r][c]))
if m[piv][c] == 0.0:
return 0.0
if piv != c:
m[c], m[piv] = m[piv], m[c]
d = -d
d *= m[c][c]
for r in range(c + 1, n):
f = m[r][c] / m[c][c]
for j in range(c, n):
m[r][j] -= f * m[c][j]
return d
def cholesky(a):
"""Return the lower triangular L with a = L L^T.
a must be symmetric positive definite. Raise ValueError if a diagonal
entry of the factor is not positive.
"""
n = len(a)
low = zeros(n, n)
for i in range(n):
for j in range(i + 1):
s = a[i][j] - sum(low[i][k] * low[j][k] for k in range(j))
if i == j:
if s <= 0.0:
raise ValueError("matrix is not positive definite")
low[i][i] = math.sqrt(s)
else:
low[i][j] = s / low[j][j]
return low
def pinv_right(j):
"""Return the right pseudoinverse J^T (J J^T)^(-1) of a J with full row rank."""
jt = transpose(j)
return mul(jt, inv(mul(j, jt)))
# ---------------------------------------------------------------- hat and vee
def hat3(w):
"""Return the 3x3 skew-symmetric matrix [w] of a 3-vector w."""
return [
[0.0, -w[2], w[1]],
[w[2], 0.0, -w[0]],
[-w[1], w[0], 0.0],
]
def vee3(m):
"""Return the 3-vector w of a skew-symmetric matrix m = [w]."""
return [m[2][1], m[0][2], m[1][0]]
def hat6(v):
"""Return the 4x4 matrix [V] = [[[omega], v], [0, 0]] of V = (omega, v)."""
w = hat3(v[:3])
return [
[w[0][0], w[0][1], w[0][2], v[3]],
[w[1][0], w[1][1], w[1][2], v[4]],
[w[2][0], w[2][1], w[2][2], v[5]],
[0.0, 0.0, 0.0, 0.0],
]
def vee6(m):
"""Return the 6-vector (omega, v) of a 4x4 matrix [V]."""
return [m[2][1], m[0][2], m[1][0], m[0][3], m[1][3], m[2][3]]
# ---------------------------------------------------------------- rotations
def rot_x(a):
"""Return the rotation by a radians about the x axis."""
c, s = math.cos(a), math.sin(a)
return [[1.0, 0.0, 0.0], [0.0, c, -s], [0.0, s, c]]
def rot_y(a):
"""Return the rotation by a radians about the y axis."""
c, s = math.cos(a), math.sin(a)
return [[c, 0.0, s], [0.0, 1.0, 0.0], [-s, 0.0, c]]
def rot_z(a):
"""Return the rotation by a radians about the z axis."""
c, s = math.cos(a), math.sin(a)
return [[c, -s, 0.0], [s, c, 0.0], [0.0, 0.0, 1.0]]
def rpy(roll, pitch, yaw):
"""Return R = Rz(yaw) Ry(pitch) Rx(roll)."""
return mul(rot_z(yaw), mul(rot_y(pitch), rot_x(roll)))
def so3_exp(w):
"""Return exp([w]) for exponential coordinates w = omega_hat * theta.
Rodrigues' formula in the form I + A [w] + B [w]^2 with
A = sin(theta) / theta and B = (1 - cos(theta)) / theta^2.
"""
t = norm(w)
if t < SERIES_THETA:
t2 = t * t
a = 1.0 - t2 / 6.0 + t2 * t2 / 120.0
b = 0.5 - t2 / 24.0 + t2 * t2 / 720.0
else:
a = math.sin(t) / t
b = (1.0 - math.cos(t)) / (t * t)
k = hat3(w)
k2 = mul(k, k)
return [[(1.0 if i == j else 0.0) + a * k[i][j] + b * k2[i][j] for j in range(3)] for i in range(3)]
def so3_log(r):
"""Return w = omega_hat * theta with exp([w]) = r and theta in [0, pi].
theta = atan2(|s|, c), where c = (trace(r) - 1) / 2 = cos(theta) and
s = vee(r - r^T) / 2 = sin(theta) omega_hat. For theta below
SERIES_THETA, w = s (1 + theta^2 / 6 + 7 theta^4 / 360). For theta
above pi - NEAR_PI, the axis comes from the symmetric part
((r + r^T) / 2 - c I) / (1 - c) = omega_hat omega_hat^T, and its sign
from s. At theta = pi both signs are valid; the sign is then chosen so
that the largest component of the axis is positive.
"""
c = (r[0][0] + r[1][1] + r[2][2] - 1.0) / 2.0
c = max(-1.0, min(1.0, c))
s = [(r[2][1] - r[1][2]) / 2.0, (r[0][2] - r[2][0]) / 2.0, (r[1][0] - r[0][1]) / 2.0]
sn = norm(s)
t = math.atan2(sn, c)
if t < SERIES_THETA:
t2 = t * t
f = 1.0 + t2 / 6.0 + 7.0 * t2 * t2 / 360.0
return [f * x for x in s]
if t <= math.pi - NEAR_PI:
return [t / sn * x for x in s]
b = [[(r[i][j] + r[j][i]) / 2.0 - (c if i == j else 0.0) for j in range(3)] for i in range(3)]
# b = (1 - c) omega_hat omega_hat^T. Its column k with the largest
# diagonal entry is (1 - c) omega_k omega_hat, with omega_k^2 >= 1/3.
k = max(range(3), key=lambda i: b[i][i])
col = [b[i][k] for i in range(3)]
axis = [x / norm(col) for x in col]
if dot(axis, s) < 0.0 or (dot(axis, s) == 0.0 and axis[k] < 0.0):
axis = [-x for x in axis]
return [t * x for x in axis]
# ---------------------------------------------------------------- poses
def make_T(r, p):
"""Return the 4x4 pose [[r, p], [0, 1]]."""
return [
[r[0][0], r[0][1], r[0][2], p[0]],
[r[1][0], r[1][1], r[1][2], p[1]],
[r[2][0], r[2][1], r[2][2], p[2]],
[0.0, 0.0, 0.0, 1.0],
]
def _rp(t):
return [row[:3] for row in t[:3]], [t[0][3], t[1][3], t[2][3]]
def T_inv(t):
"""Return the inverse [[R^T, -R^T p], [0, 1]] of a pose t."""
r, p = _rp(t)
rt = transpose(r)
return make_T(rt, [-x for x in matvec(rt, p)])
def T_apply(t, x):
"""Return R x + p, the image of the point x under the pose t."""
r, p = _rp(t)
return add(matvec(r, x), p)
def se3_exp(xi):
"""Return exp([xi]) for a 6-vector xi = (w, v) = S * theta.
The rotation is so3_exp(w). The translation is G v with
G = I + B [w] + C [w]^2, B = (1 - cos(theta)) / theta^2 and
C = (theta - sin(theta)) / theta^3, theta = |w|. For w = 0 this is a
translation by v.
"""
w, v = xi[:3], xi[3:]
t = norm(w)
if t < SERIES_THETA:
t2 = t * t
b = 0.5 - t2 / 24.0 + t2 * t2 / 720.0
c = 1.0 / 6.0 - t2 / 120.0 + t2 * t2 / 5040.0
else:
b = (1.0 - math.cos(t)) / (t * t)
c = (t - math.sin(t)) / (t * t * t)
k = hat3(w)
k2 = mul(k, k)
g = [[(1.0 if i == j else 0.0) + b * k[i][j] + c * k2[i][j] for j in range(3)] for i in range(3)]
return make_T(so3_exp(w), matvec(g, v))
def se3_log(t):
"""Return the 6-vector xi = (w, v) with se3_exp(xi) = t and |w| in [0, pi].
w = so3_log(R) and v = G^(-1) p with
G^(-1) = I - [w] / 2 + D [w]^2, D = (1 - (theta / 2) cot(theta / 2)) / theta^2.
"""
r, p = _rp(t)
w = so3_log(r)
th = norm(w)
if th < SERIES_THETA:
t2 = th * th
d = 1.0 / 12.0 + t2 / 720.0 + t2 * t2 / 30240.0
else:
half = th / 2.0
d = (1.0 - half * math.cos(half) / math.sin(half)) / (th * th)
k = hat3(w)
k2 = mul(k, k)
gi = [[(1.0 if i == j else 0.0) - 0.5 * k[i][j] + d * k2[i][j] for j in range(3)] for i in range(3)]
return w + matvec(gi, p)
def adjoint(t):
"""Return the 6x6 adjoint [[R, 0], [[p] R, R]] of a pose t."""
r, p = _rp(t)
pr = mul(hat3(p), r)
out = zeros(6, 6)
for i in range(3):
for j in range(3):
out[i][j] = r[i][j]
out[i + 3][j + 3] = r[i][j]
out[i + 3][j] = pr[i][j]
return out
# ---------------------------------------------------------------- quaternions
def quat_mul(q, r):
"""Return the Hamilton product q r of quaternions (w, x, y, z)."""
a1, b1, c1, d1 = q
a2, b2, c2, d2 = r
return [
a1 * a2 - b1 * b2 - c1 * c2 - d1 * d2,
a1 * b2 + b1 * a2 + c1 * d2 - d1 * c2,
a1 * c2 - b1 * d2 + c1 * a2 + d1 * b2,
a1 * d2 + b1 * c2 - c1 * b2 + d1 * a2,
]
def quat_conj(q):
"""Return the conjugate (w, -x, -y, -z)."""
return [q[0], -q[1], -q[2], -q[3]]
def quat_to_rot(q):
"""Return the rotation matrix of the quaternion q, so that (0, R v) = q (0, v) q*.
q need not be of unit length; the result is the rotation of q / |q|.
"""
w, x, y, z = q
n = w * w + x * x + y * y + z * z
s = 2.0 / n
return [
[1.0 - s * (y * y + z * z), s * (x * y - w * z), s * (x * z + w * y)],
[s * (x * y + w * z), 1.0 - s * (x * x + z * z), s * (y * z - w * x)],
[s * (x * z - w * y), s * (y * z + w * x), 1.0 - s * (x * x + y * y)],
]
def quat_from_axis_angle(axis, angle):
"""Return (cos(angle / 2), sin(angle / 2) axis / |axis|).
A zero axis is allowed only with angle 0 (the identity); otherwise
raise ValueError.
"""
n = norm(axis)
if n == 0.0:
if angle == 0.0:
return [1.0, 0.0, 0.0, 0.0]
raise ValueError("zero axis with a nonzero angle")
s = math.sin(angle / 2.0) / n
return [math.cos(angle / 2.0), s * axis[0], s * axis[1], s * axis[2]]
# ---------------------------------------------------------------- derivatives
def num_jacobian(f, x, h=1e-6):
"""Return the Jacobian of f at x by central differences with step h.
f maps a list of n numbers to a list of m numbers; the result is m by n.
"""
cols = []
for i in range(len(x)):
xp = list(x)
xm = list(x)
xp[i] += h
xm[i] -= h
fp, fm = f(xp), f(xm)
cols.append([(a - b) / (2.0 * h) for a, b in zip(fp, fm)])
return transpose(cols)
# ---------------------------------------------------------------- self-test
def self_test():
"""Check the area check values; return True or raise AssertionError."""
r = so3_exp([2.0 * math.pi / 3.0 / math.sqrt(3.0)] * 3)
want = [[0.0, 0.0, 1.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
assert max(abs(r[i][j] - want[i][j]) for i in range(3) for j in range(3)) < 1e-12
w = so3_log(want)
assert abs(norm(w) - 2.0943951) < 1e-7
assert max(abs(x - 2.0 * math.pi / 3.0 / math.sqrt(3.0)) for x in w) < 1e-12
t = se3_exp([0.0, 0.0, math.pi / 2.0, math.pi / 2.0, 0.0, 0.0])
want_t = make_T(rot_z(math.pi / 2.0), [1.0, 1.0, 0.0])
assert max(abs(t[i][j] - want_t[i][j]) for i in range(4) for j in range(4)) < 1e-12
return True
se3_exponential_map.py 136 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/se3-exponential-map/. The authors are listed in prov/25FNCG.jsonl.
"""Exponential map of SE(3), written out in full.
A screw axis S = (omega, v) has |omega| = 1, or omega = 0 and |v| = 1.
exp_screw(S, theta) is the closed form of Lynch and Park, Modern Robotics,
Section 3.3.3. exp_coords(xi) takes general exponential coordinates
xi = S * theta, and uses a Taylor series when the rotation angle is small.
log_coords(T) is the inverse map, with theta in [0, pi].
Matrices are lists of rows. The 4x4 result is [[R, p], [0, 0, 0, 1]].
"""
import math
# Below this rotation angle, exp_coords and log_coords use Taylor series.
# The first omitted term of each series is of order theta^6, below 3e-16
# for theta < 1e-2. Above the threshold, exp_screw divides u by theta, and
# the rounding error of 1 - cos(theta) grows like 1e-16 |u| / theta, which
# is near 1e-14 |u| at the threshold.
SERIES_THETA = 1e-2
def _hat(w):
return [[0.0, -w[2], w[1]], [w[2], 0.0, -w[0]], [-w[1], w[0], 0.0]]
def _mul3(a, b):
return [[sum(a[i][k] * b[k][j] for k in range(3)) for j in range(3)] for i in range(3)]
def _comb(c0, c1, w, c2, w2):
"""Return c0 I + c1 w + c2 w2 for 3x3 matrices w and w2."""
return [[(c0 if i == j else 0.0) + c1 * w[i][j] + c2 * w2[i][j] for j in range(3)] for i in range(3)]
def _pose(r, p):
return [r[0] + [p[0]], r[1] + [p[1]], r[2] + [p[2]], [0.0, 0.0, 0.0, 1.0]]
def _apply(m, x):
return [sum(m[i][k] * x[k] for k in range(3)) for i in range(3)]
def exp_screw(s, theta):
"""Return exp([S] theta) for a screw axis S = (omega, v) and a distance theta.
Raise ValueError if S is not a screw axis: |omega| must be 1, or
omega = 0 and |v| = 1, within 1e-9.
"""
w, v = list(s[:3]), list(s[3:]) # @line L1
nw = math.sqrt(sum(x * x for x in w))
nv = math.sqrt(sum(x * x for x in v))
if nw <= 1e-9: # @line L2
if abs(nv - 1.0) > 1e-9:
raise ValueError("omega = 0 needs |v| = 1")
return _pose([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]], [x * theta for x in v]) # @line L3
if abs(nw - 1.0) > 1e-9:
raise ValueError("omega must be a unit vector")
k = _hat(w) # @line L4
k2 = _mul3(k, k)
r = _comb(1.0, math.sin(theta), k, 1.0 - math.cos(theta), k2) # @line L5
g = _comb(theta, 1.0 - math.cos(theta), k, theta - math.sin(theta), k2) # @line L6
p = _apply(g, v) # @line L7
return _pose(r, p) # @line L8
def exp_coords(xi):
"""Return exp([xi]) for exponential coordinates xi = (w, u) = S * theta.
With theta = |w|: if theta >= SERIES_THETA, normalize and call
exp_screw. If 0 < theta < SERIES_THETA, use the series
R = I + a [w] + b [w]^2 and p = (I + b [w] + c [w]^2) u, where
a = sin(theta) / theta, b = (1 - cos(theta)) / theta^2 and
c = (theta - sin(theta)) / theta^3 are replaced by their Taylor series.
If w = 0, the result is the translation by u.
"""
w, u = list(xi[:3]), list(xi[3:]) # @line E1
theta = math.sqrt(sum(x * x for x in w)) # @line E2
if theta >= SERIES_THETA: # @line E3
return exp_screw([x / theta for x in xi], theta) # @line E4
t2 = theta * theta # @line E5
a = 1.0 - t2 / 6.0 + t2 * t2 / 120.0
b = 0.5 - t2 / 24.0 + t2 * t2 / 720.0
c = 1.0 / 6.0 - t2 / 120.0 + t2 * t2 / 5040.0
k = _hat(w) # @line E6
k2 = _mul3(k, k)
r = _comb(1.0, a, k, b, k2)
p = _apply(_comb(1.0, b, k, c, k2), u)
return _pose(r, p) # @line E7
def log_coords(t):
"""Return xi = (w, u) with exp_coords(xi) = t and |w| in [0, pi].
w is the logarithm of R (see the so3-logarithm-map page), and
u = G^(-1) p with G^(-1) = I - [w] / 2 + d [w]^2 and
d = (1 - (theta / 2) cot(theta / 2)) / theta^2.
"""
r = [row[:3] for row in t[:3]]
p = [t[0][3], t[1][3], t[2][3]]
c = max(-1.0, min(1.0, (r[0][0] + r[1][1] + r[2][2] - 1.0) / 2.0))
s = [(r[2][1] - r[1][2]) / 2.0, (r[0][2] - r[2][0]) / 2.0, (r[1][0] - r[0][1]) / 2.0]
sn = math.sqrt(sum(x * x for x in s))
theta = math.atan2(sn, c)
if theta < SERIES_THETA:
t2 = theta * theta
w = [x * (1.0 + t2 / 6.0 + 7.0 * t2 * t2 / 360.0) for x in s]
elif theta <= math.pi - 1e-2:
w = [theta / sn * x for x in s]
else:
b = [[(r[i][j] + r[j][i]) / 2.0 - (c if i == j else 0.0) for j in range(3)] for i in range(3)]
k = max(range(3), key=lambda i: b[i][i])
col = [b[i][k] for i in range(3)]
ncol = math.sqrt(sum(x * x for x in col))
axis = [x / ncol for x in col]
if sum(x * y for x, y in zip(axis, s)) < 0.0:
axis = [-x for x in axis]
w = [theta * x for x in axis]
if theta < SERIES_THETA:
t2 = theta * theta
d = 1.0 / 12.0 + t2 / 720.0 + t2 * t2 / 30240.0
else:
half = theta / 2.0
d = (1.0 - half * math.cos(half) / math.sin(half)) / (theta * theta)
k = _hat(w)
gi = _comb(1.0, -0.5, k, d, _mul3(k, k))
return w + _apply(gi, p)
def screw_axis(q, s_hat, h):
"""Return the screw axis (omega, -omega x q + h omega) of a rotation about
the unit axis s_hat through the point q, with pitch h."""
w = list(s_hat)
wxq = [w[1] * q[2] - w[2] * q[1], w[2] * q[0] - w[0] * q[2], w[0] * q[1] - w[1] * q[0]]
return w + [-a + h * b for a, b in zip(wxq, w)]
test_se3_exponential_map.py 285 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/se3-exponential-map/. The authors are listed in prov/25FNCG.jsonl.
"""Tests of the page code and of the shared helper rbm.py."""
import itertools
import math
import random
import pytest
import rbm
from se3_exponential_map import exp_coords, exp_screw, log_coords, screw_axis
TOL = 1e-12
def maxdiff(a, b):
if a and isinstance(a[0], list):
return max(abs(x - y) for ra, rb in zip(a, b) for x, y in zip(ra, rb))
return max(abs(x - y) for x, y in zip(a, b))
def series_exp(m, terms=80):
"""Matrix exponential by its power series sum m^k / k!."""
n = len(m)
out = rbm.eye(n)
term = rbm.eye(n)
for k in range(1, terms):
term = rbm.scale(rbm.mul(term, m), 1.0 / k)
out = rbm.add(out, term)
return out
def rand_unit(rng):
while True:
v = [rng.uniform(-1.0, 1.0) for _ in range(3)]
n = rbm.norm(v)
if 0.1 < n <= 1.0:
return [x / n for x in v]
def rand_xi(rng, tmax=math.pi):
w = rbm.scale(rand_unit(rng), rng.uniform(0.0, tmax))
return w + [rng.uniform(-2.0, 2.0) for _ in range(3)]
def is_pose(t):
r = [row[:3] for row in t[:3]]
assert maxdiff(rbm.mul(rbm.transpose(r), r), rbm.eye(3)) < TOL
assert abs(rbm.det(r) - 1.0) < TOL
assert t[3] == [0.0, 0.0, 0.0, 1.0]
# ---------------------------------------------------------------- page code
def test_check_value():
s = screw_axis([0.0, 1.0, 0.0], [0.0, 0.0, 1.0], 0.0)
assert maxdiff(s, [0.0, 0.0, 1.0, 1.0, 0.0, 0.0]) < TOL
t = exp_screw(s, math.pi / 2.0)
want = rbm.make_T(rbm.rot_z(math.pi / 2.0), [1.0, 1.0, 0.0])
assert maxdiff(t, want) < TOL
assert maxdiff(exp_coords(rbm.scale(s, math.pi / 2.0)), want) < TOL
def test_against_power_series_and_helper():
rng = random.Random(1)
for _ in range(150):
xi = rand_xi(rng)
t = exp_coords(xi)
is_pose(t)
assert maxdiff(t, series_exp(rbm.hat6(xi))) < 1e-11
assert maxdiff(t, rbm.se3_exp(xi)) < TOL
def test_prismatic_and_errors():
t = exp_screw([0.0, 0.0, 0.0, 0.0, 0.6, 0.8], 2.5)
assert maxdiff(t, rbm.make_T(rbm.eye(3), [0.0, 1.5, 2.0])) < TOL
assert maxdiff(exp_coords([0.0, 0.0, 0.0, 1.0, -2.0, 3.0]), rbm.make_T(rbm.eye(3), [1.0, -2.0, 3.0])) == 0.0
with pytest.raises(ValueError):
exp_screw([0.0, 0.0, 2.0, 0.0, 0.0, 0.0], 1.0)
with pytest.raises(ValueError):
exp_screw([0.0, 0.0, 0.0, 0.0, 0.0, 2.0], 1.0)
def test_small_angles_are_continuous():
rng = random.Random(2)
for _ in range(50):
xi = rand_xi(rng)
for th in (0.1, 1e-2 * (1 + 1e-9), 1e-2 * (1 - 1e-9), 1e-4, 1e-6, 1e-9, 1e-14):
w = rbm.scale(rbm.scale(xi[:3], 1.0 / rbm.norm(xi[:3])), th)
x = w + xi[3:]
want = series_exp(rbm.hat6(x), 30)
assert maxdiff(exp_coords(x), want) < 1e-13
assert maxdiff(rbm.se3_exp(x), want) < 1e-13
assert maxdiff(rbm.so3_exp(w), series_exp(rbm.hat3(w), 30)) < 1e-15
def test_screw_motion_geometry():
rng = random.Random(3)
for _ in range(50):
q = [rng.uniform(-2.0, 2.0) for _ in range(3)]
s_hat = rand_unit(rng)
h = rng.uniform(-1.0, 1.0)
th = rng.uniform(-6.0, 6.0)
t = exp_screw(screw_axis(q, s_hat, h), th)
# a point on the axis moves along the axis by h theta
assert maxdiff(rbm.T_apply(t, q), rbm.add(q, rbm.scale(s_hat, h * th))) < 1e-11
# one-parameter subgroup
a, b = rng.uniform(-3.0, 3.0), rng.uniform(-3.0, 3.0)
s = screw_axis(q, s_hat, h)
assert maxdiff(rbm.mul(exp_screw(s, a), exp_screw(s, b)), exp_screw(s, a + b)) < 1e-11
def test_derivative_is_twist():
rng = random.Random(4)
for _ in range(20):
s = screw_axis([rng.uniform(-1, 1) for _ in range(3)], rand_unit(rng), rng.uniform(-1, 1))
th = rng.uniform(-3.0, 3.0)
h = 1e-6
d = rbm.scale(rbm.sub(exp_screw(s, th + h), exp_screw(s, th - h)), 1.0 / (2 * h))
assert maxdiff(d, rbm.mul(rbm.hat6(s), exp_screw(s, th))) < 1e-6
def test_log_round_trips():
rng = random.Random(5)
for _ in range(200):
xi = rand_xi(rng, math.pi - 1e-6)
if rbm.norm(xi[:3]) < 1e-3:
continue
assert maxdiff(log_coords(exp_coords(xi)), xi) < 1e-10
for _ in range(100):
t = exp_coords(rand_xi(rng, 3.0 * math.pi))
x = log_coords(t)
assert rbm.norm(x[:3]) <= math.pi + 1e-12
assert maxdiff(exp_coords(x), t) < 1e-11
assert maxdiff(x, rbm.se3_log(t)) < 1e-9
for th in (0.0, 1e-9, 1e-5, math.pi - 1e-3, math.pi - 1e-7, math.pi):
for _ in range(10):
xi = rbm.scale(rand_unit(rng), th) + [rng.uniform(-2, 2) for _ in range(3)]
t = exp_coords(xi)
assert maxdiff(exp_coords(log_coords(t)), t) < 1e-10
# ---------------------------------------------------------------- helper rbm
def test_rbm_self_test():
assert rbm.self_test()
def test_rbm_linear_algebra():
rng = random.Random(6)
for n in range(1, 6):
for _ in range(20):
a = [[rng.uniform(-1, 1) for _ in range(n)] for _ in range(n)]
x = [rng.uniform(-1, 1) for _ in range(n)]
b = rbm.matvec(a, x)
assert maxdiff(rbm.matvec(a, rbm.solve(a, b)), b) < 1e-9
assert maxdiff(rbm.mul(a, rbm.inv(a)), rbm.eye(n)) < 1e-8
want = 0.0
for perm in itertools.permutations(range(n)):
sign = 1
for i in range(n):
for j in range(i + 1, n):
if perm[i] > perm[j]:
sign = -sign
prod = 1.0
for i in range(n):
prod *= a[i][perm[i]]
want += sign * prod
assert abs(rbm.det(a) - want) < 1e-12
spd = rbm.add(rbm.mul(a, rbm.transpose(a)), rbm.scale(rbm.eye(n), 0.1))
low = rbm.cholesky(spd)
assert all(low[i][j] == 0.0 for i in range(n) for j in range(i + 1, n))
assert maxdiff(rbm.mul(low, rbm.transpose(low)), spd) < 1e-12
with pytest.raises(ValueError):
rbm.solve([[1.0, 2.0], [2.0, 4.0]], [1.0, 1.0])
with pytest.raises(ValueError):
rbm.cholesky([[1.0, 2.0], [2.0, 1.0]])
assert rbm.det([[1.0, 2.0], [2.0, 4.0]]) == 0.0
j = [[rng.uniform(-1, 1) for _ in range(5)] for _ in range(3)]
jp = rbm.pinv_right(j)
assert len(jp) == 5 and len(jp[0]) == 3
assert maxdiff(rbm.mul(j, jp), rbm.eye(3)) < 1e-10
assert rbm.zeros(2, 3) == [[0.0] * 3, [0.0] * 3]
assert rbm.cross([1, 0, 0], [0, 1, 0]) == [0, 0, 1]
assert rbm.dot([1, 2, 3], [4, 5, 6]) == 32
assert rbm.norm([3.0, 4.0]) == 5.0
assert rbm.sub([1, 2], [1, 1]) == [0, 1]
m = rbm.solve([[2.0, 0.0], [0.0, 4.0]], [[2.0, 4.0], [4.0, 8.0]])
assert m == [[1.0, 2.0], [1.0, 2.0]]
def test_rbm_hat_vee_and_rotations():
rng = random.Random(7)
for _ in range(50):
a = [rng.uniform(-2, 2) for _ in range(3)]
b = [rng.uniform(-2, 2) for _ in range(3)]
assert maxdiff(rbm.matvec(rbm.hat3(a), b), rbm.cross(a, b)) < 1e-15
assert rbm.vee3(rbm.hat3(a)) == a
v = a + b
assert rbm.vee6(rbm.hat6(v)) == v
th = rng.uniform(-4, 4)
assert maxdiff(rbm.rot_x(th), rbm.so3_exp([th, 0.0, 0.0])) < TOL
assert maxdiff(rbm.rot_y(th), rbm.so3_exp([0.0, th, 0.0])) < TOL
assert maxdiff(rbm.rot_z(th), rbm.so3_exp([0.0, 0.0, th])) < TOL
r, p, y = (rng.uniform(-3, 3) for _ in range(3))
want = rbm.mul(rbm.rot_z(y), rbm.mul(rbm.rot_y(p), rbm.rot_x(r)))
assert maxdiff(rbm.rpy(r, p, y), want) < 1e-15
w = rbm.scale(rand_unit(rng), rng.uniform(0.0, 3.0))
rot = rbm.so3_exp(w)
assert maxdiff(rot, series_exp(rbm.hat3(w))) < 1e-12
assert maxdiff(rbm.mul(rbm.transpose(rot), rot), rbm.eye(3)) < TOL
assert abs(rbm.det(rot) - 1.0) < TOL
def test_rbm_so3_log():
rng = random.Random(8)
for _ in range(200):
w = rbm.scale(rand_unit(rng), rng.uniform(1e-3, math.pi - 1e-6))
assert maxdiff(rbm.so3_log(rbm.so3_exp(w)), w) < 1e-10
for th in (0.0, 1e-12, 1e-6, 1e-2 * (1 - 1e-9), 1e-2 * (1 + 1e-9), 0.5,math.pi - 0.02, math.pi - 1e-3, math.pi - 1e-8, math.pi):
for _ in range(10):
rot = rbm.so3_exp(rbm.scale(rand_unit(rng), th))
w = rbm.so3_log(rot)
assert rbm.norm(w) <= math.pi + 1e-15
assert maxdiff(rbm.so3_exp(w), rot) < 1e-12
w = rbm.so3_log(rbm.rot_x(math.pi))
assert maxdiff(w, [math.pi, 0.0, 0.0]) < TOL
assert rbm.so3_log(rbm.eye(3)) == [0.0, 0.0, 0.0]
def test_rbm_poses_and_adjoint():
rng = random.Random(9)
for _ in range(50):
t1 = rbm.se3_exp(rand_xi(rng))
t2 = rbm.se3_exp(rand_xi(rng))
is_pose(t1)
assert maxdiff(rbm.mul(t1, rbm.T_inv(t1)), rbm.eye(4)) < TOL
x = [rng.uniform(-1, 1) for _ in range(3)]
assert maxdiff(rbm.T_apply(t1, x), rbm.matvec(t1, x + [1.0])[:3]) < 1e-15
a12 = rbm.adjoint(rbm.mul(t1, t2))
assert maxdiff(a12, rbm.mul(rbm.adjoint(t1), rbm.adjoint(t2))) < 1e-11
v = [rng.uniform(-1, 1) for _ in range(6)]
lhs = rbm.mul(rbm.mul(t1, rbm.hat6(v)), rbm.T_inv(t1))
assert maxdiff(lhs, rbm.hat6(rbm.matvec(rbm.adjoint(t1), v))) < 1e-11
xi = rand_xi(rng, math.pi - 1e-6)
if rbm.norm(xi[:3]) > 1e-3:
assert maxdiff(rbm.se3_log(rbm.se3_exp(xi)), xi) < 1e-10
assert maxdiff(rbm.se3_exp(rbm.se3_log(t1)), t1) < 1e-11
def test_rbm_quaternions():
q = rbm.quat_from_axis_angle([0.0, 0.0, 1.0], math.pi / 2.0)
assert maxdiff(q, [0.70711, 0.0, 0.0, 0.70711]) < 1e-5
assert maxdiff(rbm.quat_to_rot(q), rbm.rot_z(math.pi / 2.0)) < TOL
assert maxdiff(rbm.quat_from_axis_angle([1.0, 0.0, 0.0], math.pi), [0.0, 1.0, 0.0, 0.0]) < 1e-15
assert rbm.quat_from_axis_angle([0.0, 0.0, 0.0], 0.0) == [1.0, 0.0, 0.0, 0.0]
with pytest.raises(ValueError):
rbm.quat_from_axis_angle([0.0, 0.0, 0.0], 1.0)
rng = random.Random(10)
for _ in range(50):
a, b = rand_unit(rng), rand_unit(rng)
ta, tb = rng.uniform(-4, 4), rng.uniform(-4, 4)
qa = rbm.quat_from_axis_angle(rbm.scale(a, 2.5), ta)
qb = rbm.quat_from_axis_angle(b, tb)
ra = rbm.quat_to_rot(qa)
assert maxdiff(ra, rbm.so3_exp(rbm.scale(a, ta))) < TOL
assert maxdiff(rbm.quat_to_rot(rbm.quat_mul(qa, qb)), rbm.mul(ra, rbm.quat_to_rot(qb))) < TOL
v = [rng.uniform(-1, 1) for _ in range(3)]
rotated = rbm.quat_mul(rbm.quat_mul(qa, [0.0] + v), rbm.quat_conj(qa))
assert abs(rotated[0]) < TOL
assert maxdiff(rotated[1:], rbm.matvec(ra, v)) < TOL
assert maxdiff(rbm.quat_to_rot(rbm.scale(qa, -3.0)), ra) < TOL
def test_rbm_num_jacobian():
def f(x):
return [math.sin(x[0]) * x[1], x[0] * x[0] + math.exp(x[1]), x[1]]
x = [0.3, -0.7]
want = [[math.cos(0.3) * -0.7, math.sin(0.3)], [0.6, math.exp(-0.7)], [0.0, 1.0]]
assert maxdiff(rbm.num_jacobian(f, x, 1e-6), want) < 1e-8
assert maxdiff(rbm.num_jacobian(f, x), want) < 1e-8
History
The screw theory of rigid motion goes back to Mozzi (1763) and Chasles (1830). Brockett (1984) used exponentials of twists to describe the kinematics of robot arms, the product of exponentials formula. Murray, Li and Sastry (1994) and Lynch and Park (2017) give the closed form of the exponential and its inverse in their textbooks. Lynch and Park note that, in the kinematics literature, exponential coordinates of rotation have also been called Euler-Rodrigues parameters.
References
- Kevin M. Lynch and Frank C. Park, Modern Robotics, Mechanics, Planning, and Control, Cambridge University Press, 2017, Chapter 3, Section 3.3.3 (exponential coordinates of rigid-body motions, the closed form of the exponential and the matrix logarithm of a rigid-body motion)
- Richard M. Murray, Zexiang Li and S. Shankar Sastry, A Mathematical Introduction to Robotic Manipulation, CRC Press, 1994, Chapter 2, Section 3.2 (exponential coordinates for rigid motion and twists); the book writes a twist with the linear part first
- Roger W. Brockett, Robotic manipulators and the product of exponentials formula, Mathematical Theory of Networks and Systems, Lecture Notes in Control and Information Sciences 58, Springer, 1984, 120-129, the whole paper (forward kinematics as a product of exponentials of twists)
- Joan Sola, Jeremie Deray and Dinesh Atchuthan, A micro Lie theory for state estimation in robotics, 2018, the exponential and logarithm maps of SE(3) in the examples of the paper
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H1 sketch |
|
| Lean | L0 no Lean part |
|
| Code (python) | I0 not checked yet |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag 25FNCG Edit this page History Report an error Markdown