Aikido
aikido::statespace::SO3 Class Reference

The two-dimensional special orthogonal group SO(3), i.e. More...

#include <aikido/statespace/SO3.hpp>

Inheritance diagram for aikido::statespace::SO3:
aikido::statespace::StateSpace aikido::statespace::dart::SO3Joint

Classes

class  State
 State in SO(3), a spatial rotation. More...
 

Public Types

using StateHandle = SO3StateHandle< State >
 
using StateHandleConst = SO3StateHandle< const State >
 
using ScopedState = statespace::ScopedState< StateHandle >
 
using ScopedStateConst = statespace::ScopedState< StateHandleConst >
 
using Quaternion = State::Quaternion
 
- Public Types inherited from aikido::statespace::StateSpace
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

 SO3 ()=default
 Constructs a state space representing SO(3). More...
 
ScopedState createState () const
 Helper function to create a ScopedState. More...
 
ScopedState cloneState (const StateSpace::State *stateIn) const
 Creates an identical clone of stateIn. More...
 
const QuaterniongetQuaternion (const State *_state) const
 Gets a state as a unit quaternion. More...
 
void setQuaternion (State *_state, const Quaternion &_quaternion) const
 Sets a state to a unit quaternion. More...
 
std::size_t getStateSizeInBytes () const override
 Gets the size of a State, in bytes. More...
 
StateSpace::StateallocateStateInBuffer (void *_buffer) const override
 Create a new state in a pre-allocated buffer. More...
 
void freeStateInBuffer (StateSpace::State *_state) const override
 Free a state previously created by allocateStateInBuffer. More...
 
void compose (const StateSpace::State *_state1, const StateSpace::State *_state2, StateSpace::State *_out) const override
 Lie group operation for this StateSpace. More...
 
void getIdentity (StateSpace::State *_out) const override
 Gets the identity element for this Lie group, such that: More...
 
void getInverse (const StateSpace::State *_in, StateSpace::State *_out) const override
 Gets the inverse of _in in this Lie group, such that: More...
 
std::size_t getDimension () const override
 Get the dimension of this Lie group. More...
 
void copyState (const StateSpace::State *_source, StateSpace::State *_destination) const override
 Copy a state. More...
 
void expMap (const Eigen::VectorXd &_tangent, StateSpace::State *_out) const override
 Exponential mapping of Lie algebra element to a Lie group element. More...
 
void logMap (const StateSpace::State *_in, Eigen::VectorXd &_tangent) const override
 Log mapping of Lie group element to a Lie algebra element. More...
 
void print (const StateSpace::State *_state, std::ostream &_os) const override
 Print the quaternion represented by the state. 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...
 
- Public Member Functions inherited from aikido::statespace::StateSpace
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 StateallocateState () const
 Allocate a new state. More...
 
virtual void freeState (State *_state) const
 Free a state previously created by allocateState. More...
 
virtual void compose (State *_state1, const State *_state2) const
 Lie group operation for this StateSpace. More...
 
virtual void getInverse (State *_state) const
 Gets the inverse of _in in this Lie group. More...
 

Detailed Description

The two-dimensional special orthogonal group SO(3), i.e.

the space of spatial rigid body rotations.

Member Typedef Documentation

◆ Quaternion

◆ ScopedState

◆ ScopedStateConst

◆ StateHandle

◆ StateHandleConst

Constructor & Destructor Documentation

◆ SO3()

aikido::statespace::SO3::SO3 ( )
default

Constructs a state space representing SO(3).

Member Function Documentation

◆ allocateStateInBuffer()

StateSpace::State* aikido::statespace::SO3::allocateStateInBuffer ( void *  _buffer) const
overridevirtual

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.

Parameters
_buffermemory used to store the returned state
Returns
state object allocated in _buffer

Implements aikido::statespace::StateSpace.

◆ cloneState()

ScopedState aikido::statespace::SO3::cloneState ( const StateSpace::State stateIn) const

Creates an identical clone of stateIn.

◆ compose() [1/3]

virtual void aikido::statespace::StateSpace::compose

Lie group operation for this StateSpace.

It is not acceptable for _out to share memory with _state1 or _state2.

Parameters
_state1left input state
_state2right input state
[out]_outoutput state

◆ compose() [2/3]

void aikido::statespace::SO3::compose ( const StateSpace::State _state1,
const StateSpace::State _state2,
StateSpace::State _out 
) const
overridevirtual

Lie group operation for this StateSpace.

It is not acceptable for _out to share memory with _state1 or _state2.

Parameters
_state1left input state
_state2right input state
[out]_outoutput state

Implements aikido::statespace::StateSpace.

◆ compose() [3/3]

virtual void aikido::statespace::StateSpace::compose

Lie group operation for this StateSpace.

This is an in-place version of the three argument compose member function that computes:

_state1 = _state1 * _state2.
Parameters
[in,out]_state1left input state, overwritten by output
_state2right input state

◆ copyState()

void aikido::statespace::SO3::copyState ( const StateSpace::State _source,
StateSpace::State _destination 
) const
overridevirtual

Copy a state.

Parameters
_sourceinput state
[out]_destinationoutput state

Implements aikido::statespace::StateSpace.

◆ createState()

ScopedState aikido::statespace::SO3::createState ( ) const

Helper function to create a ScopedState.

Returns
new ScopedState

◆ expMap()

void aikido::statespace::SO3::expMap ( const Eigen::VectorXd &  _tangent,
StateSpace::State _out 
) const
overridevirtual

Exponential mapping of Lie algebra element to a Lie group element.

The tangent space is parameterized as a spatial rotation velocity.

Parameters
_tangentelement of the tangent space
[out]_outcorresponding element of the Lie group

Implements aikido::statespace::StateSpace.

◆ freeStateInBuffer()

void aikido::statespace::SO3::freeStateInBuffer ( StateSpace::State _state) const
overridevirtual

Free a state previously created by allocateStateInBuffer.

It is undefined behavior to access _state after calling this function.

Parameters
_statestate to free

Implements aikido::statespace::StateSpace.

◆ getDimension()

std::size_t aikido::statespace::SO3::getDimension ( ) const
overridevirtual

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.

Returns
dimension of this state space

Implements aikido::statespace::StateSpace.

◆ getIdentity()

void aikido::statespace::SO3::getIdentity ( StateSpace::State _out) const
overridevirtual

Gets the identity element for this Lie group, such that:

compose(state, identity) = state
Parameters
[out]_outoutput state

Implements aikido::statespace::StateSpace.

◆ getInverse()

void aikido::statespace::SO3::getInverse ( const StateSpace::State _state,
StateSpace::State _out 
) const
overridevirtual

Gets the inverse of _in in this Lie group, such that:

compose(state, inverse(state)) = identity

It is not acceptable for _in to share memory with _out.

Parameters
_stateinput state
[out]_outoutput state

Implements aikido::statespace::StateSpace.

◆ getQuaternion()

const Quaternion& aikido::statespace::SO3::getQuaternion ( const State _state) const

Gets a state as a unit quaternion.

Parameters
_stateinput state
Returns
unit quaternion representing orientation

◆ getStateSizeInBytes()

std::size_t aikido::statespace::SO3::getStateSizeInBytes ( ) const
overridevirtual

Gets the size of a State, in bytes.

Returns
size, in bytes, requires to store a State

Implements aikido::statespace::StateSpace.

◆ logMap()

void aikido::statespace::SO3::logMap ( const StateSpace::State _in,
Eigen::VectorXd &  _tangent 
) const
overridevirtual

Log mapping of Lie group element to a Lie algebra element.

The tangent space is parameterized as a spatial rotational velocity.

Parameters
_inelement of this Lie group
[out]_tangentcorresponding element of the tangent space

Implements aikido::statespace::StateSpace.

◆ print()

void aikido::statespace::SO3::print ( const StateSpace::State _state,
std::ostream &  _os 
) const
overridevirtual

Print the quaternion represented by the state.

Format: [w, x, y, z]

Implements aikido::statespace::StateSpace.

◆ setQuaternion()

void aikido::statespace::SO3::setQuaternion ( State _state,
const Quaternion _quaternion 
) const

Sets a state to a unit quaternion.

Parameters
_stateinput state
_quaternionunit quaternion representing orientation
aikido::statespace::SO3::compose
void compose(const StateSpace::State *_state1, const StateSpace::State *_state2, StateSpace::State *_out) const override
Lie group operation for this StateSpace.