DART  6.6.2
SkeletonAspect.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2018, 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_DETAIL_SKELETONASPECT_HPP_
34 #define DART_DYNAMICS_DETAIL_SKELETONASPECT_HPP_
35 
40 #include <Eigen/Core>
41 
42 namespace dart {
43 namespace dynamics {
44 
45 class Skeleton;
46 
47 namespace detail {
48 
49 //==============================================================================
54 {
56  std::string mName;
57 
61  bool mIsMobile;
62 
64  Eigen::Vector3d mGravity;
65 
67  double mTimeStep;
68 
72 
77 
80  const std::string& _name = "Skeleton",
81  bool _isMobile = true,
82  const Eigen::Vector3d& _gravity = Eigen::Vector3d(0.0, 0.0, -9.81),
83  double _timeStep = 0.001,
84  bool _enabledSelfCollisionCheck = false,
85  bool _enableAdjacentBodyCheck = false);
86 
87  virtual ~SkeletonAspectProperties() = default;
88 };
89 
90 //==============================================================================
91 using BodyNodeStateVector = std::vector<common::Composite::State>;
92 using BodyNodePropertiesVector = std::vector<common::Composite::Properties>;
93 using JointStateVector = std::vector<common::Composite::State>;
94 using JointPropertiesVector = std::vector<common::Composite::Properties>;
95 
96 //==============================================================================
97 void setAllBodyNodeStates(Skeleton* skel, const BodyNodeStateVector& states);
98 
99 //==============================================================================
101 
102 //==============================================================================
105 
106 //==============================================================================
108 
109 //==============================================================================
113 
114 //==============================================================================
118 
119 //==============================================================================
122 
123 //==============================================================================
124 void setAllJointStates(Skeleton* skel, const JointStateVector& states);
125 
126 //==============================================================================
128 
129 //==============================================================================
132 
133 //==============================================================================
135 
136 //==============================================================================
140 
141 //==============================================================================
145 
146 //==============================================================================
149 
150 //==============================================================================
153 
154 //==============================================================================
157 
158 } // namespace detail
159 } // namespace dynamics
160 } // namespace dart
161 
162 #endif // DART_DYNAMICS_DETAIL_SKELETONASPECT_HPP_
BodyPropPtr properties
Definition: SdfParser.cpp:80
If your Aspect has Properties, then that Properties class should inherit this Aspect::Properties clas...
Definition: Aspect.hpp:83
If your Aspect has a State, then that State class should inherit this Aspect::State class.
Definition: Aspect.hpp:64
This is an alternative to EmbedProperties which allows your class to also inherit other Composite obj...
Definition: EmbeddedAspect.hpp:248
Definition: Cloneable.hpp:140
Definition: ProxyAspect.hpp:57
RequiresAspect allows classes that inherit Composite to know which Aspects are required for their ope...
Definition: RequiresAspect.hpp:48
class Skeleton
Definition: Skeleton.hpp:59
BodyNodePropertiesVector getAllBodyNodeProperties(const Skeleton *skel)
Definition: Skeleton.cpp:213
common::ProxyCloneable< common::Aspect::State, Skeleton, BodyNodeStateVector, &setAllBodyNodeStates, &getAllBodyNodeStates > BodyNodeVectorProxyAspectState
Definition: SkeletonAspect.hpp:112
std::vector< common::Composite::State > JointStateVector
Definition: SkeletonAspect.hpp:93
std::vector< common::Composite::State > BodyNodeStateVector
Definition: SkeletonAspect.hpp:91
common::ProxyCloneable< common::Aspect::State, Skeleton, JointStateVector, &setAllJointStates, &getAllJointStates > JointVectorProxyAspectState
Definition: SkeletonAspect.hpp:139
JointPropertiesVector getAllJointProperties(const Skeleton *skel)
Definition: Skeleton.cpp:250
void setAllJointProperties(Skeleton *skel, const JointPropertiesVector &properties)
Definition: Skeleton.cpp:240
std::vector< common::Composite::Properties > JointPropertiesVector
Definition: SkeletonAspect.hpp:94
JointStateVector getAllJointStates(const Skeleton *skel)
Definition: Skeleton.cpp:231
void setAllBodyNodeProperties(Skeleton *skel, const BodyNodePropertiesVector &properties)
Definition: Skeleton.cpp:203
common::ProxyStateAndPropertiesAspect< Skeleton, BodyNodeVectorProxyAspectState, BodyNodeVectorProxyAspectProperties > BodyNodeVectorProxyAspect
Definition: SkeletonAspect.hpp:121
std::vector< common::Composite::Properties > BodyNodePropertiesVector
Definition: SkeletonAspect.hpp:92
void setAllBodyNodeStates(Skeleton *skel, const BodyNodeStateVector &states)
Definition: Skeleton.cpp:185
BodyNodeStateVector getAllBodyNodeStates(const Skeleton *skel)
Definition: Skeleton.cpp:194
void setAllJointStates(Skeleton *skel, const JointStateVector &states)
Definition: Skeleton.cpp:222
Definition: BulletCollisionDetector.cpp:63
The Properties of this Skeleton which are independent of the components within the Skeleton,...
Definition: SkeletonAspect.hpp:54
bool mEnabledAdjacentBodyCheck
True if self collision check is enabled, including adjacent bodies.
Definition: SkeletonAspect.hpp:76
double mTimeStep
Time step for implicit joint damping force.
Definition: SkeletonAspect.hpp:67
std::string mName
Name of the Skeleton.
Definition: SkeletonAspect.hpp:56
Eigen::Vector3d mGravity
Gravity vector.
Definition: SkeletonAspect.hpp:64
SkeletonAspectProperties(const std::string &_name="Skeleton", bool _isMobile=true, const Eigen::Vector3d &_gravity=Eigen::Vector3d(0.0, 0.0, -9.81), double _timeStep=0.001, bool _enabledSelfCollisionCheck=false, bool _enableAdjacentBodyCheck=false)
Default constructor.
Definition: Skeleton.cpp:167
bool mEnabledSelfCollisionCheck
True if self collision check is enabled.
Definition: SkeletonAspect.hpp:71
bool mIsMobile
If the skeleton is not mobile, its dynamic effect is equivalent to having infinite mass.
Definition: SkeletonAspect.hpp:61