Go to the documentation of this file.
6 #ifndef CNOID_BODY_DYBODY_H
7 #define CNOID_BODY_DYBODY_H
13 #include "exportdecl.h"
27 DySubBody(
DyLink* rootLink, std::multimap<Link*, ForceSensor*>& forceSensorMap);
30 std::vector<DyLink*>&
links(){
return links_; }
32 DyLink*
link(
int localIndex){
return links_[localIndex]; }
37 const std::vector<ForceSensor*>&
forceSensors() {
return forceSensors_; }
39 void clearExternalForces();
40 void calcSpatialForwardKinematics();
45 std::vector<DyLink*> links_;
46 std::unique_ptr<ForwardDynamics> forwardDynamics_;
56 std::vector<ForceSensor*> forceSensors_;
61 bool hasConstrainedLinks;
62 bool hasContactStateSensingLinks;
63 bool isTestForceBeingApplied;
67 void initialize(
DyLink* rootLink, std::multimap<Link*, ForceSensor*>& forceSensorMap);
68 void extractLinksInSubBody(
69 DyLink* link, std::multimap<Link*, ForceSensor*>& forceSensorMap,
bool& hasHighgainJoints);
82 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
88 virtual void initializeState()
override;
123 double uu()
const {
return uu_; }
124 double&
uu() {
return uu_; }
125 double dd()
const {
return dd_; }
126 double&
dd() {
return dd_; }
129 [[deprecated(
"Use Link::ContactState.")]]
131 [[deprecated(
"Use vector<Link::ContactState>.")]]
133 [[deprecated(
"Use Link::contactStates.")]]
135 [[deprecated(
"Use Link::contactStates.")]]
138 virtual void prependChild(
Link* link)
override;
139 virtual void appendChild(
Link* link)
override;
175 struct ConstraintForceSolverData
184 int numberToCheckAccelCalcSkip;
186 ConstraintForceSolverData cfs;
188 struct ForwardDynamicsCbmData
191 bool hasForceSensorsAbove;
194 ForwardDynamicsCbmData()
195 : hasForceSensor(false),
196 hasForceSensorsAbove(false),
200 std::unique_ptr<ForwardDynamicsCbmData> cbm;
223 virtual Link* createLink(
const Link* org =
nullptr)
const override;
237 const std::vector<DyLink*>&
links()
const {
238 return reinterpret_cast<const std::vector<DyLink*>&
>(
Body::links());
241 void initializeSubBodies();
243 std::vector<DySubBodyPtr>&
subBodies(){
return subBodies_; }
245 void calcSpatialForwardKinematics();
251 std::vector<DySubBodyPtr> subBodies_;
const Vector3 & cv() const
Definition: DyBody.h:105
ref_ptr< DyBody > DyBodyPtr
Definition: DyBody.h:17
Vector3 & hhw()
Definition: DyBody.h:122
DyLink * link(int localIndex)
Definition: DyBody.h:32
Link * sibling() const
Definition: Link.h:59
const Vector3 & hhv() const
Definition: DyBody.h:119
ref_ptr< DyLink > DyLinkPtr
Definition: DyBody.h:19
DyLink * sibling() const
Definition: DyBody.h:94
const std::vector< ForceSensor * > & forceSensors()
Definition: DyBody.h:37
double uu() const
Definition: DyBody.h:123
Eigen::Vector3d Vector3
Definition: EigenTypes.h:57
ForwardDynamicsCBM * forwardDynamicsCBM()
Definition: DyBody.h:36
bool isStatic() const
Definition: DyBody.h:33
double & dd()
Definition: DyBody.h:126
Vector3 & cv()
Definition: DyBody.h:106
DyLink * child() const
Definition: DyBody.h:95
const Vector3 & ptau() const
Definition: DyBody.h:117
Matrix3 & Iww()
Definition: DyBody.h:110
std::vector< DyLink * > & links()
Definition: DyBody.h:30
const Vector3 & vo() const
Definition: DyBody.h:97
Matrix3 & Iwv()
Definition: DyBody.h:112
DyLink * parent() const
Definition: DyBody.h:93
Body * body()
Definition: Link.h:56
std::vector< ContactPoint > & contactPoints()
Definition: Link.h:362
Eigen::Matrix3d Matrix3
Definition: EigenTypes.h:56
Vector3 & vo()
Definition: DyBody.h:98
double & uu()
Definition: DyBody.h:124
std::vector< ContactPoint > ConstraintForceArray
Definition: DyBody.h:132
Vector3 & sw()
Definition: DyBody.h:102
Vector3 & hhv()
Definition: DyBody.h:120
const Vector3 & sw() const
Definition: DyBody.h:101
Definition: ForwardDynamicsCBM.h:24
DyLink * link(int index) const
Definition: DyBody.h:228
Vector3 & cw()
Definition: DyBody.h:108
DySubBody * subBody()
Definition: DyBody.h:90
ref_ptr< DySubBody > DySubBodyPtr
Definition: DyBody.h:74
Matrix3 & Ivv()
Definition: DyBody.h:114
Link * rootLink() const
Definition: Body.h:104
const Matrix3 & Ivv() const
Definition: DyBody.h:113
Definition: AbstractSceneLoader.h:11
Definition: CloneMap.h:13
DyLink * joint(int id) const
Definition: DyBody.h:225
const std::vector< DyLink * > & links() const
Definition: DyBody.h:237
Vector3 & pf()
Definition: DyBody.h:116
Link * parent() const
Definition: Link.h:58
bool isSubBodyRoot() const
Definition: DyBody.h:91
Link * link(int index) const
Definition: Body.h:80
DyLink * rootLink() const
Definition: DyBody.h:234
const std::vector< ContactPoint > & constraintForces() const
Definition: DyBody.h:136
Definition: Referenced.h:54
const Matrix3 & Iww() const
Definition: DyBody.h:109
const Matrix3 & Iwv() const
Definition: DyBody.h:111
Vector3 & ptau()
Definition: DyBody.h:118
Vector3 & sv()
Definition: DyBody.h:104
std::vector< ContactPoint > & constraintForces()
Definition: DyBody.h:134
const Vector3 & pf() const
Definition: DyBody.h:115
const Vector3 & dvo() const
Definition: DyBody.h:99
Link::ContactPoint ConstraintForce
Definition: DyBody.h:130
Link * child() const
Definition: Link.h:60
const std::vector< Link * > & links() const
Definition: Body.h:97
Definition: ConstraintForceSolver.h:19
DyLink * link(const std::string &name) const
Definition: DyBody.h:231
ForwardDynamics * forwardDynamics()
Definition: DyBody.h:35
Link * joint(int id) const
Definition: Body.h:145
DyBody * body()
Definition: DyBody.h:257
DyLink * rootLink()
Definition: DyBody.h:29
Definition: ForwardDynamics.h:22
const Vector3 & hhw() const
Definition: DyBody.h:121
double dd() const
Definition: DyBody.h:125
const Vector3 & cw() const
Definition: DyBody.h:107
int numLinks() const
Definition: DyBody.h:31
Vector3 & dvo()
Definition: DyBody.h:100
const Vector3 & sv() const
Definition: DyBody.h:103
std::vector< DySubBodyPtr > & subBodies()
Definition: DyBody.h:243