pinocchio  2.7.0
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
frames.hpp
1 //
2 // Copyright (c) 2015-2020 CNRS INRIA
3 //
4 
5 #ifndef __pinocchio_algorithm_frames_hpp__
6 #define __pinocchio_algorithm_frames_hpp__
7 
8 #include "pinocchio/multibody/model.hpp"
9 #include "pinocchio/multibody/data.hpp"
10 
11 namespace pinocchio
12 {
13 
24  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
25  inline void updateFramePlacements(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
26  DataTpl<Scalar,Options,JointCollectionTpl> & data);
27 
39  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
40  inline const typename DataTpl<Scalar,Options,JointCollectionTpl>::SE3 &
41  updateFramePlacement(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
42  DataTpl<Scalar,Options,JointCollectionTpl> & data,
43  const FrameIndex frame_id);
44 
45 
57  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename ConfigVectorType>
58  inline void framesForwardKinematics(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
59  DataTpl<Scalar,Options,JointCollectionTpl> & data,
60  const Eigen::MatrixBase<ConfigVectorType> & q);
61 
62 
74  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
75  PINOCCHIO_DEPRECATED
78  {
79  updateFramePlacements(model,data);
80  }
81 
82 
96  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
97  inline MotionTpl<Scalar, Options>
98  getFrameVelocity(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
99  const DataTpl<Scalar,Options,JointCollectionTpl> & data,
100  const FrameIndex frame_id,
101  const ReferenceFrame rf = LOCAL);
102 
116  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
117  inline MotionTpl<Scalar, Options>
118  getFrameAcceleration(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
119  const DataTpl<Scalar,Options,JointCollectionTpl> & data,
120  const FrameIndex frame_id,
121  const ReferenceFrame rf = LOCAL);
122 
137  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
138  inline MotionTpl<Scalar, Options>
139  getFrameClassicalAcceleration(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
140  const DataTpl<Scalar,Options,JointCollectionTpl> & data,
141  const FrameIndex frame_id,
142  const ReferenceFrame rf = LOCAL);
143 
164  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename Matrix6xLike>
165  inline void getFrameJacobian(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
166  DataTpl<Scalar,Options,JointCollectionTpl> & data,
167  const FrameIndex frame_id,
168  const ReferenceFrame rf,
169  const Eigen::MatrixBase<Matrix6xLike> & J);
170 
190  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename ConfigVectorType, typename Matrix6xLike>
191  inline void computeFrameJacobian(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
192  DataTpl<Scalar,Options,JointCollectionTpl> & data,
193  const Eigen::MatrixBase<ConfigVectorType> & q,
194  const FrameIndex frameId,
195  const ReferenceFrame reference_frame,
196  const Eigen::MatrixBase<Matrix6xLike> & J);
197 
217  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename ConfigVectorType, typename Matrix6xLike>
220  const Eigen::MatrixBase<ConfigVectorType> & q,
221  const FrameIndex frameId,
222  const Eigen::MatrixBase<Matrix6xLike> & J)
223  {
224  computeFrameJacobian(model,data,q.derived(),frameId,LOCAL,
225  PINOCCHIO_EIGEN_CONST_CAST(Matrix6xLike,J));
226  }
227 
233  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename ConfigVectorType, typename Matrix6xLike>
234  PINOCCHIO_DEPRECATED
237  const Eigen::MatrixBase<ConfigVectorType> & q,
238  const FrameIndex frameId,
239  const Eigen::MatrixBase<Matrix6xLike> & J)
240  {
241  computeFrameJacobian(model,data,q,frameId,PINOCCHIO_EIGEN_CONST_CAST(Matrix6xLike,J));
242  }
243 
258  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename Matrix6xLike>
259  void getFrameJacobianTimeVariation(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
260  DataTpl<Scalar,Options,JointCollectionTpl> & data,
261  const FrameIndex frame_id,
262  const ReferenceFrame rf,
263  const Eigen::MatrixBase<Matrix6xLike> & dJ);
264 
291  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
292  InertiaTpl<Scalar, Options>
293  computeSupportedInertiaByFrame(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
294  const DataTpl<Scalar,Options,JointCollectionTpl> & data,
295  const FrameIndex frame_id,
296  bool with_subtree);
297 
324  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
325  ForceTpl<Scalar, Options>
326  computeSupportedForceByFrame(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
327  const DataTpl<Scalar,Options,JointCollectionTpl> & data,
328  const FrameIndex frame_id);
329 
330 } // namespace pinocchio
331 
332 /* --- Details -------------------------------------------------------------------- */
333 #include "pinocchio/algorithm/frames.hxx"
334 
335 #endif // ifndef __pinocchio_algorithm_frames_hpp__
pinocchio::getFrameJacobian
void getFrameJacobian(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const FrameIndex frame_id, const ReferenceFrame rf, const Eigen::MatrixBase< Matrix6xLike > &J)
Returns the jacobian of the frame expressed either expressed in the LOCAL frame coordinate system or ...
pinocchio::DataTpl
Definition: data.hpp:29
pinocchio::getFrameClassicalAcceleration
MotionTpl< Scalar, Options > getFrameClassicalAcceleration(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const FrameIndex frame_id, const ReferenceFrame rf=LOCAL)
Returns the "classical" acceleration of the Frame expressed in the desired reference frame....
pinocchio::ReferenceFrame
ReferenceFrame
List of Reference Frames supported by Pinocchio.
Definition: fwd.hpp:44
pinocchio::getFrameAcceleration
MotionTpl< Scalar, Options > getFrameAcceleration(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const FrameIndex frame_id, const ReferenceFrame rf=LOCAL)
Returns the spatial acceleration of the Frame expressed in the desired reference frame....
pinocchio::computeSupportedForceByFrame
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....
pinocchio::computeFrameJacobian
void computeFrameJacobian(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const FrameIndex frameId, 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.
pinocchio::getFrameVelocity
MotionTpl< Scalar, Options > getFrameVelocity(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const FrameIndex frame_id, const ReferenceFrame rf=LOCAL)
Returns the spatial velocity of the Frame expressed in the desired reference frame....
pinocchio::updateFramePlacements
void updateFramePlacements(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data)
Updates the position of each frame contained in the model.
pinocchio::frameJacobian
PINOCCHIO_DEPRECATED void frameJacobian(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const FrameIndex frameId, const Eigen::MatrixBase< Matrix6xLike > &J)
This function is now deprecated and has been renamed computeFrameJacobian. This signature will be rem...
Definition: frames.hpp:235
pinocchio::computeSupportedInertiaByFrame
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....
pinocchio::framesForwardKinematics
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....
pinocchio::getFrameJacobianTimeVariation
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 ...
pinocchio::updateFramePlacement
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.
pinocchio::LOCAL
@ LOCAL
The LOCAL frame convention corresponds to the frame directly attached to the moving part (Joint,...
Definition: fwd.hpp:47
pinocchio::ModelTpl< Scalar, Options, JointCollectionTpl >
pinocchio
Main pinocchio namespace.
Definition: treeview.dox:11