proxsuite-nlp  0.10.0
A primal-dual augmented Lagrangian-type solver for nonlinear programming on manifolds.
Loading...
Searching...
No Matches
rigid-transform-point.hpp
Go to the documentation of this file.
1#pragma once
2
5#include <pinocchio/spatial/se3-tpl.hpp>
6
7namespace proxsuite {
8namespace nlp {
9
10template <typename Scalar>
13 // convenience for rigid-body transformations
14 using SE3 = pin::SE3Tpl<Scalar>;
15 using QuatConstMap = Eigen::Map<const typename SE3::Quaternion>;
17 using Matrix33s = Eigen::Matrix<Scalar, 3, 3>;
18
20 Vector3s point_;
21
22 RigidTransformationPointActionTpl(const Eigen::Ref<const Vector3s> &point)
23 : Base(7, 6, 3), space_(), point_(point), skew_point_(pin::skew(point)) {}
24
25 VectorXs operator()(const ConstVectorRef &x) const override {
26 QuatConstMap q(x.template tail<4>().data());
27 SE3 M(q, x.template head<3>());
28
29 return M.actOnEigenObject(point_);
30 }
31
32 void computeJacobian(const ConstVectorRef &x, MatrixRef Jout) const override {
33 assert(Jout.rows() == 3 && Jout.cols() == 6);
34 QuatConstMap q(x.template tail<4>().data());
35
36 Jout.template leftCols<3>() = q.matrix();
37 Jout.template rightCols<3>().noalias() = -q.matrix() * skew_point_;
38 }
39
40 Eigen::Ref<const Matrix33s> skew_point() const { return skew_point_; }
41
42private:
43 Matrix33s skew_point_;
44};
45
46} // namespace nlp
47} // namespace proxsuite
48
49#ifdef PROXSUITE_NLP_ENABLE_TEMPLATE_INSTANTIATION
51#endif
Base definitions for function classes.
#define PROXSUITE_NLP_DYNAMIC_TYPEDEFS(Scalar)
Definition math.hpp:26
Main package namespace.
Definition bcl-params.hpp:5
Twice-differentiable function, with method Jacobian and vector-hessian product evaluation.
Definition fwd.hpp:76
Wrap a Pinocchio Lie group into a ManifoldAbstractTpl object.
RigidTransformationPointActionTpl(const Eigen::Ref< const Vector3s > &point)
void computeJacobian(const ConstVectorRef &x, MatrixRef Jout) const override
Jacobian matrix of the constraint function.
VectorXs operator()(const ConstVectorRef &x) const override
Evaluate the residual at a given point x.
Eigen::Map< const typename SE3::Quaternion > QuatConstMap