DART 6.13.2
Loading...
Searching...
No Matches
BodyNode.hpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011-2022, 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_BODYNODE_HPP_
34#define DART_DYNAMICS_BODYNODE_HPP_
35
36#include <string>
37#include <vector>
38
39#include <Eigen/Dense>
40#include <Eigen/StdVector>
41
45#include "dart/config.hpp"
55
56namespace dart {
57namespace dynamics {
58
59class GenCoord;
60class Skeleton;
61class Joint;
62class DegreeOfFreedom;
63class Shape;
64class EndEffector;
65class Marker;
66
77 public virtual BodyNodeSpecializedFor<ShapeNode, EndEffector, Marker>,
79 public TemplatedJacobianNode<BodyNode>
80{
81public:
83 = common::Signal<void(const BodyNode*, ConstShapePtr _newColShape)>;
84
86
89
92
95
98
99 BodyNode(const BodyNode&) = delete;
100
102 virtual ~BodyNode();
103
106 virtual SoftBodyNode* asSoftBodyNode();
107
110 virtual const SoftBodyNode* asSoftBodyNode() const;
111
113 void setAllNodeStates(const AllNodeStates& states);
114
117
120
123
125 void setProperties(const CompositeProperties& _properties);
126
128 void setProperties(const AspectProperties& _properties);
129
131 void setAspectState(const AspectState& state);
132
135
138
140 void copy(const BodyNode& otherBodyNode);
141
143 void copy(const BodyNode* otherBodyNode);
144
146 BodyNode& operator=(const BodyNode& _otherBodyNode);
147
149 void duplicateNodes(const BodyNode* otherBodyNode);
150
153 void matchNodes(const BodyNode* otherBodyNode);
154
157 const std::string& setName(const std::string& _name) override;
158
159 // Documentation inherited
160 const std::string& getName() const override;
161
164 void setGravityMode(bool _gravityMode);
165
167 bool getGravityMode() const;
168
170 bool isCollidable() const;
171
174 void setCollidable(bool _isCollidable);
175
177 void setMass(double mass);
178
180 double getMass() const;
181
187 double _Ixx,
188 double _Iyy,
189 double _Izz,
190 double _Ixy = 0.0,
191 double _Ixz = 0.0,
192 double _Iyz = 0.0);
193
196 double& _Ixx,
197 double& _Iyy,
198 double& _Izz,
199 double& _Ixy,
200 double& _Ixz,
201 double& _Iyz) const;
202
204 const Eigen::Matrix6d& getSpatialInertia() const;
205
207 void setInertia(const Inertia& inertia);
208
210 const Inertia& getInertia() const;
211
214
218
220 void setLocalCOM(const Eigen::Vector3d& _com);
221
223 const Eigen::Vector3d& getLocalCOM() const;
224
226 Eigen::Vector3d getCOM(const Frame* _withRespectTo = Frame::World()) const;
227
230 Eigen::Vector3d getCOMLinearVelocity(
231 const Frame* _relativeTo = Frame::World(),
232 const Frame* _inCoordinatesOf = Frame::World()) const;
233
237
241 const Frame* _relativeTo, const Frame* _inCoordinatesOf) const;
242
245 Eigen::Vector3d getCOMLinearAcceleration(
246 const Frame* _relativeTo = Frame::World(),
247 const Frame* _inCoordinatesOf = Frame::World()) const;
248
252
256 const Frame* _relativeTo, const Frame* _inCoordinatesOf) const;
257
262 DART_DEPRECATED(6.10)
263 void setFrictionCoeff(double coeff);
264
269 DART_DEPRECATED(6.10)
270 double getFrictionCoeff() const;
271
276 DART_DEPRECATED(6.10)
277 void setRestitutionCoeff(double coeff);
278
283 DART_DEPRECATED(6.10)
284 double getRestitutionCoeff() const;
285
286 //--------------------------------------------------------------------------
287 // Structural Properties
288 //--------------------------------------------------------------------------
289
291 std::size_t getIndexInSkeleton() const;
292
294 std::size_t getIndexInTree() const;
295
297 std::size_t getTreeIndex() const;
298
308 SkeletonPtr remove(const std::string& _name = "temporary");
309
319 bool moveTo(BodyNode* _newParent);
320
326 bool moveTo(const SkeletonPtr& _newSkeleton, BodyNode* _newParent);
327
336 template <class JointType>
337 JointType* moveTo(
338 BodyNode* _newParent,
339 const typename JointType::Properties& _joint
340 = typename JointType::Properties());
341
345 template <class JointType>
346 JointType* moveTo(
347 const SkeletonPtr& _newSkeleton,
348 BodyNode* _newParent,
349 const typename JointType::Properties& _joint
350 = typename JointType::Properties());
351
362 SkeletonPtr split(const std::string& _skeletonName);
363
366 template <class JointType>
368 const std::string& _skeletonName,
369 const typename JointType::Properties& _joint
370 = typename JointType::Properties());
371
376 template <class JointType>
377 JointType* changeParentJointType(
378 const typename JointType::Properties& _joint
379 = typename JointType::Properties());
380
389 std::pair<Joint*, BodyNode*> copyTo(
390 BodyNode* _newParent, bool _recursive = true);
391
402 std::pair<Joint*, BodyNode*> copyTo(
403 const SkeletonPtr& _newSkeleton,
404 BodyNode* _newParent,
405 bool _recursive = true) const;
406
409 template <class JointType>
410 std::pair<JointType*, BodyNode*> copyTo(
411 BodyNode* _newParent,
412 const typename JointType::Properties& _joint
413 = typename JointType::Properties(),
414 bool _recursive = true);
415
418 template <class JointType>
419 std::pair<JointType*, BodyNode*> copyTo(
420 const SkeletonPtr& _newSkeleton,
421 BodyNode* _newParent,
422 const typename JointType::Properties& _joint
423 = typename JointType::Properties(),
424 bool _recursive = true) const;
425
431 const std::string& _skeletonName, bool _recursive = true) const;
432
435 template <class JointType>
437 const std::string& _skeletonName,
438 const typename JointType::Properties& _joint
439 = typename JointType::Properties(),
440 bool _recursive = true) const;
441
442 // Documentation inherited
443 SkeletonPtr getSkeleton() override;
444
445 // Documentation inherited
446 ConstSkeletonPtr getSkeleton() const override;
447
450
452 const Joint* getParentJoint() const;
453
456
458 const BodyNode* getParentBodyNode() const;
459
461 template <class JointType, class NodeType = BodyNode>
462 std::pair<JointType*, NodeType*> createChildJointAndBodyNodePair(
463 const typename JointType::Properties& _jointProperties
464 = typename JointType::Properties(),
465 const typename NodeType::Properties& _bodyProperties
466 = typename NodeType::Properties());
467
469 std::size_t getNumChildBodyNodes() const;
470
472 BodyNode* getChildBodyNode(std::size_t _index);
473
475 const BodyNode* getChildBodyNode(std::size_t _index) const;
476
478 std::size_t getNumChildJoints() const;
479
481 Joint* getChildJoint(std::size_t _index);
482
484 const Joint* getChildJoint(std::size_t _index) const;
485
487 template <class NodeType, typename... Args>
488 NodeType* createNode(Args&&... args);
489
491
497 template <class ShapeNodeProperties>
499 ShapeNodeProperties properties, bool automaticName = true);
500
503 template <class ShapeType>
504 ShapeNode* createShapeNode(const std::shared_ptr<ShapeType>& shape);
505
507 template <class ShapeType, class StringType>
509 const std::shared_ptr<ShapeType>& shape, StringType&& name);
510
514 DART_DEPRECATED(6.13)
515 const std::vector<ShapeNode*> getShapeNodes();
516
520 DART_DEPRECATED(6.13)
521 const std::vector<const ShapeNode*> getShapeNodes() const;
522
524 void removeAllShapeNodes();
525
528 template <class... Aspects>
530
532 template <class... Aspects>
534 const ShapePtr& shape, const std::string& name);
535
537 template <class Aspect>
538 std::size_t getNumShapeNodesWith() const;
539
543 template <class Aspect>
544 DART_DEPRECATED(6.13)
545 const std::vector<ShapeNode*> getShapeNodesWith();
546
550 template <class Aspect>
551 DART_DEPRECATED(6.13)
552 const std::vector<const ShapeNode*> getShapeNodesWith() const;
553
558 template <class Aspect>
559 ShapeNode* getShapeNodeWith(std::size_t index);
560
561 template <class Aspect>
562 const ShapeNode* getShapeNodeWith(std::size_t index) const;
563
565 template <class Aspect>
567
586 template <typename Aspect, typename Func>
587 void eachShapeNodeWith(Func func) const;
588
606 template <typename Aspect, typename Func>
607 void eachShapeNodeWith(Func func);
608
610
614 const EndEffector::BasicProperties& _properties);
615
617 EndEffector* createEndEffector(const std::string& _name = "EndEffector");
618
620 EndEffector* createEndEffector(const char* _name);
621
623
626 const std::string& name = "marker",
627 const Eigen::Vector3d& position = Eigen::Vector3d::Zero(),
628 const Eigen::Vector4d& color = Eigen::Vector4d::Constant(1.0));
629
631 Marker* createMarker(const Marker::BasicProperties& properties);
632
633 // Documentation inherited
634 bool dependsOn(std::size_t _genCoordIndex) const override;
635
636 // Documentation inherited
637 std::size_t getNumDependentGenCoords() const override;
638
639 // Documentation inherited
640 std::size_t getDependentGenCoordIndex(std::size_t _arrayIndex) const override;
641
642 // Documentation inherited
643 const std::vector<std::size_t>& getDependentGenCoordIndices() const override;
644
645 // Documentation inherited
646 std::size_t getNumDependentDofs() const override;
647
648 // Documentation inherited
649 DegreeOfFreedom* getDependentDof(std::size_t _index) override;
650
651 // Documentation inherited
652 const DegreeOfFreedom* getDependentDof(std::size_t _index) const override;
653
654 // Documentation inherited
655 const std::vector<DegreeOfFreedom*>& getDependentDofs() override;
656
657 // Documentation inherited
658 const std::vector<const DegreeOfFreedom*>& getDependentDofs() const override;
659
660 // Documentation inherited
661 const std::vector<const DegreeOfFreedom*> getChainDofs() const override;
662
663 //--------------------------------------------------------------------------
664 // Properties updated by dynamics (kinematics)
665 //--------------------------------------------------------------------------
666
669 const Eigen::Isometry3d& getRelativeTransform() const override;
670
671 // Documentation inherited
672 const Eigen::Vector6d& getRelativeSpatialVelocity() const override;
673
674 // Documentation inherited
675 const Eigen::Vector6d& getRelativeSpatialAcceleration() const override;
676
677 // Documentation inherited
678 const Eigen::Vector6d& getPrimaryRelativeAcceleration() const override;
679
681 const Eigen::Vector6d& getPartialAcceleration() const override;
682
685 const math::Jacobian& getJacobian() const override final;
686
687 // Prevent the inherited getJacobian functions from being shadowed
689
692 const math::Jacobian& getWorldJacobian() const override final;
693
694 // Prevent the inherited getWorldJacobian functions from being shadowed
696
705 const math::Jacobian& getJacobianSpatialDeriv() const override final;
706
707 // Prevent the inherited getJacobianSpatialDeriv functions from being shadowed
709
717 const math::Jacobian& getJacobianClassicDeriv() const override final;
718
719 // Prevent the inherited getJacobianClassicDeriv functions from being shadowed
721
723 const Eigen::Vector6d& getBodyVelocityChange() const;
724
729 DART_DEPRECATED(6.0)
730 void setColliding(bool _isColliding);
731
734 DART_DEPRECATED(6.0)
735 bool isColliding();
736
744 void addExtForce(
745 const Eigen::Vector3d& _force,
746 const Eigen::Vector3d& _offset = Eigen::Vector3d::Zero(),
747 bool _isForceLocal = false,
748 bool _isOffsetLocal = true);
749
751 void setExtForce(
752 const Eigen::Vector3d& _force,
753 const Eigen::Vector3d& _offset = Eigen::Vector3d::Zero(),
754 bool _isForceLocal = false,
755 bool _isOffsetLocal = true);
756
760 void addExtTorque(const Eigen::Vector3d& _torque, bool _isLocal = false);
761
765 void setExtTorque(const Eigen::Vector3d& _torque, bool _isLocal = false);
766
771 virtual void clearExternalForces();
772
776 virtual void clearInternalForces();
777
779 const Eigen::Vector6d& getExternalForceLocal() const;
780
782 Eigen::Vector6d getExternalForceGlobal() const;
783
789 const Eigen::Vector6d& getBodyForce() const;
790
791 //----------------------------------------------------------------------------
792 // Constraints
793 // - Following functions are managed by constraint solver.
794 //----------------------------------------------------------------------------
795
800 bool isReactive() const;
801
804 void setConstraintImpulse(const Eigen::Vector6d& _constImp);
805
808 void addConstraintImpulse(const Eigen::Vector6d& _constImp);
809
812 const Eigen::Vector3d& _constImp,
813 const Eigen::Vector3d& _offset,
814 bool _isImpulseLocal = false,
815 bool _isOffsetLocal = true);
816
819 virtual void clearConstraintImpulse();
820
822 const Eigen::Vector6d& getConstraintImpulse() const;
823
824 //----------------------------------------------------------------------------
825 // Energies
826 //----------------------------------------------------------------------------
827
829 double computeLagrangian(const Eigen::Vector3d& gravity) const;
830
832 DART_DEPRECATED(6.1)
833 virtual double getKineticEnergy() const;
834
836 double computeKineticEnergy() const;
837
839 DART_DEPRECATED(6.1)
840 virtual double getPotentialEnergy(const Eigen::Vector3d& _gravity) const;
841
843 double computePotentialEnergy(const Eigen::Vector3d& gravity) const;
844
846 Eigen::Vector3d getLinearMomentum() const;
847
849 Eigen::Vector3d getAngularMomentum(
850 const Eigen::Vector3d& _pivot = Eigen::Vector3d::Zero());
851
852 //----------------------------------------------------------------------------
853 // Notifications
854 //----------------------------------------------------------------------------
855
856 // Documentation inherited
857 void dirtyTransform() override;
858
859 // Documentation inherited
860 void dirtyVelocity() override;
861
862 // Documentation inherited
863 void dirtyAcceleration() override;
864
867 DART_DEPRECATED(6.2)
869
873
875 DART_DEPRECATED(6.2)
877
879 void dirtyExternalForces();
880
882 DART_DEPRECATED(6.2)
884
886 void dirtyCoriolisForces();
887
895 void setColor(const Eigen::Vector3d& color);
896
904 void setColor(const Eigen::Vector4d& color);
905
913 void setAlpha(double alpha);
914
915 //----------------------------------------------------------------------------
916 // Friendship
917 //----------------------------------------------------------------------------
918
919 friend class Skeleton;
920 friend class Joint;
921 friend class EndEffector;
922 friend class SoftBodyNode;
923 friend class PointMass;
924 friend class Node;
925
926protected:
928 BodyNode(
929 BodyNode* _parentBodyNode,
930 Joint* _parentJoint,
931 const Properties& _properties);
932
934 BodyNode(const std::tuple<BodyNode*, Joint*, Properties>& args);
935
938 virtual BodyNode* clone(
939 BodyNode* _parentBodyNode, Joint* _parentJoint, bool cloneNodes) const;
940
942 Node* cloneNode(BodyNode* bn) const override final;
943
945 virtual void init(const SkeletonPtr& _skeleton);
946
948 void addChildBodyNode(BodyNode* _body);
949
950 //----------------------------------------------------------------------------
952 //----------------------------------------------------------------------------
953
956 void processNewEntity(Entity* _newChildEntity) override;
957
959 void processRemovedEntity(Entity* _oldChildEntity) override;
960
962 virtual void updateTransform();
963
965 virtual void updateVelocity();
966
968 virtual void updatePartialAcceleration() const;
969
972 virtual void updateArtInertia(double _timeStep) const;
973
978 virtual void updateBiasForce(
979 const Eigen::Vector3d& _gravity, double _timeStep);
980
983 virtual void updateBiasImpulse();
984
987 virtual void updateAccelerationID();
988
990 virtual void updateAccelerationFD();
991
993 virtual void updateVelocityChangeFD();
994
1000 virtual void updateTransmittedForceID(
1001 const Eigen::Vector3d& _gravity, bool _withExternalForces = false);
1002
1008 virtual void updateTransmittedForceFD();
1009
1015 virtual void updateTransmittedImpulse();
1016 // TODO: Rename to updateTransmittedImpulseFD if impulse-based inverse
1017 // dynamics is implemented.
1018
1020 virtual void updateJointForceID(
1021 double _timeStep, bool _withDampingForces, bool _withSpringForces);
1022
1024 virtual void updateJointForceFD(
1025 double _timeStep, bool _withDampingForces, bool _withSpringForces);
1026
1028 virtual void updateJointImpulseFD();
1029
1032 virtual void updateConstrainedTerms(double _timeStep);
1033
1035
1036 //----------------------------------------------------------------------------
1038 //----------------------------------------------------------------------------
1039
1041 virtual void updateMassMatrix();
1042 virtual void aggregateMassMatrix(Eigen::MatrixXd& _MCol, std::size_t _col);
1043 virtual void aggregateAugMassMatrix(
1044 Eigen::MatrixXd& _MCol, std::size_t _col, double _timeStep);
1045
1047 virtual void updateInvMassMatrix();
1048 virtual void updateInvAugMassMatrix();
1049 virtual void aggregateInvMassMatrix(
1050 Eigen::MatrixXd& _InvMCol, std::size_t _col);
1051 virtual void aggregateInvAugMassMatrix(
1052 Eigen::MatrixXd& _InvMCol, std::size_t _col, double _timeStep);
1053
1055 virtual void aggregateCoriolisForceVector(Eigen::VectorXd& _C);
1056
1058 virtual void aggregateGravityForceVector(
1059 Eigen::VectorXd& _g, const Eigen::Vector3d& _gravity);
1060
1062 virtual void updateCombinedVector();
1063 virtual void aggregateCombinedVector(
1064 Eigen::VectorXd& _Cg, const Eigen::Vector3d& _gravity);
1065
1068 virtual void aggregateExternalForces(Eigen::VectorXd& _Fext);
1069
1071 virtual void aggregateSpatialToGeneralized(
1072 Eigen::VectorXd& _generalized, const Eigen::Vector6d& _spatial);
1073
1076 void updateBodyJacobian() const;
1077
1080 void updateWorldJacobian() const;
1081
1085 void updateBodyJacobianSpatialDeriv() const;
1086
1091
1093
1094protected:
1095 //--------------------------------------------------------------------------
1096 // General properties
1097 //--------------------------------------------------------------------------
1098
1100 int mID;
1101
1103 static std::size_t msBodyNodeCount;
1104
1108
1109 //--------------------------------------------------------------------------
1110 // Structural Properties
1111 //--------------------------------------------------------------------------
1112
1114 std::size_t mIndexInSkeleton;
1115
1117 std::size_t mIndexInTree;
1118
1120 std::size_t mTreeIndex;
1121
1124
1127
1130
1134
1136 std::vector<std::size_t> mDependentGenCoordIndices;
1137
1141
1144
1145 //--------------------------------------------------------------------------
1146 // Dynamical Properties
1147 //--------------------------------------------------------------------------
1148
1152 mutable math::Jacobian mBodyJacobian;
1153
1157 mutable math::Jacobian mWorldJacobian;
1158
1162 mutable math::Jacobian mBodyJacobianSpatialDeriv;
1163
1167 mutable math::Jacobian mWorldJacobianClassicDeriv;
1168
1172 mutable Eigen::Vector6d mPartialAcceleration;
1173 // TODO(JS): Rename with more informative name
1174
1177
1180 Eigen::Vector6d mF;
1181
1183 Eigen::Vector6d mFgravity;
1184
1188 mutable math::Inertia mArtInertia;
1189
1194
1197
1199 Eigen::Vector6d mCg_dV;
1200 Eigen::Vector6d mCg_F;
1201
1203 Eigen::Vector6d mG_F;
1204
1206 Eigen::Vector6d mFext_F;
1207
1209 Eigen::Vector6d mM_dV;
1210 Eigen::Vector6d mM_F;
1211
1213 Eigen::Vector6d mInvM_c;
1214 Eigen::Vector6d mInvM_U;
1215
1218
1219 //------------------------- Impulse-based Dyanmics ---------------------------
1222 Eigen::Vector6d mDelV;
1223
1227
1230
1231 // TODO(JS): rename with more informative one
1233 Eigen::Vector6d mImpF;
1234
1237
1240
1243
1244public:
1245 // To get byte-aligned Eigen vectors
1246 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
1247
1248 //----------------------------------------------------------------------------
1250 //----------------------------------------------------------------------------
1251
1254
1257
1260 mutable common::SlotRegister<StructuralChangeSignal> onStructuralChange;
1261
1263
1264private:
1268};
1270
1271} // namespace dynamics
1272} // namespace dart
1273
1274#include "dart/dynamics/detail/BodyNode.hpp"
1275
1276#endif // DART_DYNAMICS_BODYNODE_HPP_
#define DART_BAKE_SPECIALIZED_NODE_DECLARATIONS(AspectName)
Definition BasicNodeManager.hpp:457
#define DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_END
Definition ClassWithVirtualBase.hpp:44
#define DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_BEGIN
Definition ClassWithVirtualBase.hpp:43
#define DART_DEPRECATED(version)
Definition Deprecated.hpp:51
BodyPropPtr properties
Definition SdfParser.cpp:80
std::string * name
Definition SkelParser.cpp:1698
std::size_t index
Definition SkelParser.cpp:1673
Eigen::VectorXd position
Definition SkelParser.cpp:108
MapHolder is a templated wrapper class that is used to allow maps of Aspect::State and Aspect::Proper...
Definition Cloneable.hpp:221
detail::CompositeProperties Properties
Definition Composite.hpp:56
This is an alternative to EmbedStateAndProperties which allows your class to also inherit other Compo...
Definition EmbeddedAspect.hpp:435
typename Impl::AspectState AspectState
Definition EmbeddedAspect.hpp:440
typename Impl::Aspect Aspect
Definition EmbeddedAspect.hpp:443
Definition CompositeData.hpp:187
Definition CompositeData.hpp:107
Declaration of the variadic template.
Definition SpecializedNodeManager.hpp:50
BodyNode class represents a single node of the skeleton.
Definition BodyNode.hpp:80
void updateBodyJacobian() const
Update body Jacobian.
Definition BodyNode.cpp:2418
void addConstraintImpulse(const Eigen::Vector6d &_constImp)
Add constraint impulse.
Definition BodyNode.cpp:1996
ShapeNode * getShapeNodeWith(std::size_t index)
Returns the index-th ShapeNode among the ShapeNodes that have a specific Aspect.
Definition BodyNode.hpp:260
BodyNode * getChildBodyNode(std::size_t _index)
Return the _index-th child BodyNode of this BodyNode.
Definition BodyNode.cpp:918
std::set< Entity * > mNonBodyNodeEntities
Array of child Entities that are not BodyNodes.
Definition BodyNode.hpp:1133
Node * cloneNode(BodyNode *bn) const override final
This is needed in order to inherit the Node class, but it does nothing.
Definition BodyNode.cpp:1358
void dirtyCoriolisForces()
Tell the Skeleton that the coriolis forces need to be update.
Definition BodyNode.cpp:1610
const std::string & getName() const override
Return the name of this Entity.
Definition BodyNode.cpp:459
Eigen::Vector3d getCOMLinearVelocity(const Frame *_relativeTo=Frame::World(), const Frame *_inCoordinatesOf=Frame::World()) const
Return the linear velocity of the center of mass, expressed in terms of arbitrary Frames.
Definition BodyNode.cpp:630
detail::NodeStateMap NodeStateMap
Definition BodyNode.hpp:91
BodyNode(const BodyNode &)=delete
void removeAllShapeNodesWith()
Remove all ShapeNodes containing given Aspect from this BodyNode.
Definition BodyNode.hpp:296
void addChildBodyNode(BodyNode *_body)
Add a child bodynode into the bodynode.
Definition BodyNode.cpp:893
virtual ~BodyNode()
Destructor.
Definition BodyNode.cpp:265
bool mIsColliding
Whether the node is currently in collision with another node.
Definition BodyNode.hpp:1107
common::SlotRegister< ColShapeRemovedSignal > onColShapeRemoved
Slot register for collision shape removed signal.
Definition BodyNode.hpp:1256
void notifyArticulatedInertiaUpdate()
Notify the Skeleton that the tree of this BodyNode needs an articulated inertia update.
Definition BodyNode.cpp:1578
const math::Jacobian & getJacobianSpatialDeriv() const override final
Return the spatial time derivative of the generalized Jacobian targeting the origin of this BodyNode.
Definition BodyNode.cpp:1171
virtual void updateInvAugMassMatrix()
Definition BodyNode.cpp:2334
virtual void aggregateInvMassMatrix(Eigen::MatrixXd &_InvMCol, std::size_t _col)
Definition BodyNode.cpp:2356
const std::string & setName(const std::string &_name) override
Set name.
Definition BodyNode.cpp:422
Marker * createMarker(const std::string &name="marker", const Eigen::Vector3d &position=Eigen::Vector3d::Zero(), const Eigen::Vector4d &color=Eigen::Vector4d::Constant(1.0))
Create a Marker with the given fields.
Definition BodyNode.cpp:1016
math::Jacobian mBodyJacobianSpatialDeriv
Spatial time derivative of body Jacobian.
Definition BodyNode.hpp:1162
Joint * getChildJoint(std::size_t _index)
Return the _index-th child Joint of this BodyNode.
Definition BodyNode.cpp:936
Eigen::Vector6d mPartialAcceleration
Partial spatial body acceleration due to parent joint's velocity.
Definition BodyNode.hpp:1172
Joint * getParentJoint()
Return the parent Joint of this BodyNode.
Definition BodyNode.cpp:869
const Eigen::Vector3d & getLocalCOM() const
Return center of mass expressed in body frame.
Definition BodyNode.cpp:618
double getFrictionCoeff() const
Return frictional coefficient.
Definition BodyNode.cpp:691
virtual void updateConstrainedTerms(double _timeStep)
Update constrained terms due to the constraint impulses for foward dynamics.
Definition BodyNode.cpp:1907
Eigen::Vector6d mF
Transmitted wrench from parent to the bodynode expressed in body-fixed frame.
Definition BodyNode.hpp:1180
void setExtTorque(const Eigen::Vector3d &_torque, bool _isLocal=false)
Set applying Cartesian torque to the node.
Definition BodyNode.cpp:1271
void setProperties(const CompositeProperties &_properties)
Same as setCompositeProperties()
Definition BodyNode.cpp:321
void notifyCoriolisUpdate()
Tell the Skeleton that the coriolis forces need to be update.
Definition BodyNode.cpp:1604
void dirtyAcceleration() override
Notify the acceleration updates of this Frame and all its children are needed.
Definition BodyNode.cpp:1562
virtual void updateBiasForce(const Eigen::Vector3d &_gravity, double _timeStep)
Update bias force associated with the articulated body inertia for forward dynamics.
Definition BodyNode.cpp:1748
Properties getBodyNodeProperties() const
Get the Properties of this BodyNode.
Definition BodyNode.cpp:355
Eigen::Vector6d mM_F
Definition BodyNode.hpp:1210
bool isReactive() const
Return true if the body can react to force or constraint impulse.
Definition BodyNode.cpp:2058
bool isColliding()
Return whether this body node is set to be colliding with other objects.
Definition BodyNode.cpp:1201
const Eigen::Vector6d & getBodyForce() const
Get spatial body force transmitted from the parent joint.
Definition BodyNode.cpp:1983
BodyNode * mParentBodyNode
Parent body node.
Definition BodyNode.hpp:1126
ColShapeRemovedSignal mColShapeRemovedSignal
Collision shape removed signal.
Definition BodyNode.hpp:1239
virtual double getPotentialEnergy(const Eigen::Vector3d &_gravity) const
Return potential energy.
Definition BodyNode.cpp:2030
virtual void clearExternalForces()
Clean up structures that store external forces: mContacts, mFext, mExtForceBody and mExtTorqueBody.
Definition BodyNode.cpp:1919
virtual void updateAccelerationFD()
Update spatial body acceleration for forward dynamics.
Definition BodyNode.cpp:1831
void matchNodes(const BodyNode *otherBodyNode)
Make the Nodes of this BodyNode match the Nodes of otherBodyNode.
Definition BodyNode.cpp:405
virtual void clearConstraintImpulse()
Clear constraint impulses and cache data used for impulse-based forward dynamics algorithm.
Definition BodyNode.cpp:1970
void setRestitutionCoeff(double coeff)
Set coefficient of restitution in range of [0, 1].
Definition BodyNode.cpp:697
ShapeNode * createShapeNode(ShapeNodeProperties properties, bool automaticName=true)
Create an ShapeNode attached to this BodyNode.
Definition BodyNode.hpp:150
SkeletonPtr getSkeleton() override
Return the Skeleton that this Node is attached to.
Definition BodyNode.cpp:857
SkeletonPtr remove(const std::string &_name="temporary")
Remove this BodyNode and all of its children (recursively) from their Skeleton.
Definition BodyNode.cpp:778
Joint * mParentJoint
Parent joint.
Definition BodyNode.hpp:1123
Eigen::Vector6d mInvM_U
Definition BodyNode.hpp:1214
virtual void clearInternalForces()
Clear out the generalized forces of the parent Joint and any other forces related to this BodyNode th...
Definition BodyNode.cpp:1926
virtual void updateVelocityChangeFD()
Update spatical body velocity change for impluse-based forward dynamics.
Definition BodyNode.cpp:1852
void updateBodyJacobianSpatialDeriv() const
Update spatial time derivative of body Jacobian.
Definition BodyNode.cpp:2467
const Inertia & getInertia() const
Get the inertia data for this BodyNode.
Definition BodyNode.cpp:584
std::vector< DegreeOfFreedom * > mDependentDofs
A version of mDependentGenCoordIndices that holds DegreeOfFreedom pointers instead of indices.
Definition BodyNode.hpp:1140
Eigen::Vector6d mCg_dV
Cache data for combined vector of the system.
Definition BodyNode.hpp:1199
virtual void updateTransmittedForceID(const Eigen::Vector3d &_gravity, bool _withExternalForces=false)
Update spatial body force for inverse dynamics.
Definition BodyNode.cpp:1675
double getMass() const
Return the mass of the bodynode.
Definition BodyNode.cpp:522
virtual void aggregateSpatialToGeneralized(Eigen::VectorXd &_generalized, const Eigen::Vector6d &_spatial)
Definition BodyNode.cpp:2191
void addExtForce(const Eigen::Vector3d &_force, const Eigen::Vector3d &_offset=Eigen::Vector3d::Zero(), bool _isForceLocal=false, bool _isOffsetLocal=true)
Add applying linear Cartesian forces to this node.
Definition BodyNode.cpp:1207
virtual void updateCombinedVector()
Definition BodyNode.cpp:2119
NodeType * createNode(Args &&... args)
Create some Node type and attach it to this BodyNode.
Definition BodyNode.hpp:140
std::size_t getIndexInTree() const
Return the index of this BodyNode within its tree.
Definition BodyNode.cpp:731
const std::vector< ShapeNode * > getShapeNodesWith()
Return the list of ShapeNodes containing given Aspect.
Definition BodyNode.hpp:222
bool isCollidable() const
Return true if this body can collide with others bodies.
Definition BodyNode.cpp:485
common::SlotRegister< ColShapeAddedSignal > onColShapeAdded
Slot register for collision shape added signal.
Definition BodyNode.hpp:1253
DegreeOfFreedom * getDependentDof(std::size_t _index) override
Get a pointer to the _indexth dependent DegreeOfFreedom for this BodyNode.
Definition BodyNode.cpp:1071
JointType * changeParentJointType(const typename JointType::Properties &_joint=typename JointType::Properties())
Change the Joint type of this BodyNode's parent Joint.
Definition BodyNode.hpp:82
std::vector< BodyNode * > mChildBodyNodes
Array of child body nodes.
Definition BodyNode.hpp:1129
const Eigen::Vector6d & getPartialAcceleration() const override
Return the partial acceleration of this body.
Definition BodyNode.cpp:1144
static std::size_t msBodyNodeCount
Counts the number of nodes globally.
Definition BodyNode.hpp:1103
const std::vector< std::size_t > & getDependentGenCoordIndices() const override
Indices of the generalized coordinates which affect this JacobianNode.
Definition BodyNode.cpp:1059
Eigen::Vector6d mConstraintImpulse
Constraint impulse: contact impulse, dynamic joint impulse.
Definition BodyNode.hpp:1229
double getRestitutionCoeff() const
Return coefficient of restitution.
Definition BodyNode.cpp:719
std::pair< JointType *, NodeType * > createChildJointAndBodyNodePair(const typename JointType::Properties &_jointProperties=typename JointType::Properties(), const typename NodeType::Properties &_bodyProperties=typename NodeType::Properties())
Create a Joint and BodyNode pair as a child of this BodyNode.
Definition BodyNode.hpp:130
virtual void updateTransform()
Update transformation.
Definition BodyNode.cpp:1641
double computeKineticEnergy() const
Return kinetic energy.
Definition BodyNode.cpp:2021
void copy(const BodyNode &otherBodyNode)
Copy the Properties of another BodyNode.
Definition BodyNode.cpp:361
virtual void updateBiasImpulse()
Update bias impulse associated with the articulated body inertia for impulse-based forward dynamics.
Definition BodyNode.cpp:1789
virtual void updateTransmittedImpulse()
Update spatial body force for impulse-based forward dynamics.
Definition BodyNode.cpp:1822
const Eigen::Isometry3d & getRelativeTransform() const override
Get the transform of this BodyNode with respect to its parent BodyNode, which is also its parent Fram...
Definition BodyNode.cpp:1120
void setAspectState(const AspectState &state)
Set the AspectState of this BodyNode.
Definition BodyNode.cpp:333
Eigen::Vector6d getExternalForceGlobal() const
Definition BodyNode.cpp:1938
virtual void updatePartialAcceleration() const
Update partial spatial body acceleration due to parent joint's velocity.
Definition BodyNode.cpp:1657
math::Inertia mArtInertia
Articulated body inertia.
Definition BodyNode.hpp:1188
StructuralChangeSignal mStructuralChangeSignal
Structural change signal.
Definition BodyNode.hpp:1242
Eigen::Vector6d mG_F
Cache data for gravity force vector of the system.
Definition BodyNode.hpp:1203
const Eigen::Vector6d & getExternalForceLocal() const
Definition BodyNode.cpp:1932
double computeLagrangian(const Eigen::Vector3d &gravity) const
Return Lagrangian of this body.
Definition BodyNode.cpp:2009
SkeletonPtr split(const std::string &_skeletonName)
Remove this BodyNode and all of its children (recursively) from their current Skeleton and move them ...
Definition BodyNode.cpp:808
void setAspectProperties(const AspectProperties &properties)
Set the AspectProperties of this BodyNode.
Definition BodyNode.cpp:343
std::size_t mTreeIndex
Index of this BodyNode's tree.
Definition BodyNode.hpp:1120
void setFrictionCoeff(double coeff)
Set coefficient of friction in range of [0, ~].
Definition BodyNode.cpp:670
void setLocalCOM(const Eigen::Vector3d &_com)
Set center of mass expressed in body frame.
Definition BodyNode.cpp:610
virtual void updateJointImpulseFD()
Update the joint impulse for forward dynamics.
Definition BodyNode.cpp:1900
void processNewEntity(Entity *_newChildEntity) override
Separate generic child Entities from child BodyNodes for more efficient update notices.
Definition BodyNode.cpp:1439
virtual BodyNode * clone(BodyNode *_parentBodyNode, Joint *_parentJoint, bool cloneNodes) const
Create a clone of this BodyNode.
Definition BodyNode.cpp:1343
void setGravityMode(bool _gravityMode)
Set whether gravity affects this body.
Definition BodyNode.cpp:465
AllNodeStates getAllNodeStates() const
Get the Node::State of all Nodes attached to this BodyNode.
Definition BodyNode.cpp:294
SkeletonPtr copyAs(const std::string &_skeletonName, bool _recursive=true) const
Create clones of this BodyNode and all of its children (recursively) and create a new Skeleton with t...
Definition BodyNode.cpp:846
bool moveTo(BodyNode *_newParent)
Remove this BodyNode and all of its children (recursively) from their current parent BodyNode,...
Definition BodyNode.cpp:784
void setCollidable(bool _isCollidable)
Set whether this body node will collide with others in the world.
Definition BodyNode.cpp:491
void getMomentOfInertia(double &_Ixx, double &_Iyy, double &_Izz, double &_Ixy, double &_Ixz, double &_Iyz) const
Return moment of inertia defined around the center of mass.
Definition BodyNode.cpp:542
bool getGravityMode() const
Return true if gravity mode is enabled.
Definition BodyNode.cpp:479
void setColliding(bool _isColliding)
Set whether this body node is colliding with other objects.
Definition BodyNode.cpp:1195
std::vector< std::size_t > mDependentGenCoordIndices
A increasingly sorted list of dependent dof indices.
Definition BodyNode.hpp:1136
const math::Inertia & getArticulatedInertia() const
Return the articulated body inertia.
Definition BodyNode.cpp:590
const std::vector< const DegreeOfFreedom * > getChainDofs() const override
Returns a DegreeOfFreedom vector containing the dofs that form a Chain leading up to this JacobianNod...
Definition BodyNode.cpp:1097
common::SlotRegister< StructuralChangeSignal > onStructuralChange
Raised when (1) parent BodyNode is changed, (2) moved between Skeletons, (3) parent Joint is changed.
Definition BodyNode.hpp:1260
void eachShapeNodeWith(Func func) const
Iterates all the ShapeNodes that has a specific aspect and invokes the callback function.
Definition BodyNode.hpp:303
void setMomentOfInertia(double _Ixx, double _Iyy, double _Izz, double _Ixy=0.0, double _Ixz=0.0, double _Iyz=0.0)
Set moment of inertia defined around the center of mass.
Definition BodyNode.cpp:528
Eigen::Vector3d getLinearMomentum() const
Return linear momentum.
Definition BodyNode.cpp:2042
const math::Jacobian & getJacobianClassicDeriv() const override final
Return the classical time derivative of the generalized Jacobian targeting the origin of this BodyNod...
Definition BodyNode.cpp:1180
ShapeNode * createShapeNodeWith(const ShapePtr &shape)
Create a ShapeNode with the specified Aspects and an automatically assigned name: <BodyNodeName>Shape...
Definition BodyNode.hpp:186
virtual SoftBodyNode * asSoftBodyNode()
Convert 'this' into a SoftBodyNode pointer if this BodyNode is a SoftBodyNode, otherwise return nullp...
Definition BodyNode.cpp:275
Eigen::Vector3d getCOMLinearAcceleration(const Frame *_relativeTo=Frame::World(), const Frame *_inCoordinatesOf=Frame::World()) const
Return the linear acceleration of the center of mass, expressed in terms of arbitary Frames.
Definition BodyNode.cpp:650
virtual void aggregateCoriolisForceVector(Eigen::VectorXd &_C)
Definition BodyNode.cpp:2085
std::vector< const DegreeOfFreedom * > mConstDependentDofs
Same as mDependentDofs, but holds const pointers.
Definition BodyNode.hpp:1143
virtual void updateInvMassMatrix()
Definition BodyNode.cpp:2312
virtual void updateArtInertia(double _timeStep) const
Update articulated body inertia for forward dynamics.
Definition BodyNode.cpp:1718
const Eigen::Vector6d & getPrimaryRelativeAcceleration() const override
The Featherstone ABI algorithm exploits a component of the spatial acceleration which we refer to as ...
Definition BodyNode.cpp:1138
const std::vector< ShapeNode * > getShapeNodes()
Return the list of ShapeNodes.
Definition BodyNode.cpp:956
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 BodyNode.cpp:1132
BodyNode * getParentBodyNode()
Return the parent BodyNdoe of this BodyNode.
Definition BodyNode.cpp:881
Eigen::Vector6d mInvM_c
Cache data for inverse mass matrix of the system.
Definition BodyNode.hpp:1213
math::Jacobian mWorldJacobian
Cached World Jacobian.
Definition BodyNode.hpp:1157
virtual void updateJointForceFD(double _timeStep, bool _withDampingForces, bool _withSpringForces)
Update the joint force for forward dynamics.
Definition BodyNode.cpp:1891
void removeAllShapeNodes()
Remove all ShapeNodes from this BodyNode.
Definition BodyNode.cpp:982
Eigen::Vector6d mM_dV
Cache data for mass matrix of the system.
Definition BodyNode.hpp:1209
detail::NodePropertiesMap NodePropertiesMap
Definition BodyNode.hpp:94
virtual void updateJointForceID(double _timeStep, bool _withDampingForces, bool _withSpringForces)
Update the joint force for inverse dynamics.
Definition BodyNode.cpp:1882
std::size_t mIndexInSkeleton
Index of this BodyNode in its Skeleton.
Definition BodyNode.hpp:1114
virtual void aggregateMassMatrix(Eigen::MatrixXd &_MCol, std::size_t _col)
Definition BodyNode.cpp:2234
Eigen::Vector6d mBiasImpulse
Impulsive bias force due to external impulsive force exerted on bodies of the parent skeleton.
Definition BodyNode.hpp:1226
virtual void updateVelocity()
Update spatial body velocity.
Definition BodyNode.cpp:1649
void dirtyVelocity() override
Notify the velocity updates of this Frame and all its children are needed.
Definition BodyNode.cpp:1535
virtual void aggregateGravityForceVector(Eigen::VectorXd &_g, const Eigen::Vector3d &_gravity)
Definition BodyNode.cpp:2091
void setAlpha(double alpha)
Sets the alpha component of the ShapeNodes that are currently in this BodyNode.
Definition BodyNode.cpp:1633
EndEffector * createEndEffector(const EndEffector::BasicProperties &_properties)
Create an EndEffector attached to this BodyNode.
Definition BodyNode.cpp:991
std::shared_ptr< NodeDestructor > mSelfDestructor
Hold onto a reference to this BodyNode's own Destructor to make sure that it never gets destroyed.
Definition BodyNode.hpp:1267
Eigen::Vector6d mDelV
Velocity change due to to external impulsive force exerted on bodies of the parent skeleton.
Definition BodyNode.hpp:1222
void updateWorldJacobianClassicDeriv() const
Update classic time derivative of body Jacobian.
Definition BodyNode.cpp:2513
void notifyExternalForcesUpdate()
Tell the Skeleton that the external forces need to be updated.
Definition BodyNode.cpp:1592
void dirtyTransform() override
Notify the transformation updates of this Frame and all its children are needed.
Definition BodyNode.cpp:1503
const Eigen::Vector6d & getBodyVelocityChange() const
Return the velocity change due to the constraint impulse.
Definition BodyNode.cpp:1189
Eigen::Vector6d getCOMSpatialAcceleration() const
Return the acceleration of the center of mass expressed in coordinates of this BodyNode Frame and rel...
Definition BodyNode.cpp:657
void setAllNodeStates(const AllNodeStates &states)
Set the Node::State of all Nodes attached to this BodyNode.
Definition BodyNode.cpp:287
common::Signal< void(const BodyNode *, ConstShapePtr _newColShape)> ColShapeAddedSignal
Definition BodyNode.hpp:83
void setAllNodeProperties(const AllNodeProperties &properties)
Set the Node::Properties of all Nodes attached to this BodyNode.
Definition BodyNode.cpp:303
ColShapeAddedSignal mColShapeAddedSignal
Collision shape added signal.
Definition BodyNode.hpp:1236
Eigen::Vector3d getAngularMomentum(const Eigen::Vector3d &_pivot=Eigen::Vector3d::Zero())
Return angular momentum.
Definition BodyNode.cpp:2049
std::size_t mIndexInTree
Index of this BodyNode in its Tree.
Definition BodyNode.hpp:1117
Eigen::Vector6d mCg_F
Definition BodyNode.hpp:1200
virtual void updateMassMatrix()
Definition BodyNode.cpp:2217
const Eigen::Matrix6d & getSpatialInertia() const
Return spatial inertia.
Definition BodyNode.cpp:560
virtual void aggregateAugMassMatrix(Eigen::MatrixXd &_MCol, std::size_t _col, double _timeStep)
Definition BodyNode.cpp:2266
virtual void updateAccelerationID()
Update spatial body acceleration with the partial spatial body acceleration for inverse dynamics.
Definition BodyNode.cpp:1666
int mID
A unique ID of this node globally.
Definition BodyNode.hpp:1100
void addExtTorque(const Eigen::Vector3d &_torque, bool _isLocal=false)
Add applying Cartesian torque to the node.
Definition BodyNode.cpp:1259
const math::Jacobian & getWorldJacobian() const override final
Return the generalized Jacobian targeting the origin of this BodyNode.
Definition BodyNode.cpp:1162
double computePotentialEnergy(const Eigen::Vector3d &gravity) const
Return potential energy.
Definition BodyNode.cpp:2036
virtual void updateTransmittedForceFD()
Update spatial body force for forward dynamics.
Definition BodyNode.cpp:1813
Eigen::Vector6d mBiasForce
Bias force.
Definition BodyNode.hpp:1196
virtual void aggregateInvAugMassMatrix(Eigen::MatrixXd &_InvMCol, std::size_t _col, double _timeStep)
Definition BodyNode.cpp:2384
bool dependsOn(std::size_t _genCoordIndex) const override
Return true if _genCoordIndex-th generalized coordinate.
Definition BodyNode.cpp:1036
void duplicateNodes(const BodyNode *otherBodyNode)
Give this BodyNode a copy of each Node from otherBodyNode.
Definition BodyNode.cpp:386
Eigen::Vector6d mImpF
Generalized impulsive body force w.r.t. body frame.
Definition BodyNode.hpp:1233
virtual double getKineticEnergy() const
Return kinetic energy.
Definition BodyNode.cpp:2015
bool mIsPartialAccelerationDirty
Is the partial acceleration vector dirty.
Definition BodyNode.hpp:1176
void setColor(const Eigen::Vector3d &color)
Sets the RGB color of the ShapeNodes that are currently in this BodyNode.
Definition BodyNode.cpp:1617
virtual void aggregateCombinedVector(Eigen::VectorXd &_Cg, const Eigen::Vector3d &_gravity)
Definition BodyNode.cpp:2134
std::size_t getNumChildBodyNodes() const
Return the number of child BodyNodes.
Definition BodyNode.cpp:912
std::size_t getNumDependentDofs() const override
Same as getNumDependentGenCoords()
Definition BodyNode.cpp:1065
std::size_t getIndexInSkeleton() const
Return the index of this BodyNode within its Skeleton.
Definition BodyNode.cpp:725
void updateWorldJacobian() const
Update the World Jacobian.
Definition BodyNode.cpp:2459
AllNodeProperties getAllNodeProperties() const
Get the Node::Properties of all Nodes attached to this BodyNode.
Definition BodyNode.cpp:310
Eigen::Vector3d getCOM(const Frame *_withRespectTo=Frame::World()) const
Return the center of mass with respect to an arbitrary Frame.
Definition BodyNode.cpp:624
Eigen::Vector6d mArbitrarySpatial
Cache data for arbitrary spatial value.
Definition BodyNode.hpp:1217
const math::Inertia & getArticulatedInertiaImplicit() const
Return the articulated body inertia for implicit joint damping and spring forces.
Definition BodyNode.cpp:600
std::size_t getNumShapeNodesWith() const
Return the number of ShapeNodes containing given Aspect in this BodyNode.
Definition BodyNode.hpp:206
std::size_t getTreeIndex() const
Return the index of the tree that this BodyNode belongs to.
Definition BodyNode.cpp:737
void setExtForce(const Eigen::Vector3d &_force, const Eigen::Vector3d &_offset=Eigen::Vector3d::Zero(), bool _isForceLocal=false, bool _isOffsetLocal=true)
Set Applying linear Cartesian forces to this node.
Definition BodyNode.cpp:1233
Eigen::Vector6d mFgravity
Spatial gravity force.
Definition BodyNode.hpp:1183
void dirtyArticulatedInertia()
Notify the Skeleton that the tree of this BodyNode needs an articulated inertia update.
Definition BodyNode.cpp:1584
math::Jacobian mBodyJacobian
Body Jacobian.
Definition BodyNode.hpp:1152
math::Jacobian mWorldJacobianClassicDeriv
Classic time derivative of Body Jacobian.
Definition BodyNode.hpp:1167
Eigen::Vector6d getCOMSpatialVelocity() const
Return the spatial velocity of the center of mass, expressed in coordinates of this Frame and relativ...
Definition BodyNode.cpp:637
BodyNode & operator=(const BodyNode &_otherBodyNode)
Same as copy(const BodyNode&)
Definition BodyNode.cpp:379
virtual void init(const SkeletonPtr &_skeleton)
Initialize the vector members with proper sizes.
Definition BodyNode.cpp:1367
const math::Jacobian & getJacobian() const override final
Return the generalized Jacobian targeting the origin of this BodyNode.
Definition BodyNode.cpp:1153
void dirtyExternalForces()
Tell the Skeleton that the external forces need to be updated.
Definition BodyNode.cpp:1598
Eigen::Vector6d mFext_F
Cache data for external force vector of the system.
Definition BodyNode.hpp:1206
const std::vector< DegreeOfFreedom * > & getDependentDofs() override
Return a std::vector of DegreeOfFreedom pointers that this Node depends on.
Definition BodyNode.cpp:1085
std::size_t getNumDependentGenCoords() const override
The number of the generalized coordinates which affect this JacobianNode.
Definition BodyNode.cpp:1045
void processRemovedEntity(Entity *_oldChildEntity) override
Remove this Entity from mChildBodyNodes or mNonBodyNodeEntities.
Definition BodyNode.cpp:1484
void setConstraintImpulse(const Eigen::Vector6d &_constImp)
Set constraint impulse.
Definition BodyNode.cpp:1989
const Eigen::Vector6d & getConstraintImpulse() const
Return constraint impulse.
Definition BodyNode.cpp:2003
std::pair< Joint *, BodyNode * > copyTo(BodyNode *_newParent, bool _recursive=true)
Create clones of this BodyNode and all of its children recursively (unless _recursive is set to false...
Definition BodyNode.cpp:818
math::Inertia mArtInertiaImplicit
Articulated body inertia for implicit joint damping and spring forces.
Definition BodyNode.hpp:1193
const Eigen::Vector6d & getRelativeSpatialVelocity() const override
Get the spatial velocity of this Frame relative to its parent Frame, in its own coordinates.
Definition BodyNode.cpp:1126
std::size_t getDependentGenCoordIndex(std::size_t _arrayIndex) const override
Return a generalized coordinate index from the array index (< getNumDependentDofs)
Definition BodyNode.cpp:1051
void setInertia(const Inertia &inertia)
Set the inertia data for this BodyNode.
Definition BodyNode.cpp:566
void setMass(double mass)
Set the mass of the bodynode.
Definition BodyNode.cpp:509
std::size_t getNumChildJoints() const
Return the number of child Joints.
Definition BodyNode.cpp:930
virtual void aggregateExternalForces(Eigen::VectorXd &_Fext)
Aggregate the external forces mFext in the generalized coordinates recursively.
Definition BodyNode.cpp:2168
DegreeOfFreedom class is a proxy class for accessing single degrees of freedom (aka generalized coord...
Definition DegreeOfFreedom.hpp:56
Definition EndEffector.hpp:81
Entity class is a base class for any objects that exist in the kinematic tree structure of DART.
Definition Entity.hpp:62
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 Inertia.hpp:44
class Joint
Definition Joint.hpp:61
Definition Marker.hpp:51
Definition Node.hpp:52
The Node class is a base class for BodyNode and any object that attaches to a BodyNode.
Definition Node.hpp:80
Definition PointMass.hpp:53
Definition ShapeNode.hpp:49
Definition BodyNodePtr.hpp:54
class Skeleton
Definition Skeleton.hpp:60
SoftBodyNode represent a soft body that has one deformable skin.
Definition SoftBodyNode.hpp:46
TemplatedJacobianNode provides a curiously recurring template pattern implementation of the various J...
Definition TemplatedJacobianNode.hpp:51
Definition Random-impl.hpp:92
Matrix< double, 6, 1 > Vector6d
Definition MathTypes.hpp:49
Matrix< double, 6, 6 > Matrix6d
Definition MathTypes.hpp:50
std::map< std::type_index, std::unique_ptr< NodeTypePropertiesVector > > NodePropertiesMap
Definition BodyNodeAspect.hpp:127
common::CloneableMap< NodePropertiesMap > AllNodeProperties
Definition BodyNodeAspect.hpp:128
common::CloneableMap< NodeStateMap > AllNodeStates
Definition BodyNodeAspect.hpp:121
std::map< std::type_index, std::unique_ptr< NodeTypeStateVector > > NodeStateMap
Definition BodyNodeAspect.hpp:120
std::shared_ptr< const Skeleton > ConstSkeletonPtr
Definition SmartPointer.hpp:60
std::shared_ptr< Shape > ShapePtr
Definition SmartPointer.hpp:81
std::shared_ptr< const Shape > ConstShapePtr
Definition SmartPointer.hpp:81
std::shared_ptr< Skeleton > SkeletonPtr
Definition SmartPointer.hpp:60
Eigen::Matrix6d Inertia
Definition MathTypes.hpp:111
Definition BulletCollisionDetector.cpp:60
Definition BodyNodeAspect.hpp:68