Skip to content

Class inertialsim::geometry::Vector

ClassList > inertialsim > geometry > Vector

3-dimensional vectors. More...

  • #include <vector.h>

Inherits the following classes: inertialsim::geometry::VectorBase

Public Types inherited from inertialsim::geometry::VectorBase

See inertialsim::geometry::VectorBase

Type Name
typedef MatrixLieGroup< Derived, 4, 3 > Base

Public Types inherited from inertialsim::geometry::MatrixLieGroup

See inertialsim::geometry::MatrixLieGroup

Type Name
typedef Eigen::Matrix< Scalar, AlgebraDimension, Eigen::Dynamic > AlgebraArray
Array of algebra elements.
typedef Eigen::Matrix< Scalar, AlgebraDimension, 1 > AlgebraElement
Algebra element type (vector).
typedef std::vector< GroupElement > GroupArray
Array of group elements.
typedef Eigen::Matrix< Scalar, GroupDimension, GroupDimension > GroupElement
Group element type (square matrix).
typedef Eigen::Matrix< Scalar, AlgebraDimension, AlgebraDimension > JacobianMatrix
Jacobian matrix (algebra to algebra).
typedef std::vector< JacobianMatrix > JacobianMatrixArray
Array of Jacobian matrices.

Public Functions inherited from inertialsim::geometry::VectorBase

See inertialsim::geometry::VectorBase

Type Name
Array3D AsSpherical () const
Return spherical coordinates (radius, polar, azimuth).
Vector3D AsXyz () const
Return Cartesian coordinates.
Vector3D Error (const Derived & reference) const
Calculate error compared to a reference vector.
Vector3D Error (const Vector3D & reference) const
Calculate error compared to a reference array.
int num_vectors () const
Number of vectors stored.
Derived operator* (double scalar) const
Multiply by a scalar.
Derived operator+ (const Derived & rhs) const
Add two vectors.
Derived operator- (const Derived & rhs) const
Subtract two vectors.
Derived operator/ (double scalar) const
Divide by a scalar.

Public Functions inherited from inertialsim::geometry::MatrixLieGroup

See inertialsim::geometry::MatrixLieGroup

Type Name
Vector3D Apply (const Vector3D & vectors) const
Apply the group action to an array of vectors.
Derived Interpolate (const Timestamps & interp_time, Interpolator method=Interpolator::LINEAR) const
Interpolate at given times.
Derived Inverse () const
Invert an instance.
Derived Slice (int start, int end) const
Get a slice of elements.
AlgebraArray TimeDerivative (int order=1, int accuracy=4, const std::string & side="right") const
Compute time derivative using finite differences.
int num_elements () const
Number of elements stored in the instance.
Derived operator* (const Derived & rhs) const
Compose elements of the group.
Derived operator[] (int index) const
Get a single element by index.
const std::optional< Timestamps > & time () const
Time array corresponding to each element.
virtual ~MatrixLieGroup () = default

Public Static Functions inherited from inertialsim::geometry::VectorBase

See inertialsim::geometry::VectorBase

Type Name
Derived FromSpherical (const Array3D & rpa, const std::optional< Timestamps > & time=std::nullopt)
Construct from spherical coordinates (radius, polar, azimuth).
Derived FromXyz (const Vector3D & xyz, const std::optional< Timestamps > & time=std::nullopt)
Construct from Cartesian coordinates.

Public Static Functions inherited from inertialsim::geometry::MatrixLieGroup

See inertialsim::geometry::MatrixLieGroup

Type Name
Derived Compose (const std::vector< Derived > & instances)
Compose a sequence of instances (first to last).
Derived FromIdentity (int num_elements=1)
Create identity elements.
Derived FromRandom (int num_elements=1, std::optional< Eigen::numext::uint64_t > seed=std::nullopt)
Create random elements.

Protected Functions inherited from inertialsim::geometry::VectorBase

See inertialsim::geometry::VectorBase

Type Name
VectorBase ()
Default constructor.
VectorBase (const Vector3D & xyz, const std::optional< Timestamps > & time=std::nullopt)
Construct from Cartesian coordinates.

Protected Functions inherited from inertialsim::geometry::MatrixLieGroup

See inertialsim::geometry::MatrixLieGroup

Type Name
AlgebraArray AsAlgebra () const
Get the algebra elements.
GroupArray AsGroup () const
Get the group elements.
MatrixLieGroup (const std::optional< Timestamps > & time=std::nullopt)
Constructor.
int num_times () const

Protected Static Functions inherited from inertialsim::geometry::MatrixLieGroup

See inertialsim::geometry::MatrixLieGroup

Type Name
GroupElement Exp (const AlgebraElement & vector)
Exponential map from algebra to group.
Derived FromAlgebra (const AlgebraArray & elements, const std::optional< Timestamps > & time)
Create instance from algebra elements.
Derived FromGroup (const GroupArray & elements, const std::optional< Timestamps > & time)
Create instance from group elements.
JacobianMatrixArray Jacobian (const AlgebraArray & algebra, const std::string & side="left", bool inverse=false)
Calculate the Jacobian of the exponential map.
AlgebraElement Log (const GroupElement & element)
Logarithm map from group to algebra.

Detailed Description

Vectors can represent physical points, translations, accelerations, velocities or other arbitrary tuples in \(\mathbb{R}^3\).

Vectors can be constructed from Cartesian coordinates (x, y, z) or spherical coordinates (radius, polar angle, azimuth). Use the From* methods to construct an instance.

Internally vectors are stored in Cartesian form.

Spherical coordinate conventions

Spherical coordinates follow the physics convention:

  • radius: \(r \geq 0\)
  • polar_angle: \(0 \leq \theta \leq \pi\)
  • azimuth: \(-\pi < \phi \leq \pi\)

The Lie group for 3-dimensional vectors (under matrix multiplication) is the SE(3) sub-group whose elements are 4x4 homogeneous transform matrices with identity rotation [[I, vector],[0, 1]].

See also: Translation for translation-specific operations.

See also: geodesy::Coordinates for Earth-referenced coordinates.


The documentation for this class was generated from the following file cpp/include/inertialsim/geometry/vector.h