Aikido
SO2-impl.hpp
Go to the documentation of this file.
1 namespace aikido {
2 namespace statespace {
3 
8 template <class _QualifiedState>
9 class SO2StateHandle : public statespace::StateHandle<SO2, _QualifiedState>
10 {
11 public:
15 
18  {
19  }
20 
25  SO2StateHandle(const StateSpace* _space, QualifiedState* _state)
26  : statespace::StateHandle<StateSpace, QualifiedState>(_space, _state)
27  {
28  }
29 
31  double toAngle() const
32  {
33  return this->getStateSpace()->toAngle(this->getState());
34  }
35 
39  void fromAngle(double angle)
40  {
41  return this->getStateSpace()->fromAngle(this->getState(), angle);
42  }
43 
45  Eigen::Rotation2Dd toRotation() const
46  {
47  return this->getStateSpace()->toRotation(this->getState());
48  }
49 
53  void fromRotation(const Eigen::Rotation2Dd& rotation)
54  {
55  return this->getStateSpace()->fromRotation(this->getState(), rotation);
56  }
57 };
58 
59 } // namespace statespace
60 } // namespace aikido
aikido::statespace::SO2::toRotation
Eigen::Rotation2Dd toRotation(const State *state) const
Returns state as an Eigen rotation.
aikido::statespace::SO2StateHandle::SO2StateHandle
SO2StateHandle()
Construct and initialize to nullptr.
Definition: SO2-impl.hpp:17
aikido
Format of serialized trajectory in YAML.
Definition: algorithm.hpp:4
aikido::statespace::StateHandle< SO2, _QualifiedState >::getState
auto getState() -> typename std::enable_if<!std::is_const< Q >::value, Q * >::type
Returns the State.
Definition: StateHandle-impl.hpp:49
aikido::statespace::SO2StateHandle::SO2StateHandle
SO2StateHandle(const StateSpace *_space, QualifiedState *_state)
Construct a handle for _state in _space.
Definition: SO2-impl.hpp:25
aikido::statespace::SO2StateHandle::fromRotation
void fromRotation(const Eigen::Rotation2Dd &rotation)
Sets state given an Eigen transformation.
Definition: SO2-impl.hpp:53
aikido::statespace::SO2StateHandle
StateHandle for a SO2.
Definition: SO2-impl.hpp:9
aikido::statespace::SO2StateHandle::toAngle
double toAngle() const
Returns angle corresponding to the state.
Definition: SO2-impl.hpp:31
aikido::statespace::SO2::toAngle
double toAngle(const State *state) const
Returns state as a rotation angle in (-pi, pi].
aikido::statespace::StateHandle< SO2, _QualifiedState >::getStateSpace
const StateSpace * getStateSpace() const
Returns the state space that created this state.
Definition: StateHandle-impl.hpp:66
aikido::statespace::SO2StateHandle::fromAngle
void fromAngle(double angle)
Sets state given a rotation angle.
Definition: SO2-impl.hpp:39
aikido::statespace::SE2
The two-dimensional special Euclidean group SE(2), i.e.
Definition: SE2.hpp:19
aikido::statespace::StateHandle
Wrap a State with its StateSpace to provide convenient accessor methods.
Definition: StateHandle.hpp:16
aikido::statespace::SO2::fromAngle
void fromAngle(State *state, double angle) const
Sets state from a rotation angle in (-inf, inf).
aikido::statespace::StateHandle::QualifiedState
_QualifiedState QualifiedState
Definition: StateHandle.hpp:20
aikido::statespace::SO2::fromRotation
void fromRotation(State *state, const Eigen::Rotation2Dd &rotation) const
Sets state from an Eigen rotation.
aikido::statespace::SO2StateHandle::toRotation
Eigen::Rotation2Dd toRotation() const
Returns the Eigen transformation corresponding to state.
Definition: SO2-impl.hpp:45
aikido::statespace::SO2
The two-dimensional special orthogonal group SO(2), i.e.
Definition: SO2.hpp:18
aikido::statespace::StateHandle::State
typename StateSpace::State State
Definition: StateHandle.hpp:22