|
| 1 | +# The Rotation State |
| 2 | +```@meta |
| 3 | +CurrentModule = RobotDynamics |
| 4 | +``` |
| 5 | +As mentioned in [AbstractFunction](@ref AbstractFunction), RobotDynamics can work |
| 6 | +with non-Euclidean state vectors, or state vectors whose composition rule is not |
| 7 | +simple addition. The most common example of non-Euclidean state vectors in robotics |
| 8 | +is that of 3D rotations. Frequently our state vectors include a 3D rotation together |
| 9 | +with normal Euclidean states such as position, linear or angular velocities, etc. |
| 10 | +The [`RotationState`](@ref) [`StateVectorType`](@ref) represents this type of state vector. |
| 11 | +In general, this represents a state vector of the following form: |
| 12 | + |
| 13 | +```math |
| 14 | +\begin{bmatrix} |
| 15 | +x_1 \\ |
| 16 | +q_1 \\ |
| 17 | +x_2 \\ |
| 18 | +q_2 \\ |
| 19 | +\vdots \\ |
| 20 | +x_{N-1} \\ |
| 21 | +q_N \\ |
| 22 | +x_N |
| 23 | +\end{bmatrix} |
| 24 | +``` |
| 25 | +where ``x_k \in \mathbb{R}^{n_k}`` and ``q_k \in SO(3)``. Any of the ``n_k`` can be zero. |
| 26 | + |
| 27 | +This state is described by the [`LieState`](@ref) struct: |
| 28 | +```@docs |
| 29 | +LieState |
| 30 | +QuatState |
| 31 | +``` |
| 32 | + |
| 33 | +## The `LieGroupModel` type |
| 34 | +To simplify the definition of models whose state vector is a [`RotationState`](@ref), we |
| 35 | +provide the abstract [`LieGroupModel`](@ref) type: |
| 36 | + |
| 37 | +```@docs |
| 38 | +LieGroupModel |
| 39 | +``` |
| 40 | + |
| 41 | +## Single rigid bodies |
| 42 | +A lot of robotic systems, such as airplanes, quadrotors, underwater vehicles, satellites, |
| 43 | +etc., can be described as a single rigid body subject to external forces and actuators. |
| 44 | +RobotDynamics provides the [`RigidBody`](@ref) model type for this type of system: |
| 45 | + |
| 46 | +```@docs |
| 47 | +RigidBody |
| 48 | +Base.position(::RBState) |
| 49 | +orientation |
| 50 | +linear_velocity |
| 51 | +angular_velocity |
| 52 | +build_state |
| 53 | +parse_state |
| 54 | +gen_inds |
| 55 | +flipquat |
| 56 | +``` |
| 57 | + |
| 58 | +## The `RBState` type |
| 59 | +When working with rigid bodies, the rotation can be represented a variety of methods and |
| 60 | +dealing with this ambiguity can be tedious. We provide the [`RBState`](@ref) type which |
| 61 | +represents a generic state for a rigid body, representing the orietation as a quaternion. |
| 62 | +It provides easy methods to convert to and from the state vector for a given `RigidBody{R}`. |
| 63 | + |
| 64 | +```@docs |
| 65 | +RBState |
| 66 | +``` |
0 commit comments