5#ifndef __pinocchio_algorithm_joint_configuration_hpp__
6#define __pinocchio_algorithm_joint_configuration_hpp__
8#include "pinocchio/multibody/model.hpp"
9#include "pinocchio/multibody/liegroup/liegroup.hpp"
37 template<
typename,
int>
class JointCollectionTpl,
38 typename ConfigVectorType,
39 typename TangentVectorType,
43 const Eigen::MatrixBase<ConfigVectorType> & q,
44 const Eigen::MatrixBase<TangentVectorType> & v,
45 const Eigen::MatrixBase<ReturnType> &
qout);
66 template<
typename,
int>
class JointCollectionTpl,
67 typename ConfigVectorType,
68 typename TangentVectorType,
72 const Eigen::MatrixBase<ConfigVectorType> & q,
73 const Eigen::MatrixBase<TangentVectorType> & v,
74 const Eigen::MatrixBase<ReturnType> &
qout)
77 LieGroupMap, Scalar, Options, JointCollectionTpl, ConfigVectorType, TangentVectorType,
78 ReturnType>(model, q.derived(), v.derived(),
qout.derived());
97 template<
typename,
int>
class JointCollectionTpl,
98 typename ConfigVectorIn1,
99 typename ConfigVectorIn2,
103 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
104 const Eigen::MatrixBase<ConfigVectorIn2> &
q1,
106 const Eigen::MatrixBase<ReturnType> &
qout);
123 template<
typename,
int>
class JointCollectionTpl,
129 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
130 const Eigen::MatrixBase<ConfigVectorIn2> &
q1,
132 const Eigen::MatrixBase<ReturnType> &
qout)
137 model, q0.derived(),
q1.derived(), u, PINOCCHIO_EIGEN_CONST_CAST(ReturnType,
qout));
160 template<
typename,
int>
class JointCollectionTpl,
161 typename ConfigVectorIn1,
162 typename ConfigVectorIn2,
166 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
167 const Eigen::MatrixBase<ConfigVectorIn2> &
q1,
168 const Eigen::MatrixBase<ReturnType> &
dvout);
189 template<
typename,
int>
class JointCollectionTpl,
195 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
196 const Eigen::MatrixBase<ConfigVectorIn2> &
q1,
197 const Eigen::MatrixBase<ReturnType> &
dvout)
201 ReturnType>(model, q0.derived(),
q1.derived(), PINOCCHIO_EIGEN_CONST_CAST(ReturnType,
dvout));
220 template<
typename,
int>
class JointCollectionTpl,
221 typename ConfigVectorIn1,
222 typename ConfigVectorIn2,
226 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
227 const Eigen::MatrixBase<ConfigVectorIn2> &
q1,
228 const Eigen::MatrixBase<ReturnType> &
out);
245 template<
typename,
int>
class JointCollectionTpl,
251 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
252 const Eigen::MatrixBase<ConfigVectorIn2> &
q1,
253 const Eigen::MatrixBase<ReturnType> &
out)
257 ReturnType>(model, q0.derived(),
q1.derived(), PINOCCHIO_EIGEN_CONST_CAST(ReturnType,
out));
281 template<
typename,
int>
class JointCollectionTpl,
282 typename ConfigVectorIn1,
283 typename ConfigVectorIn2,
287 const Eigen::MatrixBase<ConfigVectorIn1> & lowerLimits,
288 const Eigen::MatrixBase<ConfigVectorIn2> & upperLimits,
289 const Eigen::MatrixBase<ReturnType> &
qout);
311 template<
typename,
int>
class JointCollectionTpl,
317 const Eigen::MatrixBase<ConfigVectorIn1> & lowerLimits,
318 const Eigen::MatrixBase<ConfigVectorIn2> & upperLimits,
319 const Eigen::MatrixBase<ReturnType> &
qout)
324 model, lowerLimits.derived(), upperLimits.derived(),
325 PINOCCHIO_EIGEN_CONST_CAST(ReturnType,
qout));
342 template<
typename,
int>
class JointCollectionTpl,
346 const Eigen::MatrixBase<ReturnType> &
qout);
361 template<
typename,
int>
class JointCollectionTpl,
365 const Eigen::MatrixBase<ReturnType> &
qout)
368 model, PINOCCHIO_EIGEN_CONST_CAST(ReturnType,
qout));
399 template<
typename,
int>
class JointCollectionTpl,
400 typename ConfigVectorType,
401 typename TangentVectorType,
402 typename JacobianMatrixType>
405 const Eigen::MatrixBase<ConfigVectorType> & q,
406 const Eigen::MatrixBase<TangentVectorType> & v,
407 const Eigen::MatrixBase<JacobianMatrixType> & J,
409 const AssignmentOperatorType op = SETTO);
438 template<
typename,
int>
class JointCollectionTpl,
439 typename ConfigVectorType,
440 typename TangentVectorType,
444 const Eigen::MatrixBase<ConfigVectorType> & q,
445 const Eigen::MatrixBase<TangentVectorType> & v,
446 const Eigen::MatrixBase<JacobianMatrixType> & J,
450 LieGroupMap, Scalar, Options, JointCollectionTpl, ConfigVectorType, TangentVectorType,
483 template<
typename,
int>
class JointCollectionTpl,
484 typename ConfigVectorType,
485 typename TangentVectorType,
486 typename JacobianMatrixType>
489 const Eigen::MatrixBase<ConfigVectorType> & q,
490 const Eigen::MatrixBase<TangentVectorType> & v,
491 const Eigen::MatrixBase<JacobianMatrixType> & J,
493 const AssignmentOperatorType op)
496 LieGroupMap, Scalar, Options, JointCollectionTpl, ConfigVectorType, TangentVectorType,
530 template<
typename,
int>
class JointCollectionTpl,
531 typename ConfigVectorType,
532 typename TangentVectorType,
533 typename JacobianMatrixType1,
534 typename JacobianMatrixType2>
537 const Eigen::MatrixBase<ConfigVectorType> & q,
538 const Eigen::MatrixBase<TangentVectorType> & v,
539 const Eigen::MatrixBase<JacobianMatrixType1> &
Jin,
540 const Eigen::MatrixBase<JacobianMatrixType2> &
Jout,
571 template<
typename,
int>
class JointCollectionTpl,
572 typename ConfigVectorType,
573 typename TangentVectorType,
578 const Eigen::MatrixBase<ConfigVectorType> & q,
579 const Eigen::MatrixBase<TangentVectorType> & v,
580 const Eigen::MatrixBase<JacobianMatrixType1> &
Jin,
581 const Eigen::MatrixBase<JacobianMatrixType2> &
Jout,
585 LieGroupMap, Scalar, Options, JointCollectionTpl, ConfigVectorType, TangentVectorType,
587 model, q.derived(), v.derived(),
Jin.derived(),
619 template<
typename,
int>
class JointCollectionTpl,
620 typename ConfigVectorType,
621 typename TangentVectorType,
622 typename JacobianMatrixType>
625 const Eigen::MatrixBase<ConfigVectorType> & q,
626 const Eigen::MatrixBase<TangentVectorType> & v,
627 const Eigen::MatrixBase<JacobianMatrixType> & J,
657 template<
typename,
int>
class JointCollectionTpl,
658 typename ConfigVectorType,
659 typename TangentVectorType,
663 const Eigen::MatrixBase<ConfigVectorType> & q,
664 const Eigen::MatrixBase<TangentVectorType> & v,
665 const Eigen::MatrixBase<JacobianMatrixType> & J,
669 LieGroupMap, Scalar, Options, JointCollectionTpl, ConfigVectorType, TangentVectorType,
701 template<
typename,
int>
class JointCollectionTpl,
702 typename ConfigVector1,
703 typename ConfigVector2,
704 typename JacobianMatrix>
707 const Eigen::MatrixBase<ConfigVector1> & q0,
708 const Eigen::MatrixBase<ConfigVector2> &
q1,
709 const Eigen::MatrixBase<JacobianMatrix> & J,
738 template<
typename,
int>
class JointCollectionTpl,
744 const Eigen::MatrixBase<ConfigVector1> & q0,
745 const Eigen::MatrixBase<ConfigVector2> &
q1,
746 const Eigen::MatrixBase<JacobianMatrix> & J,
769 template<
typename,
int>
class JointCollectionTpl,
770 typename ConfigVectorIn1,
771 typename ConfigVectorIn2>
774 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
775 const Eigen::MatrixBase<ConfigVectorIn2> &
q1);
792 template<
typename,
int>
class JointCollectionTpl,
797 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
798 const Eigen::MatrixBase<ConfigVectorIn2> &
q1)
802 model, q0.derived(),
q1.derived());
821 template<
typename,
int>
class JointCollectionTpl,
822 typename ConfigVectorIn1,
823 typename ConfigVectorIn2>
826 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
827 const Eigen::MatrixBase<ConfigVectorIn2> &
q1);
843 template<
typename,
int>
class JointCollectionTpl,
848 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
849 const Eigen::MatrixBase<ConfigVectorIn2> &
q1)
853 model, q0.derived(),
q1.derived());
868 template<
typename,
int>
class JointCollectionTpl,
869 typename ConfigVectorType>
872 const Eigen::MatrixBase<ConfigVectorType> &
qout);
885 template<
typename,
int>
class JointCollectionTpl,
886 typename ConfigVectorType>
889 const Eigen::MatrixBase<ConfigVectorType> &
qout)
892 model, PINOCCHIO_EIGEN_CONST_CAST(ConfigVectorType,
qout));
910 template<
typename,
int>
class JointCollectionTpl,
911 typename ConfigVectorType>
914 const Eigen::MatrixBase<ConfigVectorType> & q,
915 const Scalar &
prec = Eigen::NumTraits<Scalar>::dummy_precision());
931 template<
typename,
int>
class JointCollectionTpl,
932 typename ConfigVectorType>
935 const Eigen::MatrixBase<ConfigVectorType> & q,
936 const Scalar &
prec = Eigen::NumTraits<Scalar>::dummy_precision())
962 template<
typename,
int>
class JointCollectionTpl,
963 typename ConfigVectorIn1,
964 typename ConfigVectorIn2>
967 const Eigen::MatrixBase<ConfigVectorIn1> &
q1,
968 const Eigen::MatrixBase<ConfigVectorIn2> &
q2,
969 const Scalar &
prec = Eigen::NumTraits<Scalar>::dummy_precision());
990 template<
typename,
int>
class JointCollectionTpl,
995 const Eigen::MatrixBase<ConfigVectorIn1> &
q1,
996 const Eigen::MatrixBase<ConfigVectorIn2> &
q2,
997 const Scalar &
prec = Eigen::NumTraits<Scalar>::dummy_precision())
1001 model,
q1.derived(),
q2.derived(),
prec);
1017 typename LieGroup_t,
1020 template<
typename,
int>
class JointCollectionTpl,
1021 typename ConfigVector,
1022 typename JacobianMatrix>
1025 const Eigen::MatrixBase<ConfigVector> & q,
1026 const Eigen::MatrixBase<JacobianMatrix> & jacobian);
1043 template<
typename,
int>
class JointCollectionTpl,
1048 const Eigen::MatrixBase<ConfigVector> & q,
1049 const Eigen::MatrixBase<JacobianMatrix> & jacobian)
1053 model, q.derived(), PINOCCHIO_EIGEN_CONST_CAST(
JacobianMatrix, jacobian));
1075 typename LieGroup_t,
1078 template<
typename,
int>
class JointCollectionTpl,
1079 typename ConfigVectorType,
1080 typename TangentVectorType>
1081 typename PINOCCHIO_EIGEN_PLAIN_TYPE(ConfigVectorType)
integrate(
1083 const Eigen::MatrixBase<ConfigVectorType> & q,
1084 const Eigen::MatrixBase<TangentVectorType> & v);
1102 template<
typename,
int>
class JointCollectionTpl,
1103 typename ConfigVectorType,
1104 typename TangentVectorType>
1105 typename PINOCCHIO_EIGEN_PLAIN_TYPE(ConfigVectorType)
integrate(
1107 const Eigen::MatrixBase<ConfigVectorType> & q,
1108 const Eigen::MatrixBase<TangentVectorType> & v)
1111 LieGroupMap, Scalar, Options, JointCollectionTpl, ConfigVectorType, TangentVectorType>(
1112 model, q.derived(), v.derived());
1129 typename LieGroup_t,
1132 template<
typename,
int>
class JointCollectionTpl,
1133 typename ConfigVectorIn1,
1134 typename ConfigVectorIn2>
1137 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
1138 const Eigen::MatrixBase<ConfigVectorIn2> &
q1,
1157 template<
typename,
int>
class JointCollectionTpl,
1162 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
1163 const Eigen::MatrixBase<ConfigVectorIn2> &
q1,
1168 model, q0.derived(),
q1.derived(), u);
1184 typename LieGroup_t,
1187 template<
typename,
int>
class JointCollectionTpl,
1188 typename ConfigVectorIn1,
1189 typename ConfigVectorIn2>
1192 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
1193 const Eigen::MatrixBase<ConfigVectorIn2> &
q1);
1210 template<
typename,
int>
class JointCollectionTpl,
1215 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
1216 const Eigen::MatrixBase<ConfigVectorIn2> &
q1)
1220 model, q0.derived(),
q1.derived());
1237 typename LieGroup_t,
1240 template<
typename,
int>
class JointCollectionTpl,
1241 typename ConfigVectorIn1,
1242 typename ConfigVectorIn2>
1245 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
1246 const Eigen::MatrixBase<ConfigVectorIn2> &
q1);
1264 template<
typename,
int>
class JointCollectionTpl,
1269 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
1270 const Eigen::MatrixBase<ConfigVectorIn2> &
q1)
1274 model, q0.derived(),
q1.derived());
1296 typename LieGroup_t,
1299 template<
typename,
int>
class JointCollectionTpl,
1300 typename ConfigVectorIn1,
1301 typename ConfigVectorIn2>
1302 typename PINOCCHIO_EIGEN_PLAIN_TYPE_NO_PARENS(
1306 const Eigen::MatrixBase<ConfigVectorIn1> & lowerLimits,
1307 const Eigen::MatrixBase<ConfigVectorIn2> & upperLimits);
1330 template<
typename,
int>
class JointCollectionTpl,
1333 typename PINOCCHIO_EIGEN_PLAIN_TYPE_NO_PARENS(
1337 const Eigen::MatrixBase<ConfigVectorIn1> & lowerLimits,
1338 const Eigen::MatrixBase<ConfigVectorIn2> & upperLimits)
1342 model, lowerLimits.derived(), upperLimits.derived());
1364 typename LieGroup_t,
1367 template<
typename,
int>
class JointCollectionTpl>
1368 typename PINOCCHIO_EIGEN_PLAIN_TYPE_NO_PARENS(
1390 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
1391 typename PINOCCHIO_EIGEN_PLAIN_TYPE_NO_PARENS(
1409 typename LieGroup_t,
1412 template<
typename,
int>
class JointCollectionTpl>
1413 Eigen::Matrix<Scalar, Eigen::Dynamic, 1, Options>
1424 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
1425 Eigen::Matrix<Scalar, Eigen::Dynamic, 1, Options>
1436#include "pinocchio/algorithm/joint-configuration.hxx"
1438#if PINOCCHIO_ENABLE_TEMPLATE_INSTANTIATION
1439 #include "pinocchio/algorithm/joint-configuration.txx"
Main pinocchio namespace.
void neutral(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ReturnType > &qout)
Return the neutral configuration element related to the model configuration space.
ArgumentPosition
Argument position. Used as template parameter to refer to an argument.
void integrateCoeffWiseJacobian(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVector > &q, const Eigen::MatrixBase< JacobianMatrix > &jacobian)
Return the Jacobian of the integrate function for the components of the config vector.
void normalize(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorType > &qout)
Normalize a configuration vector.
void difference(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorIn1 > &q0, const Eigen::MatrixBase< ConfigVectorIn2 > &q1, const Eigen::MatrixBase< ReturnType > &dvout)
Compute the tangent vector that must be integrated during one unit time to go from q0 to q1.
void integrate(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType > &v, const Eigen::MatrixBase< ReturnType > &qout)
Integrate a configuration vector for the specified model for a tangent vector during one unit time.
Scalar distance(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorIn1 > &q0, const Eigen::MatrixBase< ConfigVectorIn2 > &q1)
Distance between two configuration vectors, namely .
Scalar squaredDistanceSum(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorIn1 > &q0, const Eigen::MatrixBase< ConfigVectorIn2 > &q1)
Overall squared distance between two configuration vectors.
void dIntegrateTransport(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType > &v, const Eigen::MatrixBase< JacobianMatrixType1 > &Jin, const Eigen::MatrixBase< JacobianMatrixType2 > &Jout, const ArgumentPosition arg)
Transport a matrix from the terminal to the initial tangent space of the integrate operation,...
void randomConfiguration(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorIn1 > &lowerLimits, const Eigen::MatrixBase< ConfigVectorIn2 > &upperLimits, const Eigen::MatrixBase< ReturnType > &qout)
Generate a configuration vector uniformly sampled among provided limits.
void interpolate(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorIn1 > &q0, const Eigen::MatrixBase< ConfigVectorIn2 > &q1, const Scalar &u, const Eigen::MatrixBase< ReturnType > &qout)
Interpolate two configurations for a given model.
bool isSameConfiguration(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorIn1 > &q1, const Eigen::MatrixBase< ConfigVectorIn2 > &q2, const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision())
Return true if the given configurations are equivalents, within the given precision.
void dDifference(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVector1 > &q0, const Eigen::MatrixBase< ConfigVector2 > &q1, const Eigen::MatrixBase< JacobianMatrix > &J, const ArgumentPosition arg)
Computes the Jacobian of a small variation of the configuration vector into the tangent space at iden...
bool isNormalized(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorType > &q, const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision())
Check whether a configuration vector is normalized within the given precision provided by prec.
void dIntegrate(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType > &v, const Eigen::MatrixBase< JacobianMatrixType > &J, const ArgumentPosition arg, const AssignmentOperatorType op=SETTO)
Computes the Jacobian of a small variation of the configuration vector or the tangent vector into the...
void squaredDistance(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorIn1 > &q0, const Eigen::MatrixBase< ConfigVectorIn2 > &q1, const Eigen::MatrixBase< ReturnType > &out)
Squared distance between two configuration vectors.
VectorXs ConfigVectorType
Dense vectorized version of a joint configuration vector.