33 #ifndef DART_DYNAMICS_SKELETON_HPP_ 34 #define DART_DYNAMICS_SKELETON_HPP_ 37 #include "dart/common/NameManager.hpp" 38 #include "dart/common/VersionCounter.hpp" 39 #include "dart/dynamics/EndEffector.hpp" 40 #include "dart/dynamics/HierarchicalIK.hpp" 41 #include "dart/dynamics/Joint.hpp" 42 #include "dart/dynamics/Marker.hpp" 43 #include "dart/dynamics/MetaSkeleton.hpp" 44 #include "dart/dynamics/ShapeNode.hpp" 45 #include "dart/dynamics/SmartPointer.hpp" 46 #include "dart/dynamics/SpecializedNodeManager.hpp" 47 #include "dart/dynamics/detail/BodyNodeAspect.hpp" 48 #include "dart/dynamics/detail/SkeletonAspect.hpp" 54 DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_BEGIN
81 CONFIG_POSITIONS = 1 << 1,
82 CONFIG_VELOCITIES = 1 << 2,
83 CONFIG_ACCELERATIONS = 1 << 3,
84 CONFIG_FORCES = 1 << 4,
85 CONFIG_COMMANDS = 1 << 5,
97 const Eigen::VectorXd& positions = Eigen::VectorXd(),
98 const Eigen::VectorXd& velocities = Eigen::VectorXd(),
99 const Eigen::VectorXd& accelerations = Eigen::VectorXd(),
100 const Eigen::VectorXd& forces = Eigen::VectorXd(),
101 const Eigen::VectorXd& commands = Eigen::VectorXd());
104 const std::vector<std::size_t>& indices,
105 const Eigen::VectorXd& positions = Eigen::VectorXd(),
106 const Eigen::VectorXd& velocities = Eigen::VectorXd(),
107 const Eigen::VectorXd& accelerations = Eigen::VectorXd(),
108 const Eigen::VectorXd& forces = Eigen::VectorXd(),
109 const Eigen::VectorXd& commands = Eigen::VectorXd());
142 static SkeletonPtr
create(
const std::string& _name =
"Skeleton");
145 static SkeletonPtr
create(
const AspectPropertiesData& properties);
151 ConstSkeletonPtr
getPtr()
const;
179 SkeletonPtr
clone() const;
186 SkeletonPtr
clone(const
std::
string& cloneName) const;
198 const
std::
string& cloneName) const override;
214 const
std::vector<
std::
size_t>& indices,
int flags = CONFIG_ALL) const;
251 const
std::
string&
setName(const
std::
string& _name) override;
328 template <class JointType, class NodeType =
BodyNode>
331 const typename JointType::
Properties& _jointProperties
333 const typename NodeType::Properties& _bodyProperties
334 = typename NodeType::Properties());
405 const
std::
string& name) const override;
412 const
BodyNode* _bn,
bool _warning = true) const override;
458 const
Joint* _joint,
bool _warning = true) const override;
490 std::
size_t _treeIdx) const;
521 DART_BAKE_SPECIALIZED_NODE_SKEL_DECLARATIONS(
Marker)
523 DART_BAKE_SPECIALIZED_NODE_SKEL_DECLARATIONS(
ShapeNode)
525 DART_BAKE_SPECIALIZED_NODE_SKEL_DECLARATIONS(
EndEffector)
534 void integratePositions(
double _dt);
537 void integrateVelocities(
double _dt);
544 const
Eigen::VectorXd& _q2, const
Eigen::VectorXd& _q1) const;
550 const
Eigen::VectorXd& _dq2, const
Eigen::VectorXd& _dq1) const;
582 std::
size_t _treeIdx) const;
639 bool _updateTransforms = true,
640 bool _updateVels = true,
641 bool _updateAccs = true);
677 bool _withExternalForces = false,
678 bool _withDampingForces = false,
679 bool _withSpringForces = false);
705 const
Eigen::Vector6d& _imp1,
707 const
Eigen::Vector6d& _imp2);
713 const
Eigen::Vector3d& _imp);
744 const
Eigen::Vector3d& _localOffset) const override;
749 const
Eigen::Vector3d& _localOffset,
750 const
Frame* _inCoordinatesOf) const override;
758 const
Eigen::Vector3d& _localOffset) const override;
763 const
Frame* _inCoordinatesOf =
Frame::World()) const override;
768 const
Eigen::Vector3d& _localOffset,
769 const
Frame* _inCoordinatesOf =
Frame::World()) const override;
774 const
Frame* _inCoordinatesOf =
Frame::World()) const override;
787 const
Eigen::Vector3d& _localOffset) const override;
792 const
Eigen::Vector3d& _localOffset,
793 const
Frame* _inCoordinatesOf) const override;
806 const
Eigen::Vector3d& _localOffset,
807 const
Frame* _inCoordinatesOf =
Frame::World()) const override;
812 const
Frame* _inCoordinatesOf =
Frame::World()) const override;
817 const
Eigen::Vector3d& _localOffset,
818 const
Frame* _inCoordinatesOf =
Frame::World()) const override;
823 const
Frame* _inCoordinatesOf =
Frame::World()) const override;
834 double getMass() const override;
874 std::
size_t _treeIdx) const;
934 const
Frame* _withRespectTo =
Frame::World()) const override;
940 const
Frame* _inCoordinatesOf =
Frame::World()) const override;
946 const
Frame* _inCoordinatesOf =
Frame::World()) const override;
952 const
Frame* _inCoordinatesOf =
Frame::World()) const override;
958 const
Frame* _inCoordinatesOf =
Frame::World()) const override;
963 const
Frame* _inCoordinatesOf =
Frame::World()) const override;
968 const
Frame* _inCoordinatesOf =
Frame::World()) const override;
977 const
Frame* _inCoordinatesOf =
Frame::World()) const override;
986 const
Frame* _inCoordinatesOf =
Frame::World()) const override;
1007 Skeleton(const AspectPropertiesData& _properties);
1010 void setPtr(const SkeletonPtr& _ptr);
1022 void registerNode(NodeMap& nodeMap, Node* _newNode,
std::
size_t& _index);
1044 Joint* _parentJoint,
1045 BodyNode* _bodyNode,
1046 SkeletonPtr _newSkeleton,
1047 BodyNode* _parentNode);
1053 template <class JointType>
1055 BodyNode* _bodyNode,
1056 const SkeletonPtr& _newSkeleton,
1057 BodyNode* _parentNode,
1058 const typename JointType::Properties& _joint);
1063 Joint* _parentJoint,
1064 const BodyNode* _bodyNode,
1065 const SkeletonPtr& _newSkeleton,
1066 BodyNode* _parentNode,
1067 bool _recursive) const;
1071 template <class JointType>
1073 const BodyNode* _bodyNode,
1074 const SkeletonPtr& _newSkeleton,
1075 BodyNode* _parentNode,
1076 const typename JointType::Properties& _joint,
1077 bool _recursive) const;
1081 const BodyNode* _bodyNode) const;
1166 Joint* _newJoint,
bool _updateDofNames = true);
1171 void updateNameManagerNames();
1300 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
1303 mutable common::aligned_vector<DataCache> mTreeCache;
1307 using SpecializedTreeNodes
1308 = std::map<std::type_index, std::vector<NodeMap::iterator>*>;
1310 SpecializedTreeNodes mSpecializedTreeNodes;
1319 mutable std::mutex mMutex;
1328 mUnionRootSkeleton =
mPtr;
1333 std::weak_ptr<Skeleton> mUnionRootSkeleton;
1336 std::size_t mUnionSize;
1339 std::size_t mUnionIndex;
1341 DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_END
1346 #include "dart/dynamics/detail/Skeleton.hpp" 1348 #endif // DART_DYNAMICS_SKELETON_HPP_ const Eigen::VectorXd & getGravityForces() const override
Get gravity force vector of the MetaSkeleton.
Definition: Skeleton.cpp:2067
void clearIK()
Wipe away the WholeBodyIK module for this Skeleton, leaving it as a nullptr.
Definition: Skeleton.cpp:1544
Eigen::Vector6d getCOMSpatialVelocity(const Frame *_relativeTo=Frame::World(), const Frame *_inCoordinatesOf=Frame::World()) const override
Get the Skeleton's COM spatial velocity in terms of any Frame (default is World Frame) ...
Definition: Skeleton.cpp:4118
double computeKineticEnergy() const override
Get the kinetic energy of this MetaSkeleton.
Definition: Skeleton.cpp:4030
static SkeletonPtr create(const std::string &_name="Skeleton")
Create a new Skeleton inside of a shared_ptr.
Definition: Skeleton.cpp:384
bool mSupport
Dirty flag for the support polygon.
Definition: Skeleton.hpp:1231
void updateCoriolisForces() const
Update Coriolis force vector of the skeleton.
Definition: Skeleton.cpp:3265
std::size_t getNumDofs() const override
Return the number of degrees of freedom in this skeleton.
Definition: Skeleton.cpp:1201
Eigen::MatrixXd mInvAugM
Inverse of augmented mass matrix for the skeleton.
Definition: Skeleton.hpp:1264
std::size_t getSupportVersion() const
The version number of a support polygon will be incremented each time the support polygon needs to be...
Definition: Skeleton.cpp:3674
void setAdjacentBodyCheck(bool enable)
Set whether to check adjacent bodies.
Definition: Skeleton.cpp:778
void unregisterBodyNode(BodyNode *_oldBodyNode)
Remove a BodyNode from the Skeleton. Internal use only.
Definition: Skeleton.cpp:2381
bool hasJoint(const Joint *joint) const override
Returns whether this Skeleton contains join.
Definition: Skeleton.cpp:1182
void disableSelfCollision()
Deprecated. Please use disableSelfCollisionCheck() instead.
Definition: Skeleton.cpp:741
void enableAdjacentBodyCheck()
Enable collision check for adjacent bodies.
Definition: Skeleton.cpp:790
class Joint
Definition: Joint.hpp:57
bool mInvMassMatrix
Dirty flag for the inverse of mass matrix.
Definition: Skeleton.hpp:1210
Joint * getJoint(std::size_t _idx) override
Get Joint whose index is _idx.
Definition: Skeleton.cpp:1105
dart::common::NameManager< BodyNode * > mNameMgrForBodyNodes
NameManager for tracking BodyNodes.
Definition: Skeleton.hpp:1181
void updateCoriolisAndGravityForces() const
Update combined vector of the skeleton.
Definition: Skeleton.cpp:3378
const Eigen::MatrixXd & getMassMatrix() const override
Get the Mass Matrix of the MetaSkeleton.
Definition: Skeleton.cpp:1978
SkeletonPtr cloneSkeleton() const
Creates and returns a clone of this Skeleton.
Definition: Skeleton.cpp:455
math::AngularJacobian getAngularJacobianDeriv(const JacobianNode *_node, const Frame *_inCoordinatesOf=Frame::World()) const override
Get the angular Jacobian time derivative of a BodyNode.
Definition: Skeleton.cpp:1957
const Eigen::MatrixXd & getInvAugMassMatrix() const override
Get inverse of augmented Mass Matrix of the MetaSkeleton.
Definition: Skeleton.cpp:2031
SoftBodyNode represent a soft body that has one deformable skin.
Definition: SoftBodyNode.hpp:45
bool mDampingForces
Dirty flag for the damping force vector.
Definition: Skeleton.hpp:1228
bool mGravityForces
Dirty flag for the gravity force vector.
Definition: Skeleton.hpp:1216
const std::string & addEntryToJointNameMgr(Joint *_newJoint, bool _updateDofNames=true)
Add a Joint to to the Joint NameManager.
Definition: Skeleton.cpp:692
math::Jacobian getJacobian(const JacobianNode *_node) const override
Get the spatial Jacobian targeting the origin of a BodyNode.
Definition: Skeleton.cpp:1698
const Eigen::Vector3d & getGravity() const
Get 3-dim gravitational acceleration.
Definition: Skeleton.cpp:845
virtual ~Skeleton()
Destructor.
Definition: Skeleton.cpp:436
math::LinearJacobian getLinearJacobian(const JacobianNode *_node, const Frame *_inCoordinatesOf=Frame::World()) const override
Get the linear Jacobian targeting the origin of a BodyNode.
Definition: Skeleton.cpp:1774
std::pair< Eigen::Vector3d, Eigen::Vector3d > mSupportAxes
A pair of vectors which map the 2D coordinates of the support polygon into 3D space.
Definition: Skeleton.hpp:1291
The Node class is a base class for BodyNode and any object that attaches to a BodyNode.
Definition: Node.hpp:79
The MakeCloneable class is used to easily create an Cloneable (such as Node::State) which simply take...
Definition: Cloneable.hpp:83
Definition: CompositeData.hpp:106
const Eigen::VectorXd & getCoriolisForces() const override
Get Coriolis force vector of the MetaSkeleton's BodyNodes.
Definition: Skeleton.cpp:2049
void updateBiasImpulse(BodyNode *_bodyNode)
Update bias impulses.
Definition: Skeleton.cpp:3821
SoftBodyNode * getSoftBodyNode(std::size_t _idx)
Get SoftBodyNode whose index is _idx.
Definition: Skeleton.cpp:935
void clearCollidingBodies() override
Clear collision flags of the BodyNodes in this MetaSkeleton.
Definition: Skeleton.cpp:4056
dart::common::NameManager< Joint * > mNameMgrForJoints
NameManager for tracking Joints.
Definition: Skeleton.hpp:1184
Eigen::VectorXd mAccelerations
Joint accelerations.
Definition: Skeleton.hpp:122
Eigen::VectorXd mPositions
Joint positions.
Definition: Skeleton.hpp:116
void unregisterJoint(Joint *_oldJoint)
Remove a Joint from the Skeleton. Internal use only.
Definition: Skeleton.cpp:2453
math::SupportGeometry mSupportGeometry
Support geometry – only used for temporary storage purposes.
Definition: Skeleton.hpp:1294
The Frame class serves as the backbone of DART's kinematic tree structure.
Definition: Frame.hpp:57
const Eigen::MatrixXd & getInvMassMatrix() const override
Get inverse of Mass Matrix of the MetaSkeleton.
Definition: Skeleton.cpp:2013
void setImpulseApplied(bool _val)
Set whether this skeleton is constrained.
Definition: Skeleton.cpp:3991
Eigen::VectorXd mFext
External force vector for the skeleton.
Definition: Skeleton.hpp:1277
Eigen::MatrixXd mM
Mass matrix cache.
Definition: Skeleton.hpp:1255
Definition: MathTypes.hpp:47
void computeImpulseForwardDynamics()
Compute impulse-based forward dynamics.
Definition: Skeleton.cpp:4003
void computeInverseDynamics(bool _withExternalForces=false, bool _withDampingForces=false, bool _withSpringForces=false)
Computes inverse dynamics.
Definition: Skeleton.cpp:3749
const std::vector< BodyNode * > & getBodyNodes() override
Get all the BodyNodes that are held by this MetaSkeleton.
Definition: Skeleton.cpp:984
void receiveBodyNodeTree(const std::vector< BodyNode *> &_tree)
Take in and register a subtree of BodyNodes.
Definition: Skeleton.cpp:2761
const AspectProperties & getSkeletonProperties() const
Get the Properties of this Skeleton.
Definition: Skeleton.cpp:654
bool mExternalForces
Dirty flag for the external force vector.
Definition: Skeleton.hpp:1225
Definition: SharedLibraryManager.hpp:46
bool getSelfCollisionCheck() const
Return whether self-collision check is enabled.
Definition: Skeleton.cpp:754
bool checkIndexingConsistency() const
This function is only meant for debugging purposes.
Definition: Skeleton.cpp:1270
BodyNode * getRootBodyNode(std::size_t _treeIdx=0)
Get the root BodyNode of the tree whose index in this Skeleton is _treeIdx.
Definition: Skeleton.cpp:875
void setProperties(const Properties &properties)
Set all properties of this Skeleton.
Definition: Skeleton.cpp:625
const Eigen::Vector2d & getSupportCentroid() const
Get the centroid of the support polygon for this Skeleton.
Definition: Skeleton.cpp:3660
std::unique_ptr< common::LockableReference > getLockableReference() const override
Get the mutex that protects the state of this Skeleton.
Definition: Skeleton.cpp:428
VersionCounter is an interface for objects that count their versions.
Definition: VersionCounter.hpp:42
bool mCoriolisForces
Dirty flag for the Coriolis force vector.
Definition: Skeleton.hpp:1219
Eigen::Vector6d getCOMSpatialAcceleration(const Frame *_relativeTo=Frame::World(), const Frame *_inCoordinatesOf=Frame::World()) const override
Get the Skeleton's COM spatial acceleration in terms of any Frame (default is World Frame) ...
Definition: Skeleton.cpp:4136
double getMass() const override
Get total mass of the skeleton.
Definition: Skeleton.cpp:1964
bool mArticulatedInertia
Dirty flag for articulated body inertia.
Definition: Skeleton.hpp:1201
std::size_t getNumBodyNodes() const override
Get number of body nodes.
Definition: Skeleton.cpp:851
Eigen::MatrixXd mAugM
Mass matrix for the skeleton.
Definition: Skeleton.hpp:1258
Eigen::VectorXd mG
Gravity vector for the skeleton; computed in nonrecursive dynamics only.
Definition: Skeleton.hpp:1271
void updateTotalMass()
Update the computation for total mass.
Definition: Skeleton.cpp:2768
void notifySupportUpdate(std::size_t _treeIdx)
Notify that the support polygon of a tree needs to be updated.
Definition: Skeleton.cpp:3802
BodyNode * getBodyNode(std::size_t _idx) override
Get BodyNode whose index is _idx.
Definition: Skeleton.cpp:921
Definition: Skeleton.hpp:1195
bool isEnabledSelfCollisionCheck() const
Return true if self-collision check is enabled.
Definition: Skeleton.cpp:772
void disableSelfCollisionCheck()
Disable self-collision check.
Definition: Skeleton.cpp:766
dart::common::NameManager< SoftBodyNode * > mNameMgrForSoftBodyNodes
NameManager for tracking SoftBodyNodes.
Definition: Skeleton.hpp:1190
const std::shared_ptr< WholeBodyIK > & createIK()
Create a new WholeBodyIK module for this Skeleton.
Definition: Skeleton.cpp:1537
Eigen::VectorXd mFc
Constraint force vector.
Definition: Skeleton.hpp:1280
double computePotentialEnergy() const override
Get the potential energy of this MetaSkeleton.
Definition: Skeleton.cpp:4042
std::vector< const DegreeOfFreedom * > mConstDofs
Cache for const Degrees of Freedom, for the sake of the API.
Definition: Skeleton.hpp:1252
math::LinearJacobian getLinearJacobianDeriv(const JacobianNode *_node, const Frame *_inCoordinatesOf=Frame::World()) const override
of a BodyNode.
Definition: Skeleton.cpp:1921
Declaration of the variadic template.
Definition: SpecializedNodeManager.hpp:123
std::size_t mSupportVersion
Increments each time a new support polygon is computed to help keep track of changes in the support p...
Definition: Skeleton.hpp:1235
Eigen::VectorXd mCg
Combined coriolis and gravity vector which is C(q, dq)*dq + g(q).
Definition: Skeleton.hpp:1274
const Eigen::MatrixXd & getAugMassMatrix() const override
Get augmented mass matrix of the skeleton.
Definition: Skeleton.cpp:1995
void setAspectProperties(const AspectProperties &properties)
Set the AspectProperties of this Skeleton.
Definition: Skeleton.cpp:643
void enableSelfCollision(bool enableAdjacentBodyCheck=false)
Deprecated.
Definition: Skeleton.cpp:734
const std::shared_ptr< WholeBodyIK > & getOrCreateIK()
Get a pointer to a WholeBodyIK module for this Skeleton.
Definition: Skeleton.cpp:1525
Definition: Aspect.cpp:40
void setGravity(const Eigen::Vector3d &_gravity)
Set 3-dim gravitational acceleration.
Definition: Skeleton.cpp:836
The JacobianNode class serves as a common interface for BodyNodes and EndEffectors to both be used as...
Definition: JacobianNode.hpp:54
Eigen::VectorXd mCvec
Coriolis vector for the skeleton which is C(q,dq)*dq.
Definition: Skeleton.hpp:1267
void updateArticulatedInertia() const
Update the articulated inertias of the skeleton.
Definition: Skeleton.cpp:2815
const Eigen::VectorXd & getCoriolisAndGravityForces() const override
Get combined vector of Coriolis force and gravity force of the MetaSkeleton.
Definition: Skeleton.cpp:2086
double mTotalMass
Total mass.
Definition: Skeleton.hpp:1313
Eigen::VectorXd mVelocities
Joint velocities.
Definition: Skeleton.hpp:119
void updateVelocityChange()
Update velocity changes in body nodes and joints due to applied impulse.
Definition: Skeleton.cpp:3984
std::size_t getNumSoftBodyNodes() const
Get number of soft body nodes.
Definition: Skeleton.cpp:863
std::pair< JointType *, NodeType * > createJointAndBodyNodePair(BodyNode *_parent=nullptr, const typename JointType::Properties &_jointProperties=typename JointType::Properties(), const typename NodeType::Properties &_bodyProperties=typename NodeType::Properties())
Create a Joint and child BodyNode pair of the given types.
Definition: Skeleton.hpp:77
The Properties of this Skeleton which are independent of the components within the Skeleton...
Definition: SkeletonAspect.hpp:53
std::shared_ptr< WholeBodyIK > mWholeBodyIK
WholeBodyIK module for this Skeleton.
Definition: Skeleton.hpp:1193
void dirtySupportPolygon(std::size_t _treeIdx)
Notify that the support polygon of a tree needs to be updated.
Definition: Skeleton.cpp:3808
const std::vector< BodyNode * > & getTreeBodyNodes(std::size_t _treeIdx)
Get the BodyNodes belonging to a tree in this Skeleton.
Definition: Skeleton.cpp:1072
void updateExternalForces() const
update external force vector to generalized forces.
Definition: Skeleton.cpp:3463
math::LinearJacobian getCOMLinearJacobian(const Frame *_inCoordinatesOf=Frame::World()) const override
Get the Skeleton's COM Linear Jacobian in terms of any Frame (default is World Frame) ...
Definition: Skeleton.cpp:4201
Definition: PointMass.hpp:50
Eigen::VectorXd getPositionDifferences(const Eigen::VectorXd &_q2, const Eigen::VectorXd &_q1) const
Return the difference of two generalized positions which are measured in the configuration space of t...
Definition: Skeleton.cpp:1585
void constructNewTree()
Construct a new tree in the Skeleton.
Definition: Skeleton.cpp:2150
std::mutex & getMutex() const
Get the mutex that protects the state of this Skeleton.
Definition: Skeleton.cpp:422
Eigen::VectorXd getVelocityDifferences(const Eigen::VectorXd &_dq2, const Eigen::VectorXd &_dq1) const
Return the difference of two generalized velocities or accelerations which are measured in the tangen...
Definition: Skeleton.cpp:1617
const std::vector< std::size_t > & getSupportIndices() const
Get a list of the EndEffector indices that correspond to each of the points in the support polygon...
Definition: Skeleton.cpp:3629
math::LinearJacobian getCOMLinearJacobianDeriv(const Frame *_inCoordinatesOf=Frame::World()) const override
Get the Skeleton's COM Linear Jacobian time derivative in terms of any Frame (default is World Frame)...
Definition: Skeleton.cpp:4221
std::vector< std::size_t > mSupportIndices
A map of which EndEffectors correspond to the individual points in the support polygon.
Definition: Skeleton.hpp:1287
void updateInvMassMatrix() const
Update inverse of mass matrix of the skeleton.
Definition: Skeleton.cpp:3095
bool mMassMatrix
Dirty flag for the mass matrix.
Definition: Skeleton.hpp:1204
double getTimeStep() const
Get time step.
Definition: Skeleton.cpp:830
Eigen::Vector3d getCOMLinearAcceleration(const Frame *_relativeTo=Frame::World(), const Frame *_inCoordinatesOf=Frame::World()) const override
Get the Skeleton's COM linear acceleration in terms of any Frame (default is World Frame) ...
Definition: Skeleton.cpp:4146
std::vector< std::size_t > mIndices
A list of degree of freedom indices that each entry in the Eigen::VectorXd members correspond to...
Definition: Skeleton.hpp:113
SkeletonPtr clone() const
Create an identical clone of this Skeleton.
Definition: Skeleton.cpp:443
Joint * getRootJoint(std::size_t treeIdx=0u)
Get the root Joint of the tree whose index in this Skeleton is treeIdx.
Definition: Skeleton.cpp:904
std::vector< BodyNode * > mBodyNodes
BodyNodes belonging to this tree.
Definition: Skeleton.hpp:1243
std::vector< SoftBodyNode * > mSoftBodyNodes
List of Soft body node list in the skeleton.
Definition: Skeleton.hpp:1178
bool isMobile() const
Get whether this skeleton will be updated by forward dynamics.
Definition: Skeleton.cpp:814
void enableSelfCollisionCheck()
Enable self-collision check.
Definition: Skeleton.cpp:760
Definition: ShapeNode.hpp:48
Eigen::Vector3d getCOM(const Frame *_withRespectTo=Frame::World()) const override
Get the Skeleton's COM with respect to any Frame (default is World Frame)
Definition: Skeleton.cpp:4077
void notifyArticulatedInertiaUpdate(std::size_t _treeIdx)
Notify that the articulated inertia and everything that depends on it needs to be updated...
Definition: Skeleton.cpp:3783
void setSelfCollisionCheck(bool enable)
Set whether to check self-collision.
Definition: Skeleton.cpp:748
bool getAdjacentBodyCheck() const
Return whether adjacent body check is enabled.
Definition: Skeleton.cpp:784
std::weak_ptr< Skeleton > mPtr
The resource-managing pointer to this Skeleton.
Definition: Skeleton.hpp:1175
BodyNode class represents a single node of the skeleton.
Definition: BodyNode.hpp:74
math::Jacobian getWorldJacobian(const JacobianNode *_node) const override
Get the spatial Jacobian targeting the origin of a BodyNode.
Definition: Skeleton.cpp:1744
DegreeOfFreedom * getDof(std::size_t _idx) override
Get degree of freedom (aka generalized coordinate) whose index is _idx.
Definition: Skeleton.cpp:1207
void updateInvAugMassMatrix() const
Update inverse of augmented mass matrix of the skeleton.
Definition: Skeleton.cpp:3198
const Eigen::VectorXd & getConstraintForces() const override
Get constraint force vector.
Definition: Skeleton.cpp:2119
const Eigen::VectorXd & getExternalForces() const override
Get external force vector of the MetaSkeleton.
Definition: Skeleton.cpp:2104
State getState() const
Get the State of this Skeleton [alias for getCompositeState()].
Definition: Skeleton.cpp:619
Eigen::MatrixXd mInvM
Inverse of mass matrix for the skeleton.
Definition: Skeleton.hpp:1261
std::vector< const BodyNode * > mConstBodyNodes
Cache for const BodyNodes, for the sake of the API.
Definition: Skeleton.hpp:1246
DegreeOfFreedom class is a proxy class for accessing single degrees of freedom (aka generalized coord...
Definition: DegreeOfFreedom.hpp:54
bool isEnabledAdjacentBodyCheck() const
Return true if self-collision check is enabled including adjacent bodies.
Definition: Skeleton.cpp:802
const std::vector< DegreeOfFreedom * > & getDofs() override
Get the vector of DegreesOfFreedom for this MetaSkeleton.
Definition: Skeleton.cpp:1233
void updateCacheDimensions(DataCache &_cache)
Update the dimensions for a specific cache.
Definition: Skeleton.cpp:2776
void updateAugMassMatrix() const
Update augmented mass matrix of the skeleton.
Definition: Skeleton.cpp:2994
SkeletonPtr getPtr()
Get the shared_ptr that manages this Skeleton.
Definition: Skeleton.cpp:398
std::vector< Joint * > getJoints() override
Returns all the joints that are held by this MetaSkeleton.
Definition: Skeleton.cpp:1134
The WholeBodyIK class provides an interface for simultaneously solving all the IK constraints of all ...
Definition: HierarchicalIK.hpp:393
Eigen::VectorXd mForces
Joint forces.
Definition: Skeleton.hpp:125
std::size_t getIndexOf(const BodyNode *_bn, bool _warning=true) const override
Get the index of a specific BodyNode within this ReferentialSkeleton.
Definition: Skeleton.cpp:1065
std::size_t getNumTrees() const
Get the number of independent trees that this Skeleton contains.
Definition: Skeleton.cpp:869
Definition: Marker.hpp:46
const Eigen::VectorXd & computeConstraintForces(DataCache &cache) const
Compute the constraint force vector for a tree.
Definition: Skeleton.cpp:3491
std::pair< Joint *, BodyNode * > cloneBodyNodeTree(Joint *_parentJoint, const BodyNode *_bodyNode, const SkeletonPtr &_newSkeleton, BodyNode *_parentNode, bool _recursive) const
Copy a subtree of BodyNodes onto another Skeleton while leaving the originals intact.
Definition: Skeleton.cpp:2667
Definition: GenericJointAspect.hpp:45
bool operator==(const Configuration &other) const
Equality comparison operator.
Definition: Skeleton.cpp:363
const std::string & setName(const std::string &_name) override
Set name.
Definition: Skeleton.cpp:660
void registerBodyNode(BodyNode *_newBodyNode)
Register a BodyNode with the Skeleton. Internal use only.
Definition: Skeleton.cpp:2171
void updateGravityForces() const
Update gravity force vector of the skeleton.
Definition: Skeleton.cpp:3318
void disableAdjacentBodyCheck()
Disable collision check for adjacent bodies.
Definition: Skeleton.cpp:796
void updateMassMatrix() const
Update mass matrix of the skeleton.
Definition: Skeleton.cpp:2893
math::SupportPolygon mSupportPolygon
Support polygon.
Definition: Skeleton.hpp:1283
std::vector< DegreeOfFreedom * > mDofs
Degrees of Freedom belonging to this tree.
Definition: Skeleton.hpp:1249
SkeletonPtr getSkeleton()
Same as getPtr(), but this allows Skeleton to have a similar interface as BodyNode and Joint for temp...
Definition: Skeleton.cpp:410
const math::SupportPolygon & getSupportPolygon() const
Get the support polygon of this Skeleton, which is computed based on the gravitational projection of ...
Definition: Skeleton.cpp:3582
void clearExternalForces() override
Clear the external forces of the BodyNodes in this MetaSkeleton.
Definition: Skeleton.cpp:3769
Eigen::Vector2d mSupportCentroid
Centroid of the support polygon.
Definition: Skeleton.hpp:1297
void addEntryToSoftBodyNodeNameMgr(SoftBodyNode *_newNode)
Add a SoftBodyNode to the SoftBodyNode NameManager.
Definition: Skeleton.cpp:705
const std::vector< DegreeOfFreedom * > & getTreeDofs(std::size_t _treeIdx)
Get the DegreesOfFreedom belonging to a tree in this Skeleton.
Definition: Skeleton.cpp:1256
math::Jacobian getCOMJacobian(const Frame *_inCoordinatesOf=Frame::World()) const override
Get the Skeleton's COM Jacobian in terms of any Frame (default is World Frame)
Definition: Skeleton.cpp:4193
void setTimeStep(double _timeStep)
Set time step.
Definition: Skeleton.cpp:820
void setMobile(bool _isMobile)
Set whether this skeleton will be updated by forward dynamics.
Definition: Skeleton.cpp:808
void dirtyArticulatedInertia(std::size_t _treeIdx)
Notify that the articulated inertia and everything that depends on it needs to be updated...
Definition: Skeleton.cpp:3789
void computeForwardDynamics()
Compute forward dynamics.
Definition: Skeleton.cpp:3728
bool moveBodyNodeTree(Joint *_parentJoint, BodyNode *_bodyNode, SkeletonPtr _newSkeleton, BodyNode *_parentNode)
Move a subtree of BodyNodes from this Skeleton to another Skeleton.
Definition: Skeleton.cpp:2557
math::Jacobian getJacobianSpatialDeriv(const JacobianNode *_node) const override
Get the spatial Jacobian time derivative targeting the origin of a BodyNode.
Definition: Skeleton.cpp:1831
bool mInvAugMassMatrix
Dirty flag for the inverse of augmented mass matrix.
Definition: Skeleton.hpp:1213
void registerNode(NodeMap &nodeMap, Node *_newNode, std::size_t &_index)
Register a Node with the Skeleton. Internal use only.
Definition: Skeleton.cpp:2305
math::Jacobian getJacobianClassicDeriv(const JacobianNode *_node) const override
Get the spatial Jacobian (classical) time derivative targeting the origin of a BodyNode.
Definition: Skeleton.cpp:1879
bool mIsImpulseApplied
Flag for status of impulse testing.
Definition: Skeleton.hpp:1317
dart::common::NameManager< DegreeOfFreedom * > mNameMgrForDofs
NameManager for tracking DegreesOfFreedom.
Definition: Skeleton.hpp:1187
void clearConstraintImpulses()
Clear constraint impulses and cache data used for impulse-based forward dynamics algorithm, where the constraint impulses are spatial constraints on the BodyNodes and generalized constraints on the Joints.
Definition: Skeleton.cpp:3814
Properties getProperties() const
Get all properties of this Skeleton.
Definition: Skeleton.cpp:631
const std::string & addEntryToBodyNodeNameMgr(BodyNode *_newNode)
Add a BodyNode to the BodyNode NameManager.
Definition: Skeleton.cpp:683
void setState(const State &state)
Set the State of this Skeleton [alias for setCompositeState(~)].
Definition: Skeleton.cpp:613
The Configuration struct represents the joint configuration of a Skeleton.
Definition: Skeleton.hpp:94
void computeForwardKinematics(bool _updateTransforms=true, bool _updateVels=true, bool _updateAccs=true)
Compute forward kinematics.
Definition: Skeleton.cpp:3692
bool operator!=(const Configuration &other) const
Inequality comparison operator.
Definition: Skeleton.cpp:378
Skeleton & operator=(const Skeleton &_other)=delete
Remove copy operator.
void setConfiguration(const Configuration &configuration)
Set the configuration of this Skeleton.
Definition: Skeleton.cpp:567
This is an alternative to EmbedProperties which allows your class to also inherit other Composite obj...
Definition: EmbeddedAspect.hpp:237
class Skeleton
Definition: Skeleton.hpp:55
Definition: EndEffector.hpp:77
Definition: Skeleton.hpp:1238
std::size_t getNumRigidBodyNodes() const
Get number of rigid body nodes.
Definition: Skeleton.cpp:857
math::Jacobian getCOMJacobianSpatialDeriv(const Frame *_inCoordinatesOf=Frame::World()) const override
Get the Skeleton's COM Jacobian spatial time derivative in terms of any Frame (default is World Frame...
Definition: Skeleton.cpp:4211
bool hasBodyNode(const BodyNode *bodyNode) const override
Returns whether this Skeleton contains bodyNode.
Definition: Skeleton.cpp:1020
const std::pair< Eigen::Vector3d, Eigen::Vector3d > & getSupportAxes() const
Get the axes that correspond to each component in the support polygon.
Definition: Skeleton.cpp:3644
Configuration getConfiguration(int flags=CONFIG_ALL) const
Get the configuration of this Skeleton.
Definition: Skeleton.cpp:577
std::vector< const BodyNode * > constructBodyNodeTree(const BodyNode *_bodyNode) const
Create a vector representation of a subtree of BodyNodes.
Definition: Skeleton.cpp:2725
bool mAugMassMatrix
Dirty flag for the mass matrix.
Definition: Skeleton.hpp:1207
math::AngularJacobian getAngularJacobian(const JacobianNode *_node, const Frame *_inCoordinatesOf=Frame::World()) const override
Get the angular Jacobian of a BodyNode.
Definition: Skeleton.cpp:1807
Eigen::VectorXd mCommands
Joint commands.
Definition: Skeleton.hpp:128
std::shared_ptr< const WholeBodyIK > getIK() const
Get a pointer to a WholeBodyIK module for this Skeleton.
Definition: Skeleton.cpp:1531
void registerJoint(Joint *_newJoint)
Register a Joint with the Skeleton. Internal use only.
Definition: Skeleton.cpp:2276
const std::string & getName() const override
Get name.
Definition: Skeleton.cpp:677
bool isImpulseApplied() const
Get whether this skeleton is constrained.
Definition: Skeleton.cpp:3997
std::size_t getNumJoints() const override
Get number of Joints.
Definition: Skeleton.cpp:1098
bool mCoriolisAndGravityForces
Dirty flag for the combined vector of Coriolis and gravity.
Definition: Skeleton.hpp:1222
void unregisterNode(NodeMap &nodeMap, Node *_oldNode, std::size_t &_index)
Remove a Node from the Skeleton. Internal use only.
Definition: Skeleton.cpp:2500
void clearInternalForces() override
Clear the internal forces of the BodyNodes in this MetaSkeleton.
Definition: Skeleton.cpp:3776
std::vector< BodyNode * > extractBodyNodeTree(BodyNode *_bodyNode)
Create a vector representation of a subtree of BodyNodes and remove that subtree from this Skeleton w...
Definition: Skeleton.cpp:2744
Eigen::Vector3d getCOMLinearVelocity(const Frame *_relativeTo=Frame::World(), const Frame *_inCoordinatesOf=Frame::World()) const override
Get the Skeleton's COM linear velocity in terms of any Frame (default is World Frame) ...
Definition: Skeleton.cpp:4127
void setPtr(const SkeletonPtr &_ptr)
Setup this Skeleton with its shared_ptr.
Definition: Skeleton.cpp:2143
void destructOldTree(std::size_t tree)
Remove an old tree from the Skeleton.
Definition: Skeleton.cpp:2358