frames.hpp 4.18 KB
Newer Older
1
//
2
// Copyright (c) 2015-2018 CNRS
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//
// This file is part of Pinocchio
// Pinocchio is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
//
// Pinocchio is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// Pinocchio If not, see
// <http://www.gnu.org/licenses/>.

18
19
#ifndef __se3_frames_hpp__
#define __se3_frames_hpp__
20
21
22
23
24
25
26

#include "pinocchio/multibody/model.hpp"

namespace se3
{

  /**
jcarpent's avatar
jcarpent committed
27
28
29
30
   * @brief      Updates the position of each frame contained in the model
   *
   * @param[in]  model  The kinematic model.
   * @param      data   Data associated to model.
31
32
33
   *
   * @warning    One of the algorithms forwardKinematics should have been called first
   */
jcarpent's avatar
jcarpent committed
34
  inline void framesForwardKinematics(const Model & model,
35
                                      Data & data);
36
37

  /**
jcarpent's avatar
jcarpent committed
38
39
   * @brief      First calls the forwardKinematics on the model, then computes the placement of each frame.
   *             /sa se3::forwardKinematics
40
   *
jcarpent's avatar
jcarpent committed
41
42
43
   * @param[in]  model                    The kinematic model.
   * @param      data                     Data associated to model.
   * @param[in]  q                        Configuration vector.
44
   */
jcarpent's avatar
jcarpent committed
45
46
  inline void framesForwardKinematics(const Model & model,
                                      Data & data,
47
                                      const Eigen::VectorXd & q);
48
49

  /**
50
51
52
53
54
   * @brief      Returns the jacobian of the frame expresssed either expressed in the LOCAL frame coordinate system or in the WORLD coordinate system,
   *             depending on the value of the template parameter rf.
   *             You must first call se3::computeJacobians followed by se3::framesForwardKinematics to update placement values in data structure.
   *
   * @tparam     rf Reference frame in which the columns of the Jacobian are expressed.
jcarpent's avatar
jcarpent committed
55
   
56
57
58
   * @remark     Similarly to se3::getJacobian with LOCAL or WORLD templated parameters, if rf == LOCAL, this function returns the Jacobian of the frame expressed
   *             in the local coordinates of the frame, or if rl == WORDL, it returns the Jacobian expressed of the point coincident with the origin
   *             and expressed in a coordinate system aligned with the WORLD.
59
60
61
   *
   * @param[in]  model       The kinematic model
   * @param[in]  data        Data associated to model
62
63
   * @param[in]  frame_id    Id of the operational Frame
   * @param[out] J           The Jacobian of the Frame expressed in the coordinates Frame.
64
   *
65
   * @warning    The function se3::computeJacobians and se3::framesForwardKinematics should have been called first.
66
   */
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
  template<ReferenceFrame rf>
  void getFrameJacobian(const Model & model,
                        const Data & data,
                        const Model::FrameIndex frame_id,
                        Data::Matrix6x & J);
  
  /**
   * @brief      Returns the jacobian of the frame expresssed the LOCAL frame coordinate system.
   *             You must first call se3::computeJacobians followed by se3::framesForwardKinematics to update placement values in data structure.
   *
   * @param[in]  model       The kinematic model
   * @param[in]  data        Data associated to model
   * @param[in]  frame_id    Id of the operational Frame
   * @param[out] J           The Jacobian of the Frame expressed in the coordinates Frame.
   *
   * @warning    The function se3::computeJacobians and se3::framesForwardKinematics should have been called first.
   */
   
85
  inline void getFrameJacobian(const Model & model,
86
                               const Data & data,
jcarpent's avatar
jcarpent committed
87
                               const Model::FrameIndex frame_id,
88
                               Data::Matrix6x & J);
89
 
jcarpent's avatar
jcarpent committed
90
} // namespace se3
91
92

/* --- Details -------------------------------------------------------------------- */
93
#include "pinocchio/algorithm/frames.hxx"
94

95
#endif // ifndef __se3_frames_hpp__