DART  6.10.1
FixedJacobianNode.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2021, The DART development contributors
3  * All rights reserved.
4  *
5  * The list of contributors can be found at:
6  * https://github.com/dartsim/dart/blob/master/LICENSE
7  *
8  * This file is provided under the following "BSD-style" License:
9  * Redistribution and use in source and binary forms, with or
10  * without modification, are permitted provided that the following
11  * conditions are met:
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
19  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
23  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
26  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef DART_DYNAMICS_FIXEDJACOBIANNODE_HPP_
34 #define DART_DYNAMICS_FIXEDJACOBIANNODE_HPP_
35 
37 
38 namespace dart {
39 namespace dynamics {
40 
42  public AccessoryNode<FixedJacobianNode>
43 {
44 public:
46  void setRelativeTransform(const Eigen::Isometry3d& newRelativeTf) override;
47 
48  // Documentation inherited
49  bool dependsOn(std::size_t _genCoordIndex) const override;
50 
51  // Documentation inherited
52  std::size_t getNumDependentGenCoords() const override;
53 
54  // Documentation inherited
55  std::size_t getDependentGenCoordIndex(std::size_t _arrayIndex) const override;
56 
57  // Documentation inherited
58  const std::vector<std::size_t>& getDependentGenCoordIndices() const override;
59 
60  // Documentation inherited
61  std::size_t getNumDependentDofs() const override;
62 
63  // Documentation inherited
64  DegreeOfFreedom* getDependentDof(std::size_t _index) override;
65 
66  // Documentation inherited
67  const DegreeOfFreedom* getDependentDof(std::size_t _index) const override;
68 
69  // Documentation inherited
70  const std::vector<DegreeOfFreedom*>& getDependentDofs() override;
71 
72  // Documentation inherited
73  const std::vector<const DegreeOfFreedom*>& getDependentDofs() const override;
74 
75  // Documentation inherited
76  const std::vector<const DegreeOfFreedom*> getChainDofs() const override;
77 
79 
80  //----------------------------------------------------------------------------
82  //----------------------------------------------------------------------------
83 
84  // Documentation inherited
85  const math::Jacobian& getJacobian() const override final;
86 
87  // Prevent the inherited getJacobian functions from being shadowed
89 
90  // Documentation inherited
91  const math::Jacobian& getWorldJacobian() const override final;
92 
93  // Prevent the inherited getWorldJacobian functions from being shadowed
95 
96  // Documentation inherited
97  const math::Jacobian& getJacobianSpatialDeriv() const override final;
98 
99  // Prevent the inherited getJacobianSpatialDeriv functions from being shadowed
101 
102  // Documentation inherited
103  const math::Jacobian& getJacobianClassicDeriv() const override final;
104 
105  // Prevent the inherited getJacobianClassicDeriv functions from being shadowed
107 
109 
110 protected:
112  FixedJacobianNode(BodyNode* parent, const Eigen::Isometry3d& transform);
113 
115  FixedJacobianNode(const std::tuple<BodyNode*, Eigen::Isometry3d>& args);
116 
119  void updateBodyJacobian() const;
120 
122  void updateWorldJacobian() const;
123 
127  void updateBodyJacobianSpatialDeriv() const;
128 
132  void updateWorldJacobianClassicDeriv() const;
133 
134  struct Cache
135  {
140 
145 
151 
157 
158  // To get byte-aligned Eigen vectors
159  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
160  };
161 
162  mutable Cache mCache;
163 };
164 
165 } // namespace dynamics
166 } // namespace dart
167 
168 #endif // DART_DYNAMICS_FIXEDJACOBIANNODE_HPP_
Terminator for the variadic template.
Definition: CompositeJoiner.hpp:45
AccessoryNode provides an interface for Nodes to get their index within the list of Nodes,...
Definition: Node.hpp:238
BodyNode class represents a single node of the skeleton.
Definition: BodyNode.hpp:79
DegreeOfFreedom class is a proxy class for accessing single degrees of freedom (aka generalized coord...
Definition: DegreeOfFreedom.hpp:55
Definition: FixedJacobianNode.hpp:43
void updateBodyJacobianSpatialDeriv() const
Update the spatial time derivative of the Fixed Frame Jacobian.
Definition: FixedJacobianNode.cpp:187
void setRelativeTransform(const Eigen::Isometry3d &newRelativeTf) override
Set the current relative transform of this Fixed Frame.
Definition: FixedJacobianNode.cpp:40
bool dependsOn(std::size_t _genCoordIndex) const override
Definition: FixedJacobianNode.cpp:53
const std::vector< DegreeOfFreedom * > & getDependentDofs() override
Definition: FixedJacobianNode.cpp:98
void updateWorldJacobianClassicDeriv() const
Update the classic time derivative of the Fixed Frame Jacobian.
Definition: FixedJacobianNode.cpp:196
std::size_t getNumDependentGenCoords() const override
Definition: FixedJacobianNode.cpp:59
void updateBodyJacobian() const
Update the Jacobian of this Fixed Frame.
Definition: FixedJacobianNode.cpp:171
std::size_t getDependentGenCoordIndex(std::size_t _arrayIndex) const override
Definition: FixedJacobianNode.cpp:65
const std::vector< std::size_t > & getDependentGenCoordIndices() const override
Definition: FixedJacobianNode.cpp:72
Cache mCache
Definition: FixedJacobianNode.hpp:162
const math::Jacobian & getWorldJacobian() const override final
Definition: FixedJacobianNode.cpp:127
DegreeOfFreedom * getDependentDof(std::size_t _index) override
Definition: FixedJacobianNode.cpp:85
FixedJacobianNode(BodyNode *parent, const Eigen::Isometry3d &transform)
Constructor.
Definition: FixedJacobianNode.cpp:154
std::size_t getNumDependentDofs() const override
Definition: FixedJacobianNode.cpp:79
const math::Jacobian & getJacobianClassicDeriv() const override final
Definition: FixedJacobianNode.cpp:145
void updateWorldJacobian() const
Update the World Jacobian cache.
Definition: FixedJacobianNode.cpp:179
const std::vector< const DegreeOfFreedom * > getChainDofs() const override
Definition: FixedJacobianNode.cpp:111
const math::Jacobian & getJacobianSpatialDeriv() const override final
Definition: FixedJacobianNode.cpp:136
const math::Jacobian & getJacobian() const override final
Definition: FixedJacobianNode.cpp:118
TemplatedJacobianNode provides a curiously recurring template pattern implementation of the various J...
Definition: TemplatedJacobianNode.hpp:51
dart::collision::fcl::Vector3 transform(const dart::collision::fcl::Transform3 &t, const dart::collision::fcl::Vector3 &v)
Transforms a 3-dim vector by a transform and returns the result.
Definition: BackwardCompatibility.cpp:133
Eigen::Matrix< double, 6, Eigen::Dynamic > Jacobian
Definition: MathTypes.hpp:114
Definition: BulletCollisionDetector.cpp:65
Definition: FixedJacobianNode.hpp:135
math::Jacobian mBodyJacobian
Cached Jacobian of this Fixed Frame.
Definition: FixedJacobianNode.hpp:139
math::Jacobian mWorldJacobianClassicDeriv
Classic time derivative of the Fixed Frame Jacobian.
Definition: FixedJacobianNode.hpp:156
math::Jacobian mBodyJacobianSpatialDeriv
Spatial time derivative of Fixed Frame Jacobian.
Definition: FixedJacobianNode.hpp:150
math::Jacobian mWorldJacobian
Cached World Jacobian of this Fixed Frame.
Definition: FixedJacobianNode.hpp:144