29 #ifndef HPP_PINOCCHIO_LIEGROUP_ELEMENT_HH 30 #define HPP_PINOCCHIO_LIEGROUP_ELEMENT_HH 43 template <
typename vector_type>
44 class LiegroupElementConstBase {
49 template <
typename Derived>
60 template <
typename Derived>
67 template <
typename vector_type2>
85 template <
typename vector_type2>
87 return ((*
space_ == *(other.space_)) && (
value_ == other.value_));
91 template <
typename vector_type2>
93 return ((*
space_ != *(other.space_)) || (
value_ != other.value_));
97 template <
typename Derived>
101 :
value_(const_cast<Derived&>(value.derived())),
space_(space) {}
106 template <
typename vector_type2>
108 template <
typename vector_type2>
115 template <
typename vector_type>
124 : Base(value, space, NULL) {}
129 : Base(
vector_t(space->nq()), space) {}
140 template <
typename vector_type2>
148 template <
typename vector_type2>
153 template <
typename vector_type2>
161 const vector_type&
vector()
const {
return Base::vector(); }
173 template <
typename vector_type2>
176 this->
space_ = other.space();
177 this->
value_ = other.vector();
182 template <
typename Vector>
184 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Vector);
185 assert(this->
space_->nq() == v.derived().size());
186 this->
value_.noalias() = v.derived();
199 template <
typename vector_type>
210 template <
typename vector_type1,
typename vector_type2>
216 template <
typename vector_type>
219 template <
typename vector_type>
222 os <<
"Lie group element in " << *(e.space()) <<
" represented by vector (" 223 << e.vector().transpose() <<
")";
231 #endif // HPP_PINOCCHIO_LIEGROUP_ELEMENT_HH LiegroupElement operator+(const LiegroupElementConstBase< vector_type > &e, vectorIn_t v)
const vector_type & vector() const
Const vector representation.
Definition: liegroup-element.hh:75
vector_t log(const LiegroupElementConstBase< vector_type > &lge)
Compute the log as a tangent vector of a Lie group element.
LiegroupElementBase(LiegroupElementBase< vector_type2 > &other)
Casting operator from LiegroupElement to LiegroupElementRef
Definition: liegroup-element.hh:154
bool operator!=(const LiegroupElementConstBase< vector_type2 > &other)
Equality operator.
Definition: liegroup-element.hh:92
const vector_type & vector() const
Const vector representation.
Definition: liegroup-element.hh:161
bool operator==(const LiegroupElementConstBase< vector_type2 > &other)
Equality operator.
Definition: liegroup-element.hh:86
size_type size() const
Size of the vector representation.
Definition: liegroup-element.hh:78
Utility functions.
Definition: body.hh:39
LiegroupElementConstBase(const Eigen::EigenBase< Derived > &value, const LiegroupSpacePtr_t &liegroupSpace)
Definition: liegroup-element.hh:50
LiegroupElementConstBase(const Eigen::EigenBase< Derived > &value)
Definition: liegroup-element.hh:61
LiegroupElementBase & operator=(const Eigen::MatrixBase< Vector > &v)
Assignment from a vector.
Definition: liegroup-element.hh:183
LiegroupElementBase(const LiegroupSpacePtr_t &space)
Definition: liegroup-element.hh:128
LiegroupElementConstBase(const Eigen::EigenBase< Derived > &value, const LiegroupSpacePtr_t &space, void *)
Definition: liegroup-element.hh:98
matrix_t::Index size_type
Definition: fwd.hh:96
Definition: liegroup-space.hh:101
LiegroupElementBase()
Constructor of trivial element.
Definition: liegroup-element.hh:158
const LiegroupSpacePtr_t & space() const
get reference to vector of Lie groups
Definition: liegroup-element.hh:72
LiegroupElementConstBase< vector_type > Base
Definition: liegroup-element.hh:118
vector_t operator-(const LiegroupElementConstBase< vector_type1 > &e1, const LiegroupElementConstBase< vector_type2 > &e2)
std::ostream & operator<<(std::ostream &os, const hpp::pinocchio::Device &device)
Definition: device.hh:364
Eigen::Matrix< value_type, Eigen::Dynamic, 1 > vector_t
Definition: fwd.hh:87
vector_type value_
Definition: liegroup-element.hh:103
LiegroupSpacePtr_t space_
Definition: liegroup-element.hh:104
Definition: collision-object.hh:40
LiegroupElementBase(const LiegroupElementBase< vector_type2 > &other)
Definition: liegroup-element.hh:149
LiegroupElementBase & operator=(const LiegroupElementConstBase< vector_type2 > &other)
Assignment from another LiegroupElement.
Definition: liegroup-element.hh:174
LiegroupElementConstBase(const LiegroupElementConstBase< vector_type2 > &other)
Definition: liegroup-element.hh:68
Eigen::Ref< const vector_t > vectorIn_t
Definition: fwd.hh:92
LiegroupElementBase(const vector_type &value, const LiegroupSpacePtr_t &space)
Definition: liegroup-element.hh:123
void setNeutral()
Set element to neutral element.
Definition: liegroup-element.hh:167
void check() const
Definition: liegroup-element.hh:82
LiegroupElementBase(const LiegroupElementConstBase< vector_type2 > &other)
Definition: liegroup-element.hh:141
LiegroupElementBase(const vector_type &value)
Definition: liegroup-element.hh:135
vector_type & vector()
Modifiable vector representation.
Definition: liegroup-element.hh:164
shared_ptr< LiegroupSpace > LiegroupSpacePtr_t
Definition: fwd.hh:150