Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Gal3

The Gal3 class implements two related but distinct concepts: a kinematic state on a manifold, and the Galilean group of spacetime transformations SGal(3). Unlike a Pose3 which describes a static pose (position and orientation), a Gal3 state describes a full kinematic state, including velocity and time. It is a 10-dimensional manifold. For users familiar with NavState, which also models attitude, position, and velocity, Gal3 is different in that it forms a complete Lie group, with a well-defined composition rule that correctly propagates states through time.

Open In Colab

Gal3 as a Manifold

First, we can view Gal3 as a manifold representing the kinematic state of an object. An element on this manifold is a tuple (C,p,v,t)(C, p, v, t) where:

  • C∈SO(3)C \in SO(3): The attitude (orientation).

  • p∈R3p \in \mathbb{R}^3: The position.

  • v∈R3v \in \mathbb{R}^3: The velocity.

  • t∈Rt \in \mathbb{R}: The time.

This is useful for representing the state of a dynamic system in estimation problems like trajectory optimization.

Identity State:
R: [
	1, 0, 0;
	0, 1, 0;
	0, 0, 1
]
r: 0 0 0
v: 0 0 0
t: 0


Kinematic State G1:
R: [
	0.866025, -0.5, 0;
	0.5, 0.866025, 0;
	0, 0, 1
]
r: 10 20 30
v: 1 2 3
t: 5

The state’s components can be accessed using accessor methods that align with this manifold view.

Attitude:
R: [
	0.866025, -0.5, 0;
	0.5, 0.866025, 0;
	0, 0, 1
]


Position: [10. 20. 30.]
Velocity: [1. 2. 3.]
Time: 5.0

The Lie Group SGal(3)

The Gal3 class also implements the 3D Galilean group of spacetime transformations. When viewed as a transform, an element g=(R,r,v,t)g=(R, r, v, t) maps spacetime coordinates from one frame to another. In this context, we often refer to the components as rotation and translation, and Gal3 provides aliases for this purpose:

  • rotation() is an alias for attitude().

  • translation() is an alias for position().

The group operation defines how to compose two such transformations. For two transforms g1=(R1,r1,v1,t1)g_1=(R_1, r_1, v_1, t_1) and g2=(R2,r2,v2,t2)g_2=(R_2, r_2, v_2, t_2), their composition gcomp=g1⋅g2g_{comp} = g_1 \cdot g_2 is:

Rcomp=R1R2R_{comp} = R_1 R_2
vcomp=R1v2+v1v_{comp} = R_1 v_2 + v_1
rcomp=R1r2+t2v1+r1r_{comp} = R_1 r_2 + t_2 v_1 + r_1
tcomp=t1+t2t_{comp} = t_1 + t_2

This composition rule correctly integrates the kinematic states.

G1.inverse():
R: [
	0.866025, 0.5, 0;
	-0.5, 0.866025, 0;
	0, 0, 1
]
r: -9.33013 -6.16025      -15
v: -1.86603 -1.23205       -3
t: -5


G1 * G2:
R: [
	0.707107, -0.707107, 0;
	0.707107, 0.707107, 0;
	0, 0, 1
]
r: 13.8301 30.8301      41
v:  3.4641 5.73205       8
t: 7


Group Action on Spacetime Events

The natural action for a Galilean transform g=(R,r,v,t)g=(R,r,v,t) is on a spacetime Event, which is a point in space and time e=(pin,tin)e=(p_{in}, t_{in}). The act method transforms an event into a new reference frame. The new event (pout,tout)(p_{out}, t_{out}) is calculated as:

tout=t+tint_{out} = t + t_{in}
pout=R⋅pin+v⋅tin+rp_{out} = R \cdot p_{in} + v \cdot t_{in} + r

This action describes how the coordinates of a spacetime event change under the Galilean transformation.

Transformed Event:
{'time':15, 'location': 19.7321 44.4641      66}

Lie Algebra and Manifold Operations

The Lie algebra of SGal(3), sgal(3), is the 10D tangent space at the identity. A tangent vector xi is a 10D vector xi = [ρ, ν, θ, τ] where ρ (displacement), ν (velocity change), θ (rotation vector) are 3D vectors and τ is a scalar time change. The Expmap and Logmap functions convert between this Lie algebra representation and the Gal3 group element.

As with other Lie groups in GTSAM, Gal3 is a manifold, and the retract and localCoordinates methods are used for optimization. By default, they are implemented using the group’s Expmap and Logmap.

Expmap(xi):
R: [
	0.935755, -0.283165, 0.210192;
	0.302933, 0.950581, -0.0680313;
	-0.18054, 0.127335, 0.97529
]
r: 0.236809 0.242157 0.299625
v: 0.381202 0.528659  0.58716
t: 0.7


Logmap(G_exp) = [0.1  0.2  0.3  0.4  0.5  0.6  0.1  0.05 0.1  0.7 ]
localCoordinates(q) from p = [  0.      0.     -0.262   3.608  -0.24    3.     -9.429  -1.365 -15.5
  -3.   ]

p.retract(v):
R: [
	0.866025, -0.5, 0;
	0.5, 0.866025, 0;
	0, 0, 1
]
r: 10 20 30
v: 1 2 3
t: 5