spatial/classic-acceleration.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2019 INRIA
3 //
4 
5 #ifndef __pinocchio_spatial_classic_acceleration_hpp__
6 #define __pinocchio_spatial_classic_acceleration_hpp__
7 
10 
11 namespace pinocchio
12 {
28  template<typename Motion1, typename Motion2, typename Vector3Like>
29  inline void classicAcceleration(
30  const MotionDense<Motion1> & spatial_velocity,
32  const Eigen::MatrixBase<Vector3Like> & res)
33  {
34  PINOCCHIO_EIGEN_CONST_CAST(Vector3Like, res).noalias() =
35  spatial_acceleration.linear() + spatial_velocity.angular().cross(spatial_velocity.linear());
36  }
37 
51  template<typename Motion1, typename Motion2>
53  const MotionDense<Motion1> & spatial_velocity,
54  const MotionDense<Motion2> & spatial_acceleration)
55  {
56  typedef typename PINOCCHIO_EIGEN_PLAIN_TYPE(typename Motion2::Vector3) ReturnType;
57  ReturnType res;
58  classicAcceleration(spatial_velocity, spatial_acceleration, res);
59  return res;
60  }
61 
78  template<
79  typename Motion1,
80  typename Motion2,
81  typename SE3Scalar,
82  int SE3Options,
83  typename Vector3Like>
84  inline void classicAcceleration(
85  const MotionDense<Motion1> & spatial_velocity,
88  const Eigen::MatrixBase<Vector3Like> & res)
89  {
90  typedef typename PINOCCHIO_EIGEN_PLAIN_TYPE(typename Motion1::LinearType) Vector3;
91 
92  const Vector3 linear_velocity_frame_B =
93  spatial_velocity.linear() + spatial_velocity.angular().cross(placement.translation());
94 
95  const Vector3 linear_acceleration_frame_B // expressed in the coordinate frame A
96  = spatial_acceleration.linear() + spatial_velocity.angular().cross(linear_velocity_frame_B);
97 
98  PINOCCHIO_EIGEN_CONST_CAST(Vector3Like, res).noalias() =
99  placement.rotation().transpose()
100  * (linear_acceleration_frame_B - placement.translation().cross(spatial_acceleration.angular()));
101  }
102 
117  template<typename Motion1, typename Motion2, typename SE3Scalar, int SE3Options>
119  const MotionDense<Motion1> & spatial_velocity,
120  const MotionDense<Motion2> & spatial_acceleration,
121  const SE3Tpl<SE3Scalar, SE3Options> & placement)
122  {
123  typedef typename PINOCCHIO_EIGEN_PLAIN_TYPE(typename Motion2::Vector3) ReturnType;
124  ReturnType res;
126  return res;
127  }
128 } // namespace pinocchio
129 
130 #endif // ifndef __pinocchio_spatial_classic_acceleration_hpp__
PINOCCHIO_EIGEN_CONST_CAST
#define PINOCCHIO_EIGEN_CONST_CAST(TYPE, OBJ)
Macro for an automatic const_cast.
Definition: eigen-macros.hpp:51
pinocchio::SE3Tpl
Definition: context/casadi.hpp:29
pinocchio::MotionDense
Definition: context/casadi.hpp:36
pinocchio::classicAcceleration
void classicAcceleration(const MotionDense< Motion1 > &spatial_velocity, const MotionDense< Motion2 > &spatial_acceleration, const Eigen::MatrixBase< Vector3Like > &res)
Computes the classic acceleration from a given spatial velocity and spatial acceleration.
Definition: spatial/classic-acceleration.hpp:29
pinocchio::res
ReturnType res
Definition: spatial/classic-acceleration.hpp:57
motion.hpp
pinocchio::MotionDense::linear
ConstLinearType linear() const
Definition: motion-base.hpp:36
pinocchio::placement
const MotionDense< Motion2 > const SE3Tpl< SE3Scalar, SE3Options > & placement
Definition: spatial/classic-acceleration.hpp:122
se3.hpp
pinocchio::context::Vector3
Eigen::Matrix< Scalar, 3, 1, Options > Vector3
Definition: context/generic.hpp:53
pinocchio::spatial_acceleration
const MotionDense< Motion2 > & spatial_acceleration
Definition: spatial/classic-acceleration.hpp:55
pinocchio::PINOCCHIO_EIGEN_PLAIN_TYPE
PINOCCHIO_EIGEN_PLAIN_TYPE(ConfigVectorType) integrate(const ModelTpl< Scalar
Integrate a configuration vector for the specified model for a tangent vector during one unit time.
pinocchio::MotionDense::angular
ConstAngularType angular() const
Definition: motion-base.hpp:32
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Fri Nov 1 2024 02:41:39