Aikido
|
Represents a Lie group and its associated Lie algebra, i.e. More...
#include <aikido/statespace/StateSpace.hpp>
Classes | |
class | State |
Public Types | |
using | StateHandle = statespace::StateHandle< StateSpace, State > |
using | StateHandleConst = statespace::StateHandle< StateSpace, const State > |
using | ScopedState = statespace::ScopedState< StateHandle > |
using | ScopedStateConst = statespace::ScopedState< StateHandleConst > |
Public Member Functions | |
virtual | ~StateSpace ()=default |
ScopedState | createState () const |
Helper function to create a ScopedState . More... | |
ScopedState | cloneState (const State *stateIn) const |
Creates an identical clone of stateIn . More... | |
virtual State * | allocateState () const |
Allocate a new state. More... | |
virtual void | freeState (State *_state) const |
Free a state previously created by allocateState . More... | |
virtual std::size_t | getStateSizeInBytes () const =0 |
Gets the size of a State, in bytes. More... | |
virtual State * | allocateStateInBuffer (void *_buffer) const =0 |
Create a new state in a pre-allocated buffer. More... | |
virtual void | freeStateInBuffer (State *_state) const =0 |
Free a state previously created by allocateStateInBuffer . More... | |
virtual void | compose (const State *_state1, const State *_state2, State *_out) const =0 |
Lie group operation for this StateSpace. More... | |
virtual void | compose (State *_state1, const State *_state2) const |
Lie group operation for this StateSpace. More... | |
virtual void | getIdentity (State *_out) const =0 |
Gets the identity element for this Lie group, such that: More... | |
virtual void | getInverse (const State *_state, State *_out) const =0 |
Gets the inverse of _in in this Lie group, such that: More... | |
virtual void | getInverse (State *_state) const |
Gets the inverse of _in in this Lie group. More... | |
virtual std::size_t | getDimension () const =0 |
Get the dimension of this Lie group. More... | |
virtual void | copyState (const StateSpace::State *_source, StateSpace::State *_destination) const =0 |
Copy a state. More... | |
virtual void | expMap (const Eigen::VectorXd &_tangent, State *_out) const =0 |
Exponential mapping of Lie algebra element to a Lie group element. More... | |
virtual void | logMap (const State *_in, Eigen::VectorXd &_tangent) const =0 |
Log mapping of Lie group element to a Lie algebra element. More... | |
virtual void | print (const State *_state, std::ostream &_os) const =0 |
Print the state to the output stream. More... | |
Represents a Lie group and its associated Lie algebra, i.e.
a differentiable manifold embedded in Euclidean space. This is a base class for all other state spaces and provides the following operations:
These operations on StateSpace
are only defined on on State
objects created by the same StateSpace
instance. State
is an opaque class that can only be modified if you know which concrete type of StateSpace
created it. We strongly recommend using the ScopedState
and StateHandle
mechanism to keep each State
paired with the StateSpace
that it resides in.
using aikido::statespace::StateSpace::StateHandleConst = statespace::StateHandle<StateSpace, const State> |
|
virtualdefault |
|
virtual |
Allocate a new state.
This must be deleted with freeState
. This is a helper function that allocates memory, uses allocateStateInBuffer
to create a State
, and returns that pointer.
|
pure virtual |
Create a new state in a pre-allocated buffer.
The input argument must contain at least getStateSizeInBytes()
bytes of memory. This state must be freed with freeStateInBuffer
before freeing _buffer
.
_buffer | memory used to store the returned state |
_buffer
Implemented in aikido::statespace::SO2, aikido::statespace::CartesianProduct, aikido::statespace::R< N >, aikido::statespace::SE2, aikido::statespace::SE3, and aikido::statespace::SO3.
ScopedState aikido::statespace::StateSpace::cloneState | ( | const State * | stateIn | ) | const |
Creates an identical clone of stateIn
.
|
pure virtual |
Lie group operation for this StateSpace.
It is not acceptable for _out
to share memory with _state1
or _state2
.
_state1 | left input state | |
_state2 | right input state | |
[out] | _out | output state |
Implemented in aikido::statespace::SO2, aikido::statespace::CartesianProduct, aikido::statespace::R< N >, aikido::statespace::SE2, aikido::statespace::SE3, and aikido::statespace::SO3.
|
virtual |
Lie group operation for this StateSpace.
This is an in-place version of the three argument compose
member function that computes:
[in,out] | _state1 | left input state, overwritten by output |
_state2 | right input state |
|
pure virtual |
Copy a state.
_source | input state | |
[out] | _destination | output state |
Implemented in aikido::statespace::SO2, aikido::statespace::CartesianProduct, aikido::statespace::R< N >, aikido::statespace::SE2, aikido::statespace::SE3, and aikido::statespace::SO3.
ScopedState aikido::statespace::StateSpace::createState | ( | ) | const |
Helper function to create a ScopedState
.
ScopedState
|
pure virtual |
Exponential mapping of Lie algebra element to a Lie group element.
The parameterization of the tangent space is defined by the concrete implementation of this class.
_tangent | corresponding element of the tangent space | |
[out] | _out | element of this Lie group |
Implemented in aikido::statespace::SO2, aikido::statespace::CartesianProduct, aikido::statespace::R< N >, aikido::statespace::SE2, aikido::statespace::SE3, and aikido::statespace::SO3.
|
virtual |
Free a state previously created by allocateState
.
It is undefined behavior to access _state
after calling this function.
_state | state to be deleted |
|
pure virtual |
Free a state previously created by allocateStateInBuffer
.
It is undefined behavior to access _state
after calling this function.
_state | state to free |
Implemented in aikido::statespace::SO2, aikido::statespace::CartesianProduct, aikido::statespace::R< N >, aikido::statespace::SE2, aikido::statespace::SE3, and aikido::statespace::SO3.
|
pure virtual |
Get the dimension of this Lie group.
This is also the dimension of the tangent space, i.e. the Lie algebra, associated with this group.
Implemented in aikido::statespace::CartesianProduct, aikido::statespace::R< N >, aikido::statespace::SE2, aikido::statespace::SE3, aikido::statespace::SO3, and aikido::statespace::SO2.
|
pure virtual |
Gets the identity element for this Lie group, such that:
[out] | _out | output state |
Implemented in aikido::statespace::SO2, aikido::statespace::CartesianProduct, aikido::statespace::R< N >, aikido::statespace::SE2, aikido::statespace::SE3, and aikido::statespace::SO3.
|
pure virtual |
Gets the inverse of _in
in this Lie group, such that:
It is not acceptable for _in
to share memory with _out
.
_state | input state | |
[out] | _out | output state |
Implemented in aikido::statespace::SO2, aikido::statespace::CartesianProduct, aikido::statespace::R< N >, aikido::statespace::SE2, aikido::statespace::SE3, and aikido::statespace::SO3.
|
virtual |
Gets the inverse of _in
in this Lie group.
This is an in-place version of the two-argument getInverse
member function.
[in,out] | _state | input state, to be overwritten by output |
|
pure virtual |
Gets the size of a State, in bytes.
State
Implemented in aikido::statespace::CartesianProduct, aikido::statespace::R< N >, aikido::statespace::SE2, aikido::statespace::SE3, aikido::statespace::SO3, and aikido::statespace::SO2.
|
pure virtual |
Log mapping of Lie group element to a Lie algebra element.
The parameterization of the tangent space is defined by the concrete implementation of this class.
_in | element of this Lie group | |
[out] | _tangent | corresponding element of the tangent space |
Implemented in aikido::statespace::SO2, aikido::statespace::SE2, aikido::statespace::CartesianProduct, aikido::statespace::R< N >, aikido::statespace::SE3, and aikido::statespace::SO3.
|
pure virtual |
Print the state to the output stream.
_state | The element to print |
_os | The stream to print to |
Implemented in aikido::statespace::SO2, aikido::statespace::CartesianProduct, aikido::statespace::R< N >, aikido::statespace::SE3, aikido::statespace::SE2, and aikido::statespace::SO3.