DART  6.7.3
FixedJacobianNode.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2019, 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 
43  public AccessoryNode<FixedJacobianNode>
44 {
45 public:
46 
48  void setRelativeTransform(const Eigen::Isometry3d& newRelativeTf) override;
49 
50  // Documentation inherited
51  bool dependsOn(std::size_t _genCoordIndex) const override;
52 
53  // Documentation inherited
54  std::size_t getNumDependentGenCoords() const override;
55 
56  // Documentation inherited
57  std::size_t getDependentGenCoordIndex(std::size_t _arrayIndex) const override;
58 
59  // Documentation inherited
60  const std::vector<std::size_t>& getDependentGenCoordIndices() const override;
61 
62  // Documentation inherited
63  std::size_t getNumDependentDofs() const override;
64 
65  // Documentation inherited
66  DegreeOfFreedom* getDependentDof(std::size_t _index) override;
67 
68  // Documentation inherited
69  const DegreeOfFreedom* getDependentDof(std::size_t _index) const override;
70 
71  // Documentation inherited
72  const std::vector<DegreeOfFreedom*>& getDependentDofs() override;
73 
74  // Documentation inherited
75  const std::vector<const DegreeOfFreedom*>& getDependentDofs() const override;
76 
77  // Documentation inherited
78  const std::vector<const DegreeOfFreedom*> getChainDofs() const override;
79 
81 
82  //----------------------------------------------------------------------------
84  //----------------------------------------------------------------------------
85 
86  // Documentation inherited
87  const math::Jacobian& getJacobian() const override final;
88 
89  // Prevent the inherited getJacobian functions from being shadowed
91 
92  // Documentation inherited
93  const math::Jacobian& getWorldJacobian() const override final;
94 
95  // Prevent the inherited getWorldJacobian functions from being shadowed
97 
98  // Documentation inherited
99  const math::Jacobian& getJacobianSpatialDeriv() const override final;
100 
101  // Prevent the inherited getJacobianSpatialDeriv functions from being shadowed
103 
104  // Documentation inherited
105  const math::Jacobian& getJacobianClassicDeriv() const override final;
106 
107  // Prevent the inherited getJacobianClassicDeriv functions from being shadowed
109 
111 
112 protected:
113 
115  FixedJacobianNode(BodyNode* parent, const Eigen::Isometry3d& transform);
116 
118  FixedJacobianNode(const std::tuple<BodyNode*, Eigen::Isometry3d>& args);
119 
122  void updateBodyJacobian() const;
123 
125  void updateWorldJacobian() const;
126 
130  void updateBodyJacobianSpatialDeriv() const;
131 
135  void updateWorldJacobianClassicDeriv() const;
136 
137  struct Cache
138  {
143 
148 
153 
158 
159  // To get byte-aligned Eigen vectors
160  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
161  };
162 
163  mutable Cache mCache;
164 
165 };
166 
167 } // namespace dynamics
168 } // namespace dart
169 
170 #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:236
BodyNode class represents a single node of the skeleton.
Definition: BodyNode.hpp:78
DegreeOfFreedom class is a proxy class for accessing single degrees of freedom (aka generalized coord...
Definition: DegreeOfFreedom.hpp:53
Definition: FixedJacobianNode.hpp:44
void updateBodyJacobianSpatialDeriv() const
Update the spatial time derivative of the Fixed Frame Jacobian.
Definition: FixedJacobianNode.cpp:182
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:95
void updateWorldJacobianClassicDeriv() const
Update the classic time derivative of the Fixed Frame Jacobian.
Definition: FixedJacobianNode.cpp:192
std::size_t getNumDependentGenCoords() const override
Definition: FixedJacobianNode.cpp:59
void updateBodyJacobian() const
Update the Jacobian of this Fixed Frame.
Definition: FixedJacobianNode.cpp:166
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:71
Cache mCache
Definition: FixedJacobianNode.hpp:163
const math::Jacobian & getWorldJacobian() const override final
Definition: FixedJacobianNode.cpp:122
DegreeOfFreedom * getDependentDof(std::size_t _index) override
Definition: FixedJacobianNode.cpp:83
FixedJacobianNode(BodyNode *parent, const Eigen::Isometry3d &transform)
Constructor.
Definition: FixedJacobianNode.cpp:149
std::size_t getNumDependentDofs() const override
Definition: FixedJacobianNode.cpp:77
const math::Jacobian & getJacobianClassicDeriv() const override final
Definition: FixedJacobianNode.cpp:140
void updateWorldJacobian() const
Update the World Jacobian cache.
Definition: FixedJacobianNode.cpp:174
const std::vector< const DegreeOfFreedom * > getChainDofs() const override
Definition: FixedJacobianNode.cpp:107
const math::Jacobian & getJacobianSpatialDeriv() const override final
Definition: FixedJacobianNode.cpp:131
const math::Jacobian & getJacobian() const override final
Definition: FixedJacobianNode.cpp:113
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:131
Eigen::Matrix< double, 6, Eigen::Dynamic > Jacobian
Definition: MathTypes.hpp:108
Definition: BulletCollisionDetector.cpp:63
Definition: FixedJacobianNode.hpp:138
math::Jacobian mBodyJacobian
Cached Jacobian of this Fixed Frame.
Definition: FixedJacobianNode.hpp:142
math::Jacobian mWorldJacobianClassicDeriv
Classic time derivative of the Fixed Frame Jacobian.
Definition: FixedJacobianNode.hpp:157
math::Jacobian mBodyJacobianSpatialDeriv
Spatial time derivative of Fixed Frame Jacobian.
Definition: FixedJacobianNode.hpp:152
math::Jacobian mWorldJacobian
Cached World Jacobian of this Fixed Frame.
Definition: FixedJacobianNode.hpp:147