15 #include "pinocchio/macros.hpp"
16 #include "pinocchio/eigen-common.hpp"
18 #include "pinocchio/math.hpp"
20 #include "pinocchio/spatial.hpp"
22 #include "pinocchio/multibody.hpp"
23 #include "pinocchio/multibody/visitor.hpp"
25 #include "pinocchio/algorithm/check.hpp"
26 #include "pinocchio/algorithm/jacobian.hpp"
27 #include "pinocchio/algorithm/kinematics.hpp"
44 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
46 const ModelTpl<Scalar, Options, JointCollectionTpl> & model,
47 DataTpl<Scalar, Options, JointCollectionTpl> & data);
60 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
62 const ModelTpl<Scalar, Options, JointCollectionTpl> & model,
63 DataTpl<Scalar, Options, JointCollectionTpl> & data,
64 const FrameIndex frame_id);
80 template<
typename,
int>
class JointCollectionTpl,
81 typename ConfigVectorType>
83 const ModelTpl<Scalar, Options, JointCollectionTpl> & model,
84 DataTpl<Scalar, Options, JointCollectionTpl> & data,
85 const Eigen::MatrixBase<ConfigVectorType> & q);
103 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
105 const ModelTpl<Scalar, Options, JointCollectionTpl> & model,
106 const DataTpl<Scalar, Options, JointCollectionTpl> & data,
107 const JointIndex joint_id,
108 const SE3Tpl<Scalar, Options> & placement,
109 const ReferenceFrame rf = LOCAL);
126 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
128 const ModelTpl<Scalar, Options, JointCollectionTpl> & model,
129 const DataTpl<Scalar, Options, JointCollectionTpl> & data,
130 const FrameIndex frame_id,
131 const ReferenceFrame rf = LOCAL)
133 typedef ModelTpl<Scalar, Options, JointCollectionTpl> Model;
134 const typename Model::Frame & frame = model.frames[frame_id];
136 return getFrameVelocity(model, data, frame.parentJoint, frame.placement, rf);
155 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
157 const ModelTpl<Scalar, Options, JointCollectionTpl> & model,
158 const DataTpl<Scalar, Options, JointCollectionTpl> & data,
159 const JointIndex joint_id,
160 const SE3Tpl<Scalar, Options> & placement,
161 const ReferenceFrame rf = LOCAL);
184 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
186 const ModelTpl<Scalar, Options, JointCollectionTpl> & model,
187 const DataTpl<Scalar, Options, JointCollectionTpl> & data,
188 const FrameIndex frame_id,
189 const ReferenceFrame rf = LOCAL)
191 typedef ModelTpl<Scalar, Options, JointCollectionTpl> Model;
192 const typename Model::Frame & frame = model.frames[frame_id];
213 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
215 const ModelTpl<Scalar, Options, JointCollectionTpl> & model,
216 const DataTpl<Scalar, Options, JointCollectionTpl> & data,
217 const JointIndex joint_id,
218 const SE3Tpl<Scalar, Options> & placement,
219 const ReferenceFrame rf = LOCAL);
244 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
246 const ModelTpl<Scalar, Options, JointCollectionTpl> & model,
247 const DataTpl<Scalar, Options, JointCollectionTpl> & data,
248 const FrameIndex frame_id,
249 const ReferenceFrame rf = LOCAL)
251 typedef ModelTpl<Scalar, Options, JointCollectionTpl> Model;
252 const typename Model::Frame & frame = model.frames[frame_id];
288 template<
typename,
int>
class JointCollectionTpl,
289 typename Matrix6xLike>
291 const ModelTpl<Scalar, Options, JointCollectionTpl> & model,
292 DataTpl<Scalar, Options, JointCollectionTpl> & data,
293 const JointIndex joint_id,
294 const SE3Tpl<Scalar, Options> & placement,
295 const ReferenceFrame reference_frame,
296 const Eigen::MatrixBase<Matrix6xLike> & J);
323 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
325 const ModelTpl<Scalar, Options, JointCollectionTpl> & model,
326 DataTpl<Scalar, Options, JointCollectionTpl> & data,
327 const JointIndex joint_id,
328 const SE3Tpl<Scalar, Options> & placement,
329 const ReferenceFrame reference_frame)
331 typedef Eigen::Matrix<Scalar, 6, Eigen::Dynamic, Options> Matrix6x;
332 Matrix6x res(Matrix6x::Zero(6, model.nv));
368 template<
typename,
int>
class JointCollectionTpl,
369 typename Matrix6xLike>
371 const ModelTpl<Scalar, Options, JointCollectionTpl> & model,
372 DataTpl<Scalar, Options, JointCollectionTpl> & data,
373 const FrameIndex frame_id,
374 const ReferenceFrame reference_frame,
375 const Eigen::MatrixBase<Matrix6xLike> & J)
377 PINOCCHIO_CHECK_INPUT_ARGUMENT(
378 frame_id < (FrameIndex)model.nframes,
"The index of the Frame is outside the bounds.");
380 typedef ModelTpl<Scalar, Options, JointCollectionTpl> Model;
381 typedef typename Model::Frame Frame;
383 const Frame & frame = model.frames[frame_id];
384 data.oMf[frame_id] = data.oMi[frame.parentJoint] * frame.placement;
387 model, data, frame.parentJoint, frame.placement, reference_frame,
388 PINOCCHIO_EIGEN_CONST_CAST(Matrix6xLike, J));
415 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
417 const ModelTpl<Scalar, Options, JointCollectionTpl> & model,
418 DataTpl<Scalar, Options, JointCollectionTpl> & data,
419 const FrameIndex frame_id,
420 const ReferenceFrame reference_frame)
422 typedef Eigen::Matrix<Scalar, 6, Eigen::Dynamic, Options> Matrix6x;
423 Matrix6x res(Matrix6x::Zero(6, model.nv));
453 template<
typename,
int>
class JointCollectionTpl,
454 typename ConfigVectorType,
455 typename Matrix6xLike>
457 const ModelTpl<Scalar, Options, JointCollectionTpl> & model,
458 DataTpl<Scalar, Options, JointCollectionTpl> & data,
459 const Eigen::MatrixBase<ConfigVectorType> & q,
460 const FrameIndex frame_id,
461 const ReferenceFrame reference_frame,
462 const Eigen::MatrixBase<Matrix6xLike> & J);
488 template<
typename,
int>
class JointCollectionTpl,
489 typename ConfigVectorType,
490 typename Matrix6xLike>
492 const ModelTpl<Scalar, Options, JointCollectionTpl> & model,
493 DataTpl<Scalar, Options, JointCollectionTpl> & data,
494 const Eigen::MatrixBase<ConfigVectorType> & q,
495 const FrameIndex frame_id,
496 const Eigen::MatrixBase<Matrix6xLike> & J)
499 model, data, q.derived(), frame_id, LOCAL, PINOCCHIO_EIGEN_CONST_CAST(Matrix6xLike, J));
524 template<
typename,
int>
class JointCollectionTpl,
525 typename Matrix6xLike>
527 const ModelTpl<Scalar, Options, JointCollectionTpl> & model,
528 DataTpl<Scalar, Options, JointCollectionTpl> & data,
529 const FrameIndex frame_id,
530 const ReferenceFrame rf,
531 const Eigen::MatrixBase<Matrix6xLike> & dJ);
566 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
568 const ModelTpl<Scalar, Options, JointCollectionTpl> & model,
569 const DataTpl<Scalar, Options, JointCollectionTpl> & data,
570 const FrameIndex frame_id,
606 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
608 const ModelTpl<Scalar, Options, JointCollectionTpl> & model,
609 const DataTpl<Scalar, Options, JointCollectionTpl> & data,
610 const FrameIndex frame_id);
614 #include "pinocchio/src/algorithm/frames.hxx"
Main pinocchio namespace.
MotionTpl< Scalar, Options > getFrameClassicalAcceleration(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const JointIndex joint_id, const SE3Tpl< Scalar, Options > &placement, const ReferenceFrame rf=LOCAL)
Returns the "classical" acceleration of the Frame expressed in the desired reference frame....
void getFrameJacobian(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const JointIndex joint_id, const SE3Tpl< Scalar, Options > &placement, const ReferenceFrame reference_frame, const Eigen::MatrixBase< Matrix6xLike > &J)
Returns the jacobian of the frame given by its relative placement w.r.t. a joint frame,...
MotionTpl< Scalar, Options > getFrameVelocity(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const JointIndex joint_id, const SE3Tpl< Scalar, Options > &placement, const ReferenceFrame rf=LOCAL)
Returns the spatial velocity of the Frame expressed in the desired reference frame....
void updateFramePlacements(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data)
Updates the position of each frame contained in the model.
const DataTpl< Scalar, Options, JointCollectionTpl >::SE3 & updateFramePlacement(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const FrameIndex frame_id)
Updates the placement of the given frame.
MotionTpl< Scalar, Options > getFrameAcceleration(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const JointIndex joint_id, const SE3Tpl< Scalar, Options > &placement, const ReferenceFrame rf=LOCAL)
Returns the spatial acceleration of the Frame expressed in the desired reference frame....
void computeFrameJacobian(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const FrameIndex frame_id, const ReferenceFrame reference_frame, const Eigen::MatrixBase< Matrix6xLike > &J)
Computes the Jacobian of a specific Frame expressed in the desired reference_frame given as argument.
void framesForwardKinematics(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q)
First calls the forwardKinematics on the model, then computes the placement of each frame....
void getFrameJacobianTimeVariation(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const FrameIndex frame_id, const ReferenceFrame rf, const Eigen::MatrixBase< Matrix6xLike > &dJ)
Computes the Jacobian time variation of a specific frame (given by frame_id) expressed either in the ...
InertiaTpl< Scalar, Options > computeSupportedInertiaByFrame(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const FrameIndex frame_id, bool with_subtree)
Compute the inertia supported by a specific frame (given by frame_id) expressed in the LOCAL frame....
ForceTpl< Scalar, Options > computeSupportedForceByFrame(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const FrameIndex frame_id)
Computes the force supported by a specific frame (given by frame_id) expressed in the LOCAL frame....