DART 6.10.1
Loading...
Searching...
No Matches
SimpleFrame.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_SIMPLEFRAME_HPP_
34#define DART_DYNAMICS_SIMPLEFRAME_HPP_
35
37
38namespace dart {
39namespace dynamics {
40
51class SimpleFrame : public Detachable, public ShapeFrame
52{
53public:
55
56
57 explicit SimpleFrame(
58 Frame* _refFrame = Frame::World(),
59 const std::string& _name = "simple_frame",
60 const Eigen::Isometry3d& _relativeTransform
61 = Eigen::Isometry3d::Identity());
62
66 const SimpleFrame& _otherFrame, Frame* _refFrame = Frame::World());
67
69 ~SimpleFrame() override;
70
71 // Documentation inherited
72 const std::string& setName(const std::string& _name) override;
73
74 // Documentation inherited
75 const std::string& getName() const override;
76
80 std::shared_ptr<SimpleFrame> clone(Frame* _refFrame = Frame::World()) const;
81
86 void copy(
87 const Frame& _otherFrame,
88 Frame* _refFrame = Frame::World(),
89 bool _copyProperties = true);
90
92 void copy(
93 const Frame* _otherFrame,
94 Frame* _refFrame = Frame::World(),
95 bool _copyProperties = true);
96
99 SimpleFrame& operator=(const SimpleFrame& _otherFrame);
100
105 std::shared_ptr<SimpleFrame> spawnChildSimpleFrame(
106 const std::string& name = "SimpleFrame",
107 const Eigen::Isometry3d& relativeTransform
108 = Eigen::Isometry3d::Identity());
109
110 //--------------------------------------------------------------------------
111 // Transform
112 //--------------------------------------------------------------------------
113
115 void setRelativeTransform(const Eigen::Isometry3d& _newRelTransform);
116
118 void setRelativeTranslation(const Eigen::Vector3d& _newTranslation);
119
121 void setRelativeRotation(const Eigen::Matrix3d& _newRotation);
122
126 void setTransform(
127 const Eigen::Isometry3d& _newTransform,
128 const Frame* _withRespectTo = Frame::World());
129
133 void setTranslation(
134 const Eigen::Vector3d& _newTranslation,
135 const Frame* _withRespectTo = Frame::World());
136
140 void setRotation(
141 const Eigen::Matrix3d& _newRotation,
142 const Frame* _withRespectTo = Frame::World());
143
144 // Documentation inherited
145 const Eigen::Isometry3d& getRelativeTransform() const override;
146
147 //--------------------------------------------------------------------------
148 // Velocity
149 //--------------------------------------------------------------------------
150
159 void setRelativeSpatialVelocity(const Eigen::Vector6d& _newSpatialVelocity);
160
167 const Eigen::Vector6d& _newSpatialVelocity,
168 const Frame* _inCoordinatesOf);
169
170 // Documentation inherited
171 const Eigen::Vector6d& getRelativeSpatialVelocity() const override;
172
173 //--------------------------------------------------------------------------
174 // Acceleration
175 //--------------------------------------------------------------------------
176
183 const Eigen::Vector6d& _newSpatialAcceleration);
184
188 const Eigen::Vector6d& _newSpatialAcceleration,
189 const Frame* _inCoordinatesOf);
190
191 // Documentation inherited
192 const Eigen::Vector6d& getRelativeSpatialAcceleration() const override;
193
194 // Documentation inherited
195 const Eigen::Vector6d& getPrimaryRelativeAcceleration() const override;
196
197 // Documentation inherited
198 const Eigen::Vector6d& getPartialAcceleration() const override;
199
200 //--------------------------------------------------------------------------
201 // Classic Method
202 //--------------------------------------------------------------------------
203
218 const Eigen::Vector3d& _linearVelocity = Eigen::Vector3d::Zero(),
219 const Eigen::Vector3d& _angularVelocity = Eigen::Vector3d::Zero(),
220 const Eigen::Vector3d& _linearAcceleration = Eigen::Vector3d::Zero(),
221 const Eigen::Vector3d& _angularAcceleration = Eigen::Vector3d::Zero());
222
223protected:
225 std::string mName;
226
228 Eigen::Isometry3d mRelativeTf;
229
232
235
238
239public:
240 // To get byte-aligned Eigen vectors
241 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
242};
243
244} // namespace dynamics
245} // namespace dart
246
247#endif // DART_DYNAMICS_SIMPLEFRAME_HPP_
#define DART_DEFINE_ALIGNED_SHARED_OBJECT_CREATOR(class_name)
Definition Memory.hpp:155
std::string * name
Definition SkelParser.cpp:1697
The Detachable class is a special case of the Entity base class.
Definition Entity.hpp:238
The Frame class serves as the backbone of DART's kinematic tree structure.
Definition Frame.hpp:58
static Frame * World()
Definition Frame.cpp:73
Definition ShapeFrame.hpp:192
The SimpleFrame class offers a user-friendly way of creating arbitrary Frames within the kinematic tr...
Definition SimpleFrame.hpp:52
std::shared_ptr< SimpleFrame > clone(Frame *_refFrame=Frame::World()) const
Create a new SimpleFrame with the same world transform, velocity, and acceleration as this one.
Definition SimpleFrame.cpp:101
void setRelativeRotation(const Eigen::Matrix3d &_newRotation)
Set the relative rotation of this SimpleFrame.
Definition SimpleFrame.cpp:176
std::string mName
Name of this SimpleFrame.
Definition SimpleFrame.hpp:225
void copy(const Frame &_otherFrame, Frame *_refFrame=Frame::World(), bool _copyProperties=true)
Make the world transform, world velocity, and world acceleration of this SimpleFrame match another Fr...
Definition SimpleFrame.cpp:107
const Eigen::Vector6d & getRelativeSpatialAcceleration() const override
Get the spatial acceleration of this Frame relative to its parent Frame, in the coordinates of this F...
Definition SimpleFrame.cpp:258
Eigen::Isometry3d mRelativeTf
Relative transform of the SimpleFrame.
Definition SimpleFrame.hpp:228
void setRelativeSpatialVelocity(const Eigen::Vector6d &_newSpatialVelocity)
Set the spatial velocity of this SimpleFrame relative to its parent Frame.
Definition SimpleFrame.cpp:213
void setClassicDerivatives(const Eigen::Vector3d &_linearVelocity=Eigen::Vector3d::Zero(), const Eigen::Vector3d &_angularVelocity=Eigen::Vector3d::Zero(), const Eigen::Vector3d &_linearAcceleration=Eigen::Vector3d::Zero(), const Eigen::Vector3d &_angularAcceleration=Eigen::Vector3d::Zero())
Set the relative velocity and acceleration of this Frame according to classical (non-spatial) relativ...
Definition SimpleFrame.cpp:278
Eigen::Vector6d mRelativeAcceleration
Relative spatial acceleration of the SimpleFrame.
Definition SimpleFrame.hpp:234
void setRelativeTransform(const Eigen::Isometry3d &_newRelTransform)
Set the relative transform of this SimpleFrame.
Definition SimpleFrame.cpp:161
const Eigen::Vector6d & getPrimaryRelativeAcceleration() const override
The Featherstone ABI algorithm exploits a component of the spatial acceleration which we refer to as ...
Definition SimpleFrame.cpp:264
Eigen::Vector6d mPartialAcceleration
Partial Acceleration of this Frame.
Definition SimpleFrame.hpp:237
const std::string & getName() const override
Return the name of this Entity.
Definition SimpleFrame.cpp:95
~SimpleFrame() override
Destructor.
Definition SimpleFrame.cpp:74
void setTransform(const Eigen::Isometry3d &_newTransform, const Frame *_withRespectTo=Frame::World())
Set the transform of this SimpleFrame so that its transform with respect to Frame _withRespectTo is e...
Definition SimpleFrame.cpp:183
std::shared_ptr< SimpleFrame > spawnChildSimpleFrame(const std::string &name="SimpleFrame", const Eigen::Isometry3d &relativeTransform=Eigen::Isometry3d::Identity())
Spawn a child SimpleFrame to this SimpleFrame.
Definition SimpleFrame.cpp:154
const Eigen::Vector6d & getRelativeSpatialVelocity() const override
Get the spatial velocity of this Frame relative to its parent Frame, in its own coordinates.
Definition SimpleFrame.cpp:232
const Eigen::Isometry3d & getRelativeTransform() const override
Get the transform of this Frame with respect to its parent Frame.
Definition SimpleFrame.cpp:207
void setRelativeSpatialAcceleration(const Eigen::Vector6d &_newSpatialAcceleration)
Set the spatial acceleration of this SimpleFrame relative to its parent Frame.
Definition SimpleFrame.cpp:238
void setRotation(const Eigen::Matrix3d &_newRotation, const Frame *_withRespectTo=Frame::World())
Set the rotation of this SimpleFrame so that its rotation with respect to Frame _withRespectTo is equ...
Definition SimpleFrame.cpp:199
const std::string & setName(const std::string &_name) override
Set name.
Definition SimpleFrame.cpp:80
void setTranslation(const Eigen::Vector3d &_newTranslation, const Frame *_withRespectTo=Frame::World())
Set the translation of this SimpleFrame so that its translation with respect to Frame _withRespectTo ...
Definition SimpleFrame.cpp:191
const Eigen::Vector6d & getPartialAcceleration() const override
The Featherstone ABI algorithm exploits a component of the spatial acceleration which we refer to as ...
Definition SimpleFrame.cpp:270
SimpleFrame & operator=(const SimpleFrame &_otherFrame)
Same as copy(const Frame&) except the parent frame of this SimpleFrame is left the same,...
Definition SimpleFrame.cpp:147
void setRelativeTranslation(const Eigen::Vector3d &_newTranslation)
Set the relative translation of this SimpleFrame.
Definition SimpleFrame.cpp:169
Eigen::Vector6d mRelativeVelocity
Relative spatial velocity of the SimpleFrame.
Definition SimpleFrame.hpp:231
Matrix< double, 6, 1 > Vector6d
Definition MathTypes.hpp:49
Definition BulletCollisionDetector.cpp:65