5 #ifndef __pinocchio_joint_configuration_hpp__ 6 #define __pinocchio_joint_configuration_hpp__ 8 #include "pinocchio/multibody/fwd.hpp" 9 #include "pinocchio/multibody/liegroup/liegroup.hpp" 28 template<
typename LieGroup_t,
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorType,
typename TangentVectorType,
typename ReturnType>
30 integrate(
const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
31 const Eigen::MatrixBase<ConfigVectorType> & q,
32 const Eigen::MatrixBase<TangentVectorType> & v,
33 const Eigen::MatrixBase<ReturnType> & qout);
46 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorType,
typename TangentVectorType,
typename ReturnType>
49 const Eigen::MatrixBase<ConfigVectorType> & q,
50 const Eigen::MatrixBase<TangentVectorType> & v,
51 const Eigen::MatrixBase<ReturnType> & qout)
53 integrate<LieGroupMap,Scalar,Options,JointCollectionTpl,ConfigVectorType,TangentVectorType,ReturnType>(model, q.derived(), v.derived(), qout.derived());
65 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorIn1,
typename ConfigVectorIn2,
typename ReturnType>
68 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
69 const Eigen::MatrixBase<ConfigVectorIn2> & q1,
71 const Eigen::MatrixBase<ReturnType> & qout);
82 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorIn1,
typename ConfigVectorIn2,
typename ReturnType>
85 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
86 const Eigen::MatrixBase<ConfigVectorIn2> & q1,
88 const Eigen::MatrixBase<ReturnType> & qout)
90 interpolate<LieGroupMap,Scalar,Options,JointCollectionTpl,ConfigVectorIn1,ConfigVectorIn2,ReturnType>(model, q0, q1, u, qout);
104 template<
typename LieGroup_t,
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorIn1,
typename ConfigVectorIn2,
typename ReturnType>
107 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
108 const Eigen::MatrixBase<ConfigVectorIn2> & q1,
109 const Eigen::MatrixBase<ReturnType> & dvout);
122 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorIn1,
typename ConfigVectorIn2,
typename ReturnType>
125 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
126 const Eigen::MatrixBase<ConfigVectorIn2> & q1,
127 const Eigen::MatrixBase<ReturnType> & dvout)
129 difference<LieGroupMap,Scalar,Options,JointCollectionTpl,ConfigVectorIn1,ConfigVectorIn2,ReturnType>(model,q0.derived(),q1.derived(),dvout.derived());
140 template<
typename LieGroup_t,
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorIn1,
typename ConfigVectorIn2,
typename ReturnType>
143 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
144 const Eigen::MatrixBase<ConfigVectorIn2> & q1,
145 const Eigen::MatrixBase<ReturnType> & out);
155 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorIn1,
typename ConfigVectorIn2,
typename ReturnType>
158 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
159 const Eigen::MatrixBase<ConfigVectorIn2> & q1,
160 const Eigen::MatrixBase<ReturnType> & out)
162 squaredDistance<LieGroupMap,Scalar,Options,JointCollectionTpl,ConfigVectorIn1,ConfigVectorIn2,ReturnType>(model,q0.derived(),q1.derived(),out.derived());
177 template<
typename LieGroup_t,
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorIn1,
typename ConfigVectorIn2,
typename ReturnType>
180 const Eigen::MatrixBase<ConfigVectorIn1> & lowerLimits,
181 const Eigen::MatrixBase<ConfigVectorIn2> & upperLimits,
182 const Eigen::MatrixBase<ReturnType> & qout);
196 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorIn1,
typename ConfigVectorIn2,
typename ReturnType>
199 const Eigen::MatrixBase<ConfigVectorIn1> & lowerLimits,
200 const Eigen::MatrixBase<ConfigVectorIn2> & upperLimits,
201 const Eigen::MatrixBase<ReturnType> & qout)
203 randomConfiguration<LieGroupMap,Scalar,Options,JointCollectionTpl,ConfigVectorIn1,ConfigVectorIn2,ReturnType>(model, lowerLimits.derived(), upperLimits.derived(), qout.derived());
212 template<
typename LieGroup_t,
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ReturnType>
222 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ReturnType>
226 neutral<LieGroupMap,Scalar,Options,JointCollectionTpl,ReturnType>(model,qout.derived());
246 template<
typename LieGroup_t,
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorType,
typename TangentVectorType,
typename JacobianMatrixType>
248 const Eigen::MatrixBase<ConfigVectorType> & q,
249 const Eigen::MatrixBase<TangentVectorType> & v,
250 const Eigen::MatrixBase<JacobianMatrixType> & J,
270 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorType,
typename TangentVectorType,
typename JacobianMatrixType>
272 const Eigen::MatrixBase<ConfigVectorType> & q,
273 const Eigen::MatrixBase<TangentVectorType> & v,
274 const Eigen::MatrixBase<JacobianMatrixType> & J,
277 dIntegrate<LieGroupMap,Scalar,Options,JointCollectionTpl,ConfigVectorType,TangentVectorType,JacobianMatrixType>(model, q.derived(), v.derived(), J.derived(),arg);
289 template<
typename LieGroup_t,
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorIn1,
typename ConfigVectorIn2>
291 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
292 const Eigen::MatrixBase<ConfigVectorIn2> & q1);
303 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorIn1,
typename ConfigVectorIn2>
306 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
307 const Eigen::MatrixBase<ConfigVectorIn2> & q1)
309 return squaredDistanceSum<LieGroupMap,Scalar,Options,JointCollectionTpl,ConfigVectorIn1,ConfigVectorIn2>(model, q0.derived(), q1.derived());
321 template<
typename LieGroup_t,
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorIn1,
typename ConfigVectorIn2>
323 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
324 const Eigen::MatrixBase<ConfigVectorIn2> & q1);
335 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorIn1,
typename ConfigVectorIn2>
338 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
339 const Eigen::MatrixBase<ConfigVectorIn2> & q1)
341 return distance<LieGroupMap,Scalar,Options,JointCollectionTpl,ConfigVectorIn1,ConfigVectorIn2>(model, q0.derived(), q1.derived());
351 template<
typename LieGroup_t,
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorType>
353 const Eigen::MatrixBase<ConfigVectorType> & qout);
362 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorType>
364 const Eigen::MatrixBase<ConfigVectorType> & qout)
366 normalize<LieGroupMap,Scalar,Options,JointCollectionTpl,ConfigVectorType>(model,qout.derived());
380 template<
typename LieGroup_t,
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorIn1,
typename ConfigVectorIn2>
383 const Eigen::MatrixBase<ConfigVectorIn1> & q1,
384 const Eigen::MatrixBase<ConfigVectorIn2> & q2,
385 const Scalar & prec);
398 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorIn1,
typename ConfigVectorIn2>
401 const Eigen::MatrixBase<ConfigVectorIn1> & q1,
402 const Eigen::MatrixBase<ConfigVectorIn2> & q2,
403 const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision())
405 return isSameConfiguration<LieGroupMap,Scalar,Options,JointCollectionTpl,ConfigVectorIn1,ConfigVectorIn2>(model, q1.derived(), q2.derived(), prec);
418 template<
typename LieGroup_t,
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVector,
typename JacobianMatrix>
421 const Eigen::MatrixBase<ConfigVector> & q,
422 const Eigen::MatrixBase<JacobianMatrix> &
jacobian);
434 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVector,
typename JacobianMatrix>
437 const Eigen::MatrixBase<ConfigVector> & q,
438 const Eigen::MatrixBase<JacobianMatrix> & jacobian)
440 integrateCoeffWiseJacobian<LieGroupMap,Scalar,Options,JointCollectionTpl,ConfigVector,JacobianMatrix>(model,q,
jacobian);
457 template<
typename LieGroup_t,
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorType,
typename TangentVectorType>
458 inline typename PINOCCHIO_EIGEN_PLAIN_TYPE(ConfigVectorType)
460 const Eigen::MatrixBase<ConfigVectorType> & q,
461 const Eigen::MatrixBase<TangentVectorType> & v);
472 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorType,
typename TangentVectorType>
473 inline typename PINOCCHIO_EIGEN_PLAIN_TYPE(ConfigVectorType)
474 integrate(const
ModelTpl<Scalar,Options,JointCollectionTpl> & model,
475 const
Eigen::MatrixBase<ConfigVectorType> & q,
476 const
Eigen::MatrixBase<TangentVectorType> & v)
478 return integrate<LieGroupMap,Scalar,Options,JointCollectionTpl,ConfigVectorType,TangentVectorType>(model, q.derived(), v.derived());
491 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorIn1,
typename ConfigVectorIn2>
492 inline typename PINOCCHIO_EIGEN_PLAIN_TYPE(ConfigVectorIn1)
494 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
495 const Eigen::MatrixBase<ConfigVectorIn2> & q1,
508 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorIn1,
typename ConfigVectorIn2>
509 inline typename PINOCCHIO_EIGEN_PLAIN_TYPE(ConfigVectorIn1)
510 interpolate(const
ModelTpl<Scalar,Options,JointCollectionTpl> & model,
511 const
Eigen::MatrixBase<ConfigVectorIn1> & q0,
512 const
Eigen::MatrixBase<ConfigVectorIn2> & q1,
515 return interpolate<LieGroupMap,Scalar,Options,JointCollectionTpl,ConfigVectorIn1,ConfigVectorIn2>(model, q0, q1, u);
527 template<
typename LieGroup_t,
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorIn1,
typename ConfigVectorIn2>
528 inline typename PINOCCHIO_EIGEN_PLAIN_TYPE(ConfigVectorIn1)
530 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
531 const Eigen::MatrixBase<ConfigVectorIn2> & q1);
542 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorIn1,
typename ConfigVectorIn2>
543 inline typename PINOCCHIO_EIGEN_PLAIN_TYPE(ConfigVectorIn1)
545 const
Eigen::MatrixBase<ConfigVectorIn1> & q0,
546 const
Eigen::MatrixBase<ConfigVectorIn2> & q1)
548 return difference<LieGroupMap,Scalar,Options,JointCollectionTpl,ConfigVectorIn1,ConfigVectorIn2>(model,q0.derived(),q1.derived());
560 template<
typename LieGroup_t,
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorIn1,
typename ConfigVectorIn2>
561 inline typename PINOCCHIO_EIGEN_PLAIN_TYPE(ConfigVectorIn1)
563 const Eigen::MatrixBase<ConfigVectorIn1> & q0,
564 const Eigen::MatrixBase<ConfigVectorIn2> & q1);
575 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorIn1,
typename ConfigVectorIn2>
576 inline typename PINOCCHIO_EIGEN_PLAIN_TYPE(ConfigVectorIn1)
578 const
Eigen::MatrixBase<ConfigVectorIn1> & q0,
579 const
Eigen::MatrixBase<ConfigVectorIn2> & q1)
581 return squaredDistance<LieGroupMap,Scalar,Options,JointCollectionTpl,ConfigVectorIn1,ConfigVectorIn2>(model,q0.derived(),q1.derived());
597 template<
typename LieGroup_t,
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorIn1,
typename ConfigVectorIn2>
600 const Eigen::MatrixBase<ConfigVectorIn1> & lowerLimits,
601 const Eigen::MatrixBase<ConfigVectorIn2> & upperLimits);
616 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorIn1,
typename ConfigVectorIn2>
619 const
Eigen::MatrixBase<ConfigVectorIn1> & lowerLimits,
620 const
Eigen::MatrixBase<ConfigVectorIn2> & upperLimits)
622 return randomConfiguration<LieGroupMap,Scalar,Options,JointCollectionTpl,ConfigVectorIn1,ConfigVectorIn2>(model, lowerLimits.derived(), upperLimits.derived());
637 template<
typename LieGroup_t,
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
653 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
657 return randomConfiguration<LieGroupMap,Scalar,Options,JointCollectionTpl>(model);
667 template<
typename LieGroup_t,
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
668 inline Eigen::Matrix<Scalar,Eigen::Dynamic,1,Options>
678 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
679 inline Eigen::Matrix<Scalar,Eigen::Dynamic,1,Options>
682 return neutral<LieGroupMap,Scalar,Options,JointCollectionTpl>(model);
690 #include "pinocchio/algorithm/joint-configuration.hxx" 692 #endif // ifndef __pinocchio_joint_configuration_hpp__ Scalar distance(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorIn1 > &q0, const Eigen::MatrixBase< ConfigVectorIn2 > &q1)
Distance between two configuration vectors.
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.
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 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...
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)
Computes the Jacobian of a small variation of the configuration vector or the tangent vector into the...
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...
Source from #include <cppad/example/cppad_eigen.hpp>
VectorXs ConfigVectorType
Dense vectorized version of a joint configuration vector.
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.
bool isSameConfiguration(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorIn1 > &q1, const Eigen::MatrixBase< ConfigVectorIn2 > &q2, const Scalar &prec)
Return true if the given configurations are equivalents.
PINOCCHIO_DEPRECATED void jacobian(const Model &model, Data &data, const Eigen::VectorXd &q, const Model::JointIndex jointId, Data::Matrix6x &J)
Computes the Jacobian of a specific joint frame expressed in the local frame of the joint and store t...
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.
ArgumentPosition
Argument position. Used as template parameter to refer to an argument.
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.
void normalize(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorType > &qout)
Normalize a configuration vector.
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.