7#include <pinocchio/multibody/liegroup/liegroup-base.hpp>
8#include <pinocchio/algorithm/joint-configuration.hpp>
13namespace pin = pinocchio;
17template <
typename _LieGroup>
23 using Scalar =
typename LieGroup::Scalar;
24 static constexpr int Options = LieGroup::Options;
27 static_assert(std::is_base_of_v<pin::LieGroupBase<LieGroup>,
LieGroup>,
28 "LieGroup template argument should be a subclass of "
29 "pinocchio::LieGroupBase.");
38 template <
typename... Args>
43 inline int nx()
const {
return lg_.nq(); }
44 inline int ndx()
const {
return lg_.nv(); }
49 VectorRef out)
const {
50 lg_.integrate(x, v, out);
54 VectorRef vout)
const {
55 lg_.difference(x0, x1, vout);
59 MatrixRef Jout,
int arg)
const {
62 lg_.dIntegrate_dq(x, v, Jout);
65 lg_.dIntegrate_dv(x, v, Jout);
71 MatrixRef Jout,
int arg)
const {
72 lg_.dIntegrateTransport(x, v, Jout, pin::ArgumentPosition(arg));
76 MatrixRef Jout,
int arg)
const {
79 lg_.dDifference(x0, x1, Jout, pin::ARG0);
82 lg_.dDifference(x0, x1, Jout, pin::ARG1);
88 const ConstVectorRef &x1,
const Scalar &u,
89 VectorRef out)
const {
90 lg_.interpolate(x0, x1, u, out);
95 VectorXs
rand()
const {
return lg_.random(); }
99 return lg_.isNormalized(x);
103template <
int D,
typename Scalar>
107template <
int D,
typename Scalar>
#define PROXSUITE_NLP_DYNAMIC_TYPEDEFS(Scalar)
Wrap a Pinocchio Lie group into a ManifoldAbstractTpl object.
int nx() const
Get manifold representation dimension.
PinocchioLieGroup(PinocchioLieGroup &&lg)=default
void JintegrateTransport(const ConstVectorRef &x, const ConstVectorRef &v, MatrixRef Jout, int arg) const
Perform the parallel transport operation.
void difference_impl(const ConstVectorRef &x0, const ConstVectorRef &x1, VectorRef vout) const
Implementation of the manifold retraction operation.
VectorXs rand() const
Sample a random point on the manifold.
void Jintegrate_impl(const ConstVectorRef &x, const ConstVectorRef &v, MatrixRef Jout, int arg) const
PinocchioLieGroup(const LieGroup &lg)
typename LieGroup::Scalar Scalar
int ndx() const
Get manifold tangent space dimension.
virtual void interpolate_impl(const ConstVectorRef &x0, const ConstVectorRef &x1, const Scalar &u, VectorRef out) const
bool isNormalized(const ConstVectorRef &x) const
Check if the input vector x is a viable element of the manifold.
static constexpr int Options
PinocchioLieGroup(Args &&...args)
PinocchioLieGroup(const PinocchioLieGroup &lg)=default
void integrate_impl(const ConstVectorRef &x, const ConstVectorRef &v, VectorRef out) const
Perform the manifold integration operation.
PinocchioLieGroup(LieGroup &&lg)
void Jdifference_impl(const ConstVectorRef &x0, const ConstVectorRef &x1, MatrixRef Jout, int arg) const
VectorXs neutral() const
Get the neutral element from the manifold (if this makes sense).