dart
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
dart::dynamics::BodyNode Class Reference

BodyNode class represents a single node of the skeleton. More...

#include <BodyNode.hpp>

Inheritance diagram for dart::dynamics::BodyNode:
dart::common::EmbedStateAndPropertiesOnTopOf< DerivedT, StateDataT, PropertiesDataT, CompositeBases > dart::dynamics::BodyNodeSpecializedFor< ShapeNode, EndEffector, Marker > dart::dynamics::SkeletonRefCountingBase dart::dynamics::TemplatedJacobianNode< BodyNode > dart::common::CompositeJoiner< EmbedStateAndProperties< DerivedT, StateDataT, PropertiesDataT >, CompositeBases... > dart::dynamics::JacobianNode dart::dynamics::Frame dart::dynamics::Node dart::dynamics::Entity dart::common::Subject dart::common::VersionCounter dart::common::Subject

Public Types

using ColShapeAddedSignal = common::Signal< void(const BodyNode *, ConstShapePtr _newColShape)>
 
using ColShapeRemovedSignal = ColShapeAddedSignal
 
using StructuralChangeSignal = common::Signal< void(const BodyNode *)>
 
using CompositeProperties = common::Composite::Properties
 
using AllNodeStates = detail::AllNodeStates
 
using NodeStateMap = detail::NodeStateMap
 
using AllNodeProperties = detail::AllNodeProperties
 
using NodePropertiesMap = detail::NodePropertiesMap
 
using AspectProperties = detail::BodyNodeAspectProperties
 
using Properties = common::Composite::MakeProperties< BodyNode >
 
- Public Types inherited from dart::common::EmbedStateAndPropertiesOnTopOf< DerivedT, StateDataT, PropertiesDataT, CompositeBases >
using Impl = EmbedStateAndProperties< DerivedT, StateDataT, PropertiesDataT >
 
using Derived = typename Impl::Derived
 
using AspectStateData = typename Impl::AspectStateData
 
using AspectState = typename Impl::AspectState
 
using AspectPropertiesData = typename Impl::AspectPropertiesData
 
using AspectProperties = typename Impl::AspectProperties
 
using Aspect = typename Impl::Aspect
 
using Base = CompositeJoiner< Impl, CompositeBases... >
 
- Public Types inherited from dart::dynamics::Entity
using EntitySignal = common::Signal< void(const Entity *)>
 
using FrameChangedSignal = common::Signal< void(const Entity *, const Frame *_oldFrame, const Frame *_newFrame)>
 
using NameChangedSignal = common::Signal< void(const Entity *, const std::string &_oldName, const std::string &_newName)>
 
- Public Types inherited from dart::dynamics::Node
template<class Mixin >
using MakeState = common::MakeCloneable< State, Mixin >
 Use the MakeState class to easily create a State extension from an existing class or struct.
 
template<class Mixin >
using MakeProperties = common::MakeCloneable< Properties, Mixin >
 Use the MakeProperties class to easily create a Properties extension from an existing class or struct. More...
 

Public Member Functions

 BodyNode (const BodyNode &)=delete
 
virtual ~BodyNode ()
 Destructor.
 
virtual SoftBodyNodeasSoftBodyNode ()
 Convert 'this' into a SoftBodyNode pointer if this BodyNode is a SoftBodyNode, otherwise return nullptr.
 
virtual const SoftBodyNodeasSoftBodyNode () const
 Convert 'const this' into a SoftBodyNode pointer if this BodyNode is a SoftBodyNode, otherwise return nullptr.
 
void setAllNodeStates (const AllNodeStates &states)
 Set the Node::State of all Nodes attached to this BodyNode.
 
AllNodeStates getAllNodeStates () const
 Get the Node::State of all Nodes attached to this BodyNode.
 
void setAllNodeProperties (const AllNodeProperties &properties)
 Set the Node::Properties of all Nodes attached to this BodyNode.
 
AllNodeProperties getAllNodeProperties () const
 Get the Node::Properties of all Nodes attached to this BodyNode.
 
void setProperties (const CompositeProperties &_properties)
 Same as setCompositeProperties()
 
void setProperties (const AspectProperties &_properties)
 Set the UniqueProperties of this BodyNode.
 
void setAspectState (const AspectState &state)
 Set the AspectState of this BodyNode.
 
void setAspectProperties (const AspectProperties &properties)
 Set the AspectProperties of this BodyNode.
 
Properties getBodyNodeProperties () const
 Get the Properties of this BodyNode.
 
void copy (const BodyNode &otherBodyNode)
 Copy the Properties of another BodyNode.
 
void copy (const BodyNode *otherBodyNode)
 Copy the Properties of another BodyNode.
 
BodyNodeoperator= (const BodyNode &_otherBodyNode)
 Same as copy(const BodyNode&)
 
void duplicateNodes (const BodyNode *otherBodyNode)
 Give this BodyNode a copy of each Node from otherBodyNode.
 
void matchNodes (const BodyNode *otherBodyNode)
 Make the Nodes of this BodyNode match the Nodes of otherBodyNode. More...
 
const std::string & setName (const std::string &_name) override
 Set name. More...
 
const std::string & getName () const override
 Get the name of this Node.
 
void setGravityMode (bool _gravityMode)
 Set whether gravity affects this body. More...
 
bool getGravityMode () const
 Return true if gravity mode is enabled.
 
bool isCollidable () const
 Return true if this body can collide with others bodies.
 
void setCollidable (bool _isCollidable)
 Set whether this body node will collide with others in the world. More...
 
void setMass (double mass)
 Set the mass of the bodynode.
 
double getMass () const
 Return the mass of the bodynode.
 
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. More...
 
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.
 
const Eigen::Matrix6d & getSpatialInertia () const
 Return spatial inertia.
 
void setInertia (const Inertia &inertia)
 Set the inertia data for this BodyNode.
 
const InertiagetInertia () const
 Get the inertia data for this BodyNode.
 
const math::Inertia & getArticulatedInertia () const
 Return the articulated body inertia.
 
const math::Inertia & getArticulatedInertiaImplicit () const
 Return the articulated body inertia for implicit joint damping and spring forces.
 
void setLocalCOM (const Eigen::Vector3d &_com)
 Set center of mass expressed in body frame.
 
const Eigen::Vector3d & getLocalCOM () const
 Return center of mass expressed in body frame.
 
Eigen::Vector3d getCOM (const Frame *_withRespectTo=Frame::World()) const
 Return the center of mass with respect to an arbitrary Frame.
 
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.
 
Eigen::Vector6d getCOMSpatialVelocity () const
 Return the spatial velocity of the center of mass, expressed in coordinates of this Frame and relative to the World Frame.
 
Eigen::Vector6d getCOMSpatialVelocity (const Frame *_relativeTo, const Frame *_inCoordinatesOf) const
 Return the spatial velocity of the center of mass, expressed in terms of arbitrary Frames.
 
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.
 
Eigen::Vector6d getCOMSpatialAcceleration () const
 Return the acceleration of the center of mass expressed in coordinates of this BodyNode Frame and relative to the World Frame.
 
Eigen::Vector6d getCOMSpatialAcceleration (const Frame *_relativeTo, const Frame *_inCoordinatesOf) const
 Return the spatial acceleration of the center of mass, expressed in terms of arbitrary Frames.
 
void setFrictionCoeff (double _coeff)
 Set coefficient of friction in range of [0, ~]. More...
 
double getFrictionCoeff () const
 Return frictional coefficient. More...
 
void setRestitutionCoeff (double _coeff)
 Set coefficient of restitution in range of [0, 1]. More...
 
double getRestitutionCoeff () const
 Return coefficient of restitution. More...
 
std::size_t getIndexInSkeleton () const
 Return the index of this BodyNode within its Skeleton.
 
std::size_t getIndexInTree () const
 Return the index of this BodyNode within its tree.
 
std::size_t getTreeIndex () const
 Return the index of the tree that this BodyNode belongs to.
 
SkeletonPtr remove (const std::string &_name="temporary")
 Remove this BodyNode and all of its children (recursively) from their Skeleton. More...
 
bool moveTo (BodyNode *_newParent)
 Remove this BodyNode and all of its children (recursively) from their current parent BodyNode, and move them to another parent BodyNode. More...
 
bool moveTo (const SkeletonPtr &_newSkeleton, BodyNode *_newParent)
 This is a version of moveTo(BodyNode*) that allows you to explicitly move this BodyNode into a different Skeleton. More...
 
template<class JointType >
JointType * moveTo (BodyNode *_newParent, const typename JointType::Properties &_joint=typename JointType::Properties())
 A version of moveTo(BodyNode*) that also changes the Joint type of the parent Joint of this BodyNode. More...
 
template<class JointType >
JointType * moveTo (const SkeletonPtr &_newSkeleton, BodyNode *_newParent, const typename JointType::Properties &_joint=typename JointType::Properties())
 A version of moveTo(SkeletonPtr, BodyNode*) that also changes the Joint type of the parent Joint of this BodyNode. More...
 
SkeletonPtr split (const std::string &_skeletonName)
 Remove this BodyNode and all of its children (recursively) from their current Skeleton and move them into a newly created Skeleton. More...
 
template<class JointType >
SkeletonPtr split (const std::string &_skeletonName, const typename JointType::Properties &_joint=typename JointType::Properties())
 A version of split(const std::string&) that also changes the Joint type of the parent Joint of this BodyNode. More...
 
template<class JointType >
JointType * changeParentJointType (const typename JointType::Properties &_joint=typename JointType::Properties())
 Change the Joint type of this BodyNode's parent Joint. More...
 
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) and attach the clones to the specified BodyNode. More...
 
std::pair< Joint *, BodyNode * > copyTo (const SkeletonPtr &_newSkeleton, BodyNode *_newParent, bool _recursive=true) const
 Create clones of this BodyNode and all of its children recursively (unless recursive is set to false) and attach the clones to the specified BodyNode of the specified Skeleton. More...
 
template<class JointType >
std::pair< JointType *, BodyNode * > copyTo (BodyNode *_newParent, const typename JointType::Properties &_joint=typename JointType::Properties(), bool _recursive=true)
 A version of copyTo(BodyNode*) that also changes the Joint type of the parent Joint of this BodyNode. More...
 
template<class JointType >
std::pair< JointType *, BodyNode * > copyTo (const SkeletonPtr &_newSkeleton, BodyNode *_newParent, const typename JointType::Properties &_joint=typename JointType::Properties(), bool _recursive=true) const
 A version of copyTo(Skeleton*,BodyNode*) that also changes the Joint type of the parent Joint of this BodyNode. More...
 
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 the specified name to attach them to. More...
 
template<class JointType >
SkeletonPtr copyAs (const std::string &_skeletonName, const typename JointType::Properties &_joint=typename JointType::Properties(), bool _recursive=true) const
 A version of copyAs(const std::string&) that also changes the Joint type of the root BodyNode. More...
 
SkeletonPtr getSkeleton () override
 Return the Skeleton that this Node is attached to.
 
ConstSkeletonPtr getSkeleton () const override
 Return the Skeleton that this Node is attached to.
 
JointgetParentJoint ()
 Return the parent Joint of this BodyNode.
 
const JointgetParentJoint () const
 Return the (const) parent Joint of this BodyNode.
 
BodyNodegetParentBodyNode ()
 Return the parent BodyNdoe of this BodyNode.
 
const BodyNodegetParentBodyNode () const
 Return the (const) parent BodyNode of this BodyNode.
 
template<class JointType , class NodeType = BodyNode>
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.
 
std::size_t getNumChildBodyNodes () const
 Return the number of child BodyNodes.
 
BodyNodegetChildBodyNode (std::size_t _index)
 Return the _index-th child BodyNode of this BodyNode.
 
const BodyNodegetChildBodyNode (std::size_t _index) const
 Return the (const) _index-th child BodyNode of this BodyNode.
 
std::size_t getNumChildJoints () const
 Return the number of child Joints.
 
JointgetChildJoint (std::size_t _index)
 Return the _index-th child Joint of this BodyNode.
 
const JointgetChildJoint (std::size_t _index) const
 Return the (const) _index-th child Joint of this BodyNode.
 
template<class NodeType , typename... Args>
NodeType * createNode (Args &&... args)
 Create some Node type and attach it to this BodyNode.
 
template<class ShapeNodeProperties >
ShapeNodecreateShapeNode (ShapeNodeProperties properties, bool automaticName=true)
 Create an ShapeNode attached to this BodyNode. More...
 
template<class ShapeType >
ShapeNodecreateShapeNode (const std::shared_ptr< ShapeType > &shape)
 Create a ShapeNode with an automatically assigned name: <BodyNodeName>_ShapeNode_<#>. More...
 
template<class ShapeType , class StringType >
ShapeNodecreateShapeNode (const std::shared_ptr< ShapeType > &shape, StringType &&name)
 Create a ShapeNode with the specified name.
 
const std::vector< ShapeNode * > getShapeNodes ()
 Return the list of ShapeNodes.
 
const std::vector< const ShapeNode * > getShapeNodes () const
 Return the list of (const) ShapeNodes.
 
void removeAllShapeNodes ()
 Remove all ShapeNodes from this BodyNode.
 
template<class... Aspects>
ShapeNodecreateShapeNodeWith (const ShapePtr &shape)
 Create a ShapeNode with the specified Aspects and an automatically assigned name: <BodyNodeName>_ShapeNode_<#>. More...
 
template<class... Aspects>
ShapeNodecreateShapeNodeWith (const ShapePtr &shape, const std::string &name)
 Create a ShapeNode with the specified name and Aspects.
 
template<class Aspect >
std::size_t getNumShapeNodesWith () const
 Return the number of ShapeNodes containing given Aspect in this BodyNode.
 
template<class Aspect >
const std::vector< ShapeNode * > getShapeNodesWith ()
 Return the list of ShapeNodes containing given Aspect.
 
template<class Aspect >
const std::vector< const ShapeNode * > getShapeNodesWith () const
 Return the list of ShapeNodes containing given Aspect.
 
template<class Aspect >
void removeAllShapeNodesWith ()
 Remove all ShapeNodes containing given Aspect from this BodyNode.
 
EndEffectorcreateEndEffector (const EndEffector::BasicProperties &_properties)
 Create an EndEffector attached to this BodyNode. More...
 
EndEffectorcreateEndEffector (const std::string &_name="EndEffector")
 Create an EndEffector with the specified name.
 
EndEffectorcreateEndEffector (const char *_name)
 Create an EndEffector with the specified name.
 
MarkercreateMarker (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.
 
MarkercreateMarker (const Marker::BasicProperties &properties)
 Create a Marker given its basic properties.
 
bool dependsOn (std::size_t _genCoordIndex) const override
 Return true if _genCoordIndex-th generalized coordinate.
 
std::size_t getNumDependentGenCoords () const override
 The number of the generalized coordinates which affect this JacobianNode.
 
std::size_t getDependentGenCoordIndex (std::size_t _arrayIndex) const override
 Return a generalized coordinate index from the array index (< getNumDependentDofs)
 
const std::vector< std::size_t > & getDependentGenCoordIndices () const override
 Indices of the generalized coordinates which affect this JacobianNode.
 
std::size_t getNumDependentDofs () const override
 Same as getNumDependentGenCoords()
 
DegreeOfFreedomgetDependentDof (std::size_t _index) override
 Get a pointer to the _indexth dependent DegreeOfFreedom for this BodyNode.
 
const DegreeOfFreedomgetDependentDof (std::size_t _index) const override
 Get a pointer to the _indexth dependent DegreeOfFreedom for this BodyNode.
 
const std::vector< DegreeOfFreedom * > & getDependentDofs () override
 Return a std::vector of DegreeOfFreedom pointers that this Node depends on.
 
const std::vector< const DegreeOfFreedom * > & getDependentDofs () const override
 Return a std::vector of DegreeOfFreedom pointers that this Node depends on.
 
const std::vector< const DegreeOfFreedom * > getChainDofs () const override
 Returns a DegreeOfFreedom vector containing the dofs that form a Chain leading up to this JacobianNode from the root of the Skeleton. More...
 
const Eigen::Isometry3d & getRelativeTransform () const override
 Get the transform of this BodyNode with respect to its parent BodyNode, which is also its parent Frame. More...
 
const Eigen::Vector6d & getRelativeSpatialVelocity () const override
 Get the spatial velocity of this Frame relative to its parent Frame, in its own coordinates. More...
 
const Eigen::Vector6d & getRelativeSpatialAcceleration () const override
 Get the spatial acceleration of this Frame relative to its parent Frame, in the coordinates of this Frame. More...
 
const Eigen::Vector6d & getPrimaryRelativeAcceleration () const override
 The Featherstone ABI algorithm exploits a component of the spatial acceleration which we refer to as the partial acceleration, accessible by getPartialAcceleration(). More...
 
const Eigen::Vector6d & getPartialAcceleration () const override
 Return the partial acceleration of this body.
 
const math::Jacobian & getJacobian () const override final
 Return the generalized Jacobian targeting the origin of this BodyNode. More...
 
const math::Jacobian & getWorldJacobian () const override final
 Return the generalized Jacobian targeting the origin of this BodyNode. More...
 
const math::Jacobian & getJacobianSpatialDeriv () const override final
 Return the spatial time derivative of the generalized Jacobian targeting the origin of this BodyNode. More...
 
const math::Jacobian & getJacobianClassicDeriv () const override final
 Return the classical time derivative of the generalized Jacobian targeting the origin of this BodyNode. More...
 
const Eigen::Vector6d & getBodyVelocityChange () const
 Return the velocity change due to the constraint impulse.
 
void setColliding (bool _isColliding)
 Set whether this body node is colliding with other objects. More...
 
bool isColliding ()
 Return whether this body node is set to be colliding with other objects. More...
 
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. More...
 
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.
 
void addExtTorque (const Eigen::Vector3d &_torque, bool _isLocal=false)
 Add applying Cartesian torque to the node. More...
 
void setExtTorque (const Eigen::Vector3d &_torque, bool _isLocal=false)
 Set applying Cartesian torque to the node. More...
 
virtual void clearExternalForces ()
 Clean up structures that store external forces: mContacts, mFext, mExtForceBody and mExtTorqueBody. More...
 
virtual void clearInternalForces ()
 Clear out the generalized forces of the parent Joint and any other forces related to this BodyNode that are internal to the Skeleton. More...
 
const Eigen::Vector6d & getExternalForceLocal () const
 
Eigen::Vector6d getExternalForceGlobal () const
 
const Eigen::Vector6d & getBodyForce () const
 Get spatial body force transmitted from the parent joint. More...
 
bool isReactive () const
 Return true if the body can react to force or constraint impulse. More...
 
void setConstraintImpulse (const Eigen::Vector6d &_constImp)
 Set constraint impulse. More...
 
void addConstraintImpulse (const Eigen::Vector6d &_constImp)
 Add constraint impulse. More...
 
void addConstraintImpulse (const Eigen::Vector3d &_constImp, const Eigen::Vector3d &_offset, bool _isImpulseLocal=false, bool _isOffsetLocal=true)
 Add constraint impulse.
 
virtual void clearConstraintImpulse ()
 Clear constraint impulses and cache data used for impulse-based forward dynamics algorithm.
 
const Eigen::Vector6d & getConstraintImpulse () const
 Return constraint impulse.
 
double computeLagrangian (const Eigen::Vector3d &gravity) const
 Return Lagrangian of this body.
 
virtual double getKineticEnergy () const
 Return kinetic energy.
 
double computeKineticEnergy () const
 Return kinetic energy.
 
virtual double getPotentialEnergy (const Eigen::Vector3d &_gravity) const
 Return potential energy.
 
double computePotentialEnergy (const Eigen::Vector3d &gravity) const
 Return potential energy.
 
Eigen::Vector3d getLinearMomentum () const
 Return linear momentum.
 
Eigen::Vector3d getAngularMomentum (const Eigen::Vector3d &_pivot=Eigen::Vector3d::Zero())
 Return angular momentum.
 
void dirtyTransform () override
 Notify the transformation updates of this Frame and all its children are needed.
 
void dirtyVelocity () override
 Notify the velocity updates of this Frame and all its children are needed.
 
void dirtyAcceleration () override
 Notify the acceleration updates of this Frame and all its children are needed.
 
void notifyArticulatedInertiaUpdate ()
 Notify the Skeleton that the tree of this BodyNode needs an articulated inertia update.
 
void dirtyArticulatedInertia ()
 Notify the Skeleton that the tree of this BodyNode needs an articulated inertia update.
 
void notifyExternalForcesUpdate ()
 Tell the Skeleton that the external forces need to be updated.
 
void dirtyExternalForces ()
 Tell the Skeleton that the external forces need to be updated.
 
void notifyCoriolisUpdate ()
 Tell the Skeleton that the coriolis forces need to be update.
 
void dirtyCoriolisForces ()
 Tell the Skeleton that the coriolis forces need to be update.
 
- Public Member Functions inherited from dart::common::EmbedStateAndPropertiesOnTopOf< DerivedT, StateDataT, PropertiesDataT, CompositeBases >
template<typename... Args>
 EmbedStateAndPropertiesOnTopOf (Args &&... args)
 
- Public Member Functions inherited from dart::dynamics::SkeletonRefCountingBase
std::shared_ptr< SkeletongetSkeleton ()
 Return the Skeleton this BodyNode belongs to.
 
std::shared_ptr< const SkeletongetSkeleton () const
 Return the (const) Skeleton this BodyNode belongs to.
 
- Public Member Functions inherited from dart::dynamics::TemplatedJacobianNode< BodyNode >
math::Jacobian getJacobian (const Frame *_inCoordinatesOf) const override final
 A version of getJacobian() that lets you specify a coordinate Frame to express the Jacobian in. More...
 
math::Jacobian getJacobian (const Eigen::Vector3d &_offset) const override final
 Return the generalized Jacobian targeting an offset within the Frame of this JacobianNode. More...
 
math::Jacobian getJacobian (const Eigen::Vector3d &_offset, const Frame *_inCoordinatesOf) const override final
 A version of getJacobian(const Eigen::Vector3d&) that lets you specify a coordinate Frame to express the Jacobian in. More...
 
math::Jacobian getWorldJacobian (const Eigen::Vector3d &_offset) const override final
 Return the generalized Jacobian targeting an offset in this JacobianNode. More...
 
math::LinearJacobian getLinearJacobian (const Frame *_inCoordinatesOf=Frame::World()) const override final
 Return the linear Jacobian targeting the origin of this BodyNode. More...
 
math::LinearJacobian getLinearJacobian (const Eigen::Vector3d &_offset, const Frame *_inCoordinatesOf=Frame::World()) const override final
 Return the generalized Jacobian targeting an offset within the Frame of this BodyNode. More...
 
math::AngularJacobian getAngularJacobian (const Frame *_inCoordinatesOf=Frame::World()) const override final
 Return the angular Jacobian targeting the origin of this BodyNode. More...
 
math::Jacobian getJacobianSpatialDeriv (const Frame *_inCoordinatesOf) const override final
 A version of getJacobianSpatialDeriv() that can return the Jacobian in coordinates of any Frame. More...
 
math::Jacobian getJacobianSpatialDeriv (const Eigen::Vector3d &_offset) const override final
 Return the spatial time derivative of the generalized Jacobian targeting an offset in the Frame of this BodyNode. More...
 
math::Jacobian getJacobianSpatialDeriv (const Eigen::Vector3d &_offset, const Frame *_inCoordinatesOf) const override final
 A version of getJacobianSpatialDeriv(const Eigen::Vector3d&) that allows an arbitrary coordinate Frame to be specified. More...
 
math::Jacobian getJacobianClassicDeriv (const Frame *_inCoordinatesOf) const override final
 A version of getJacobianClassicDeriv() that can return the Jacobian in coordinates of any Frame. More...
 
math::Jacobian getJacobianClassicDeriv (const Eigen::Vector3d &_offset, const Frame *_inCoordinatesOf=Frame::World()) const override final
 A version of getJacobianClassicDeriv() that can compute the Jacobian for an offset within the Frame of this BodyNode. More...
 
math::LinearJacobian getLinearJacobianDeriv (const Frame *_inCoordinatesOf=Frame::World()) const override final
 Return the linear Jacobian (classical) time derivative, in terms of any coordinate Frame. More...
 
math::LinearJacobian getLinearJacobianDeriv (const Eigen::Vector3d &_offset, const Frame *_inCoordinatesOf=Frame::World()) const override final
 A version of getLinearJacobianDeriv() that can compute the Jacobian for an offset within the Frame of this BodyNode. More...
 
math::AngularJacobian getAngularJacobianDeriv (const Frame *_inCoordinatesOf=Frame::World()) const override final
 Return the angular Jacobian time derivative, in terms of any coordinate Frame. More...
 
- Public Member Functions inherited from dart::dynamics::JacobianNode
virtual ~JacobianNode ()
 Virtual destructor.
 
const std::shared_ptr< InverseKinematics > & getIK (bool _createIfNull=false)
 Get a pointer to an IK module for this JacobianNode. More...
 
const std::shared_ptr< InverseKinematics > & getOrCreateIK ()
 Get a pointer to an IK module for this JacobianNode. More...
 
std::shared_ptr< const InverseKinematicsgetIK () const
 Get a pointer to an IK module for this JacobianNode. More...
 
const std::shared_ptr< InverseKinematics > & createIK ()
 Create a new IK module for this JacobianNode. More...
 
void clearIK ()
 Wipe away the IK module for this JacobianNode, leaving it as a nullptr.
 
void notifyJacobianUpdate ()
 Notify this BodyNode and all its descendents that their Jacobians need to be updated. More...
 
void dirtyJacobian ()
 Notify this BodyNode and all its descendents that their Jacobians need to be updated. More...
 
void notifyJacobianDerivUpdate ()
 Notify this BodyNode and all its descendents that their Jacobian derivatives need to be updated. More...
 
void dirtyJacobianDeriv ()
 Notify this BodyNode and all its descendents that their Jacobian derivatives need to be updated. More...
 
- Public Member Functions inherited from dart::dynamics::Frame
 Frame (const Frame &)=delete
 
 ~Frame () override
 Destructor.
 
const Eigen::Isometry3d & getWorldTransform () const
 Get the transform of this Frame with respect to the World Frame.
 
Eigen::Isometry3d getTransform (const Frame *_withRespectTo=Frame::World()) const
 Get the transform of this Frame with respect to some other Frame.
 
Eigen::Isometry3d getTransform (const Frame *withRespectTo, const Frame *inCoordinatesOf) const
 Get the transform of this Frame with respect to some other Frame. More...
 
const Eigen::Vector6d & getSpatialVelocity () const
 Get the total spatial velocity of this Frame in the coordinates of this Frame. More...
 
Eigen::Vector6d getSpatialVelocity (const Frame *_relativeTo, const Frame *_inCoordinatesOf) const
 Get the spatial velocity of this Frame relative to some other Frame. More...
 
Eigen::Vector6d getSpatialVelocity (const Eigen::Vector3d &_offset) const
 Get the spatial velocity of a fixed point in this Frame. More...
 
Eigen::Vector6d getSpatialVelocity (const Eigen::Vector3d &_offset, const Frame *_relativeTo, const Frame *_inCoordinatesOf) const
 Get the spatial velocity of a fixed point in this Frame.
 
Eigen::Vector3d getLinearVelocity (const Frame *_relativeTo=Frame::World(), const Frame *_inCoordinatesOf=Frame::World()) const
 Get the linear portion of classical velocity of this Frame relative to some other Frame. More...
 
Eigen::Vector3d getLinearVelocity (const Eigen::Vector3d &_offset, const Frame *_relativeTo=Frame::World(), const Frame *_inCoordinatesOf=Frame::World()) const
 Get the linear velocity of a point that is fixed in this Frame. More...
 
Eigen::Vector3d getAngularVelocity (const Frame *_relativeTo=Frame::World(), const Frame *_inCoordinatesOf=Frame::World()) const
 Get the angular portion of classical velocity of this Frame relative to some other Frame. More...
 
const Eigen::Vector6d & getSpatialAcceleration () const
 Get the total spatial acceleration of this Frame in the coordinates of this Frame. More...
 
Eigen::Vector6d getSpatialAcceleration (const Frame *_relativeTo, const Frame *_inCoordinatesOf) const
 Get the spatial acceleration of this Frame relative to some other Frame. More...
 
Eigen::Vector6d getSpatialAcceleration (const Eigen::Vector3d &_offset) const
 Get the spatial acceleration of a fixed point in this Frame. More...
 
Eigen::Vector6d getSpatialAcceleration (const Eigen::Vector3d &_offset, const Frame *_relativeTo, const Frame *_inCoordinatesOf) const
 Get the spatial acceleration of a fixed point in this Frame.
 
Eigen::Vector3d getLinearAcceleration (const Frame *_relativeTo=Frame::World(), const Frame *_inCoordinatesOf=Frame::World()) const
 Get the linear portion of classical acceleration of this Frame relative to some other Frame. More...
 
Eigen::Vector3d getLinearAcceleration (const Eigen::Vector3d &_offset, const Frame *_relativeTo=Frame::World(), const Frame *_inCoordinatesOf=Frame::World()) const
 
Eigen::Vector3d getAngularAcceleration (const Frame *_relativeTo=Frame::World(), const Frame *_inCoordinatesOf=Frame::World()) const
 Get the angular portion of classical acceleration of this Frame relative to some other Frame. More...
 
const std::set< Entity * > & getChildEntities ()
 Get a container with the Entities that are children of this Frame. More...
 
const std::set< const Entity * > getChildEntities () const
 Get a container with the Entities that are children of this Frame. More...
 
std::size_t getNumChildEntities () const
 Get the number of Entities that are currently children of this Frame.
 
const std::set< Frame * > & getChildFrames ()
 Get a container with the Frames that are children of this Frame. More...
 
std::set< const Frame * > getChildFrames () const
 Get a container with the Frames that are children of this Frame. More...
 
std::size_t getNumChildFrames () const
 Get the number of Frames that are currently children of this Frame.
 
bool isShapeFrame () const
 Returns true if this Frame is a ShapeFrame.
 
virtual ShapeFrameasShapeFrame ()
 Convert 'this' into a ShapeFrame pointer if Frame is a ShapeFrame, otherwise return nullptr.
 
virtual const ShapeFrameasShapeFrame () const
 Convert 'const this' into a ShapeFrame pointer if Frame is a ShapeFrame, otherwise return nullptr.
 
bool isWorld () const
 Returns true if this Frame is the World Frame.
 
- Public Member Functions inherited from dart::dynamics::Entity
 Entity (Frame *_refFrame, bool _quiet)
 Constructor for typical usage.
 
 Entity ()
 Default constructor, delegates to Entity(ConstructAbstract_t)
 
 Entity (const Entity &)=delete
 
virtual ~Entity ()
 Destructor.
 
FramegetParentFrame ()
 Get the parent (reference) frame of this Entity.
 
const FramegetParentFrame () const
 Get the parent (reference) frame of this Entity.
 
bool descendsFrom (const Frame *_someFrame) const
 Returns true if and only if this Entity is itself (i.e. More...
 
bool isFrame () const
 True iff this Entity is also a Frame.
 
bool isQuiet () const
 Returns true if this Entity is set to be quiet. More...
 
virtual void notifyTransformUpdate ()
 Notify the transformation update of this Entity that its parent Frame's pose is needed.
 
bool needsTransformUpdate () const
 Returns true iff a transform update is needed for this Entity.
 
virtual void notifyVelocityUpdate ()
 Notify the velocity update of this Entity that its parent Frame's velocity is needed.
 
bool needsVelocityUpdate () const
 Returns true iff a velocity update is needed for this Entity.
 
virtual void notifyAccelerationUpdate ()
 Notify the acceleration of this Entity that its parent Frame's acceleration is needed.
 
bool needsAccelerationUpdate () const
 Returns true iff an acceleration update is needed for this Entity.
 
- Public Member Functions inherited from dart::common::Subject
virtual ~Subject ()
 Destructor will notify all Observers that it is destructing.
 
- Public Member Functions inherited from dart::dynamics::Node
virtual ~Node ()=default
 Virtual destructor.
 
virtual void setNodeState (const State &otherState)
 Set the State of this Node. By default, this does nothing.
 
virtual std::unique_ptr< StategetNodeState () const
 Get the State of this Node. More...
 
virtual void copyNodeStateTo (std::unique_ptr< State > &outputState) const
 Copy the State of this Node into a unique_ptr. More...
 
virtual void setNodeProperties (const Properties &properties)
 Set the Properties of this Node. By default, this does nothing.
 
virtual std::unique_ptr< PropertiesgetNodeProperties () const
 Get the Properties of this Node. More...
 
virtual void copyNodePropertiesTo (std::unique_ptr< Properties > &outputProperties) const
 Copy the Properties of this Node into a unique_ptr. More...
 
BodyNodePtr getBodyNodePtr ()
 Get a pointer to the BodyNode that this Node is associated with.
 
ConstBodyNodePtr getBodyNodePtr () const
 Get a pointer to the BodyNode that this Node is associated with.
 
bool isRemoved () const
 Returns true if this Node has been staged for removal from its BodyNode. More...
 
- Public Member Functions inherited from dart::common::VersionCounter
 VersionCounter ()
 Default constructor.
 
virtual std::size_t incrementVersion ()
 Increment the version for this object.
 
virtual std::size_t getVersion () const
 Get the version number of this object.
 

Public Attributes

Slot registers
common::SlotRegister< ColShapeAddedSignalonColShapeAdded
 Slot register for collision shape added signal.
 
common::SlotRegister< ColShapeRemovedSignalonColShapeRemoved
 Slot register for collision shape removed signal.
 
common::SlotRegister< StructuralChangeSignalonStructuralChange
 Raised when (1) parent BodyNode is changed, (2) moved between Skeletons, (3) parent Joint is changed.
 
- Public Attributes inherited from dart::dynamics::Entity
common::SlotRegister< FrameChangedSignalonFrameChanged
 Slot register for frame changed signal.
 
common::SlotRegister< NameChangedSignalonNameChanged
 Slot register for name changed signal.
 
common::SlotRegister< EntitySignalonTransformUpdated
 Slot register for transform updated signal.
 
common::SlotRegister< EntitySignalonVelocityChanged
 Slot register for velocity updated signal.
 
common::SlotRegister< EntitySignalonAccelerationChanged
 Slot register for acceleration updated signal.
 

Protected Member Functions

 BodyNode (BodyNode *_parentBodyNode, Joint *_parentJoint, const Properties &_properties)
 Constructor called by Skeleton class.
 
 BodyNode (const std::tuple< BodyNode *, Joint *, Properties > &args)
 Delegating constructor.
 
virtual BodyNodeclone (BodyNode *_parentBodyNode, Joint *_parentJoint, bool cloneNodes) const
 Create a clone of this BodyNode. More...
 
NodecloneNode (BodyNode *bn) const override final
 This is needed in order to inherit the Node class, but it does nothing.
 
virtual void init (const SkeletonPtr &_skeleton)
 Initialize the vector members with proper sizes.
 
void addChildBodyNode (BodyNode *_body)
 Add a child bodynode into the bodynode.
 
Recursive dynamics routines
void processNewEntity (Entity *_newChildEntity) override
 Separate generic child Entities from child BodyNodes for more efficient update notices.
 
void processRemovedEntity (Entity *_oldChildEntity) override
 Remove this Entity from mChildBodyNodes or mNonBodyNodeEntities.
 
virtual void updateTransform ()
 Update transformation.
 
virtual void updateVelocity ()
 Update spatial body velocity.
 
virtual void updatePartialAcceleration () const
 Update partial spatial body acceleration due to parent joint's velocity.
 
virtual void updateArtInertia (double _timeStep) const
 Update articulated body inertia for forward dynamics. More...
 
virtual void updateBiasForce (const Eigen::Vector3d &_gravity, double _timeStep)
 Update bias force associated with the articulated body inertia for forward dynamics. More...
 
virtual void updateBiasImpulse ()
 Update bias impulse associated with the articulated body inertia for impulse-based forward dynamics. More...
 
virtual void updateAccelerationID ()
 Update spatial body acceleration with the partial spatial body acceleration for inverse dynamics. More...
 
virtual void updateAccelerationFD ()
 Update spatial body acceleration for forward dynamics.
 
virtual void updateVelocityChangeFD ()
 Update spatical body velocity change for impluse-based forward dynamics.
 
virtual void updateTransmittedForceID (const Eigen::Vector3d &_gravity, bool _withExternalForces=false)
 Update spatial body force for inverse dynamics. More...
 
virtual void updateTransmittedForceFD ()
 Update spatial body force for forward dynamics. More...
 
virtual void updateTransmittedImpulse ()
 Update spatial body force for impulse-based forward dynamics. More...
 
virtual void updateJointForceID (double _timeStep, bool _withDampingForces, bool _withSpringForces)
 Update the joint force for inverse dynamics.
 
virtual void updateJointForceFD (double _timeStep, bool _withDampingForces, bool _withSpringForces)
 Update the joint force for forward dynamics.
 
virtual void updateJointImpulseFD ()
 Update the joint impulse for forward dynamics.
 
virtual void updateConstrainedTerms (double _timeStep)
 Update constrained terms due to the constraint impulses for foward dynamics. More...
 
Equations of motion related routines
virtual void updateMassMatrix ()
 
virtual void aggregateMassMatrix (Eigen::MatrixXd &_MCol, std::size_t _col)
 
virtual void aggregateAugMassMatrix (Eigen::MatrixXd &_MCol, std::size_t _col, double _timeStep)
 
virtual void updateInvMassMatrix ()
 
virtual void updateInvAugMassMatrix ()
 
virtual void aggregateInvMassMatrix (Eigen::MatrixXd &_InvMCol, std::size_t _col)
 
virtual void aggregateInvAugMassMatrix (Eigen::MatrixXd &_InvMCol, std::size_t _col, double _timeStep)
 
virtual void aggregateCoriolisForceVector (Eigen::VectorXd &_C)
 
virtual void aggregateGravityForceVector (Eigen::VectorXd &_g, const Eigen::Vector3d &_gravity)
 
virtual void updateCombinedVector ()
 
virtual void aggregateCombinedVector (Eigen::VectorXd &_Cg, const Eigen::Vector3d &_gravity)
 
virtual void aggregateExternalForces (Eigen::VectorXd &_Fext)
 Aggregate the external forces mFext in the generalized coordinates recursively.
 
virtual void aggregateSpatialToGeneralized (Eigen::VectorXd &_generalized, const Eigen::Vector6d &_spatial)
 
void updateBodyJacobian () const
 Update body Jacobian. More...
 
void updateWorldJacobian () const
 Update the World Jacobian. More...
 
void updateBodyJacobianSpatialDeriv () const
 Update spatial time derivative of body Jacobian. More...
 
void updateWorldJacobianClassicDeriv () const
 Update classic time derivative of body Jacobian. More...
 
- Protected Member Functions inherited from dart::dynamics::SkeletonRefCountingBase
 SkeletonRefCountingBase ()
 Default Constructor.
 
- Protected Member Functions inherited from dart::dynamics::TemplatedJacobianNode< BodyNode >
 TemplatedJacobianNode (BodyNode *bn)
 Constructor.
 
- Protected Member Functions inherited from dart::dynamics::JacobianNode
 JacobianNode (BodyNode *bn)
 Constructor.
 
- Protected Member Functions inherited from dart::dynamics::Frame
 Frame (Frame *_refFrame)
 Constructor for typical usage.
 
 Frame ()
 Default constructor, delegates to Frame(ConstructAbstract_t)
 
 Frame (ConstructAbstractTag)
 Constructor for use by pure abstract classes.
 
virtual void changeParentFrame (Frame *_newParentFrame) override
 Used by derived classes to change their parent frames.
 
- Protected Member Functions inherited from dart::dynamics::Entity
 Entity (ConstructFrameTag)
 
 Entity (ConstructAbstractTag)
 
- Protected Member Functions inherited from dart::common::Subject
void sendDestructionNotification () const
 Send a destruction notification to all Observers. More...
 
void addObserver (Observer *_observer) const
 Add an Observer to the list of Observers.
 
void removeObserver (Observer *_observer) const
 Remove an Observer from the list of Observers.
 
- Protected Member Functions inherited from dart::dynamics::Node
 Node (BodyNode *_bn)
 Constructor.
 
std::string registerNameChange (const std::string &newName)
 Inform the Skeleton that the name of this Node has changed. More...
 
void attach ()
 Attach the Node to its BodyNode.
 
void stageForRemoval ()
 When all external references to the Node disappear, it will be deleted.
 
- Protected Member Functions inherited from dart::common::VersionCounter
void setVersionDependentObject (VersionCounter *dependent)
 

Protected Attributes

int mID
 A unique ID of this node globally.
 
bool mIsColliding
 Whether the node is currently in collision with another node. More...
 
std::size_t mIndexInSkeleton
 Index of this BodyNode in its Skeleton.
 
std::size_t mIndexInTree
 Index of this BodyNode in its Tree.
 
std::size_t mTreeIndex
 Index of this BodyNode's tree.
 
JointmParentJoint
 Parent joint.
 
BodyNodemParentBodyNode
 Parent body node.
 
std::vector< BodyNode * > mChildBodyNodes
 Array of child body nodes.
 
std::set< Entity * > mNonBodyNodeEntities
 Array of child Entities that are not BodyNodes. More...
 
std::vector< std::size_t > mDependentGenCoordIndices
 A increasingly sorted list of dependent dof indices.
 
std::vector< DegreeOfFreedom * > mDependentDofs
 A version of mDependentGenCoordIndices that holds DegreeOfFreedom pointers instead of indices.
 
std::vector< const DegreeOfFreedom * > mConstDependentDofs
 Same as mDependentDofs, but holds const pointers.
 
math::Jacobian mBodyJacobian
 Body Jacobian. More...
 
math::Jacobian mWorldJacobian
 Cached World Jacobian. More...
 
math::Jacobian mBodyJacobianSpatialDeriv
 Spatial time derivative of body Jacobian. More...
 
math::Jacobian mWorldJacobianClassicDeriv
 Classic time derivative of Body Jacobian. More...
 
Eigen::Vector6d mPartialAcceleration
 Partial spatial body acceleration due to parent joint's velocity. More...
 
bool mIsPartialAccelerationDirty
 Is the partial acceleration vector dirty.
 
Eigen::Vector6d mF
 Transmitted wrench from parent to the bodynode expressed in body-fixed frame.
 
Eigen::Vector6d mFgravity
 Spatial gravity force.
 
math::Inertia mArtInertia
 Articulated body inertia. More...
 
math::Inertia mArtInertiaImplicit
 Articulated body inertia for implicit joint damping and spring forces. More...
 
Eigen::Vector6d mBiasForce
 Bias force.
 
Eigen::Vector6d mCg_dV
 Cache data for combined vector of the system.
 
Eigen::Vector6d mCg_F
 
Eigen::Vector6d mG_F
 Cache data for gravity force vector of the system.
 
Eigen::Vector6d mFext_F
 Cache data for external force vector of the system.
 
Eigen::Vector6d mM_dV
 Cache data for mass matrix of the system.
 
Eigen::Vector6d mM_F
 
Eigen::Vector6d mInvM_c
 Cache data for inverse mass matrix of the system.
 
Eigen::Vector6d mInvM_U
 
Eigen::Vector6d mArbitrarySpatial
 Cache data for arbitrary spatial value.
 
Eigen::Vector6d mDelV
 Velocity change due to to external impulsive force exerted on bodies of the parent skeleton. More...
 
Eigen::Vector6d mBiasImpulse
 Impulsive bias force due to external impulsive force exerted on bodies of the parent skeleton. More...
 
Eigen::Vector6d mConstraintImpulse
 Constraint impulse: contact impulse, dynamic joint impulse.
 
Eigen::Vector6d mImpF
 Generalized impulsive body force w.r.t. body frame.
 
ColShapeAddedSignal mColShapeAddedSignal
 Collision shape added signal.
 
ColShapeRemovedSignal mColShapeRemovedSignal
 Collision shape removed signal.
 
StructuralChangeSignal mStructuralChangeSignal
 Structural change signal.
 
- Protected Attributes inherited from dart::dynamics::SkeletonRefCountingBase
std::weak_ptr< SkeletonmSkeleton
 Weak pointer to the Skeleton this BodyNode belongs to.
 
std::atomic< int > mReferenceCount
 Reference count for the number of BodyNodePtrs that are referring to this BodyNode.
 
std::shared_ptr< SkeletonmReferenceSkeleton
 If mReferenceCount is zero, then mReferenceSkeleton will hold a nullptr. More...
 
std::shared_ptr< MutexedWeakSkeletonPtrmLockedSkeleton
 Shared reference to a weak_ptr of this BodyNode's Skeleton, along with a mutex to ensure thread safety. More...
 
- Protected Attributes inherited from dart::dynamics::JacobianNode
bool mIsBodyJacobianDirty
 Dirty flag for body Jacobian.
 
bool mIsWorldJacobianDirty
 Dirty flag for world Jacobian.
 
bool mIsBodyJacobianSpatialDerivDirty
 Dirty flag for spatial time derivative of body Jacobian.
 
bool mIsWorldJacobianClassicDerivDirty
 Dirty flag for the classic time derivative of the Jacobian.
 
std::shared_ptr< InverseKinematicsmIK
 Inverse kinematics module which gets lazily created upon request.
 
std::unordered_set< JacobianNode * > mChildJacobianNodes
 JacobianNode children that descend from this JacobianNode.
 
- Protected Attributes inherited from dart::dynamics::Frame
Eigen::Isometry3d mWorldTransform
 World transform of this Frame. More...
 
Eigen::Vector6d mVelocity
 Total velocity of this Frame, in the coordinates of this Frame. More...
 
Eigen::Vector6d mAcceleration
 Total acceleration of this Frame, in the coordinates of this Frame. More...
 
std::set< Frame * > mChildFrames
 Container of this Frame's child Frames.
 
std::set< Entity * > mChildEntities
 Container of this Frame's child Entities.
 
- Protected Attributes inherited from dart::dynamics::Entity
FramemParentFrame
 Parent frame of this Entity.
 
bool mNeedTransformUpdate
 Does this Entity need a Transform update.
 
bool mNeedVelocityUpdate
 Does this Entity need a Velocity update.
 
bool mNeedAccelerationUpdate
 Does this Entity need an Acceleration update.
 
FrameChangedSignal mFrameChangedSignal
 Frame changed signal.
 
NameChangedSignal mNameChangedSignal
 Name changed signal.
 
EntitySignal mTransformUpdatedSignal
 Transform changed signal.
 
EntitySignal mVelocityChangedSignal
 Velocity changed signal.
 
EntitySignal mAccelerationChangedSignal
 Acceleration changed signal.
 
- Protected Attributes inherited from dart::common::Subject
std::set< Observer * > mObservers
 List of current Observers.
 
- Protected Attributes inherited from dart::dynamics::Node
std::weak_ptr< NodeDestructormDestructor
 weak pointer to the destructor for this Node. More...
 
BodyNodemBodyNode
 Pointer to the BodyNode that this Node is attached to.
 
bool mAmAttached
 bool that tracks whether this Node is attached to its BodyNode
 
std::size_t mIndexInBodyNode
 The index of this Node within its vector in its BodyNode's NodeMap.
 
std::size_t mIndexInSkeleton
 The index of this Node within its vector in its Skeleton's NodeMap.
 
std::size_t mIndexInTree
 Index of this Node within its tree.
 
- Protected Attributes inherited from dart::common::VersionCounter
std::size_t mVersion
 

Static Protected Attributes

static std::size_t msBodyNodeCount = 0
 Counts the number of nodes globally.
 

Friends

class Skeleton
 
class Joint
 
class EndEffector
 
class SoftBodyNode
 
class PointMass
 
class Node
 

Additional Inherited Members

- Static Public Member Functions inherited from dart::dynamics::Frame
static FrameWorld ()
 
static std::shared_ptr< FrameWorldShared ()
 
- Protected Types inherited from dart::dynamics::Frame
enum  ConstructAbstractTag { ConstructAbstract }
 Used when constructing a pure abstract class, because calling the Frame constructor is just a formality.
 
- Protected Types inherited from dart::dynamics::Entity
enum  ConstructFrameTag { ConstructFrame }
 Used when constructing a Frame class, because the Frame constructor will take care of setting up the parameters you pass into it.
 
enum  ConstructAbstractTag { ConstructAbstract }
 Used when constructing a pure abstract class, because calling the Entity constructor is just a formality.
 

Detailed Description

BodyNode class represents a single node of the skeleton.

BodyNode is a basic element of the skeleton. BodyNodes are hierarchically connected and have a set of core functions for calculating derivatives.

BodyNode inherits Frame, and a parent Frame of a BodyNode is the parent BodyNode of the BodyNode.

Member Function Documentation

§ addConstraintImpulse()

void dart::dynamics::BodyNode::addConstraintImpulse ( const Eigen::Vector6d &  _constImp)

Add constraint impulse.

Parameters
[in]_constImpSpatial constraint impulse w.r.t. body frame

§ addExtForce()

void dart::dynamics::BodyNode::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.

A force is defined by a point of application and a force vector. The last two parameters specify frames of the first two parameters. Coordinate transformations are applied when needed. The point of application and the force in local coordinates are stored in mContacts. When conversion is needed, make sure the transformations are avaialble.

§ addExtTorque()

void dart::dynamics::BodyNode::addExtTorque ( const Eigen::Vector3d &  _torque,
bool  _isLocal = false 
)

Add applying Cartesian torque to the node.

The torque in local coordinates is accumulated in mExtTorqueBody.

§ changeParentJointType()

template<class JointType >
JointType * dart::dynamics::BodyNode::changeParentJointType ( const typename JointType::Properties &  _joint = typename JointType::Properties())

Change the Joint type of this BodyNode's parent Joint.

Note that this function will change the indexing of (potentially) all BodyNodes and Joints in the Skeleton.

§ clearExternalForces()

void dart::dynamics::BodyNode::clearExternalForces ( )
virtual

Clean up structures that store external forces: mContacts, mFext, mExtForceBody and mExtTorqueBody.

Called by Skeleton::clearExternalForces.

§ clearInternalForces()

void dart::dynamics::BodyNode::clearInternalForces ( )
virtual

Clear out the generalized forces of the parent Joint and any other forces related to this BodyNode that are internal to the Skeleton.

For example, the point mass forces for SoftBodyNodes.

§ clone()

BodyNode * dart::dynamics::BodyNode::clone ( BodyNode _parentBodyNode,
Joint _parentJoint,
bool  cloneNodes 
) const
protectedvirtual

Create a clone of this BodyNode.

This may only be called by the Skeleton class.

§ copyAs() [1/2]

SkeletonPtr dart::dynamics::BodyNode::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 the specified name to attach them to.

The Skeleton::Properties of the current Skeleton will also be copied into the new Skeleton that gets created.

§ copyAs() [2/2]

template<class JointType >
SkeletonPtr dart::dynamics::BodyNode::copyAs ( const std::string &  _skeletonName,
const typename JointType::Properties &  _joint = typename JointType::Properties(),
bool  _recursive = true 
) const

A version of copyAs(const std::string&) that also changes the Joint type of the root BodyNode.

§ copyTo() [1/4]

std::pair< Joint *, BodyNode * > dart::dynamics::BodyNode::copyTo ( BodyNode _newParent,
bool  _recursive = true 
)

Create clones of this BodyNode and all of its children recursively (unless _recursive is set to false) and attach the clones to the specified BodyNode.

The specified BodyNode can be in this Skeleton or a different Skeleton. Passing in nullptr will set the copy as a root node of the current Skeleton.

The return value is a pair of pointers to the root of the newly created BodyNode tree.

§ copyTo() [2/4]

std::pair< Joint *, BodyNode * > dart::dynamics::BodyNode::copyTo ( const SkeletonPtr &  _newSkeleton,
BodyNode _newParent,
bool  _recursive = true 
) const

Create clones of this BodyNode and all of its children recursively (unless recursive is set to false) and attach the clones to the specified BodyNode of the specified Skeleton.

The key differences between this function and the copyTo(BodyNode*) version is that this one allows the copied BodyNode to be const and allows you to copy it as a root node of another Skeleton.

The return value is a pair of pointers to the root of the newly created BodyNode tree.

§ copyTo() [3/4]

template<class JointType >
std::pair< JointType *, BodyNode * > dart::dynamics::BodyNode::copyTo ( BodyNode _newParent,
const typename JointType::Properties &  _joint = typename JointType::Properties(),
bool  _recursive = true 
)

A version of copyTo(BodyNode*) that also changes the Joint type of the parent Joint of this BodyNode.

§ copyTo() [4/4]

template<class JointType >
std::pair< JointType *, BodyNode * > dart::dynamics::BodyNode::copyTo ( const SkeletonPtr &  _newSkeleton,
BodyNode _newParent,
const typename JointType::Properties &  _joint = typename JointType::Properties(),
bool  _recursive = true 
) const

A version of copyTo(Skeleton*,BodyNode*) that also changes the Joint type of the parent Joint of this BodyNode.

§ createEndEffector()

EndEffector * dart::dynamics::BodyNode::createEndEffector ( const EndEffector::BasicProperties _properties)

Create an EndEffector attached to this BodyNode.

Pass an EndEffector::Properties argument into this function.

§ createShapeNode() [1/2]

template<class ShapeNodeProperties >
ShapeNode * dart::dynamics::BodyNode::createShapeNode ( ShapeNodeProperties  properties,
bool  automaticName = true 
)

Create an ShapeNode attached to this BodyNode.

Pass a ShapeNode::Properties argument into its constructor. If automaticName is true, then the mName field of properties will be ignored, and the ShapeNode will be automatically assigned a name: <BodyNodeName>_ShapeNode_<#>

§ createShapeNode() [2/2]

template<class ShapeType >
ShapeNode * dart::dynamics::BodyNode::createShapeNode ( const std::shared_ptr< ShapeType > &  shape)

Create a ShapeNode with an automatically assigned name: <BodyNodeName>_ShapeNode_<#>.

§ createShapeNodeWith()

template<class... Aspects>
ShapeNode * dart::dynamics::BodyNode::createShapeNodeWith ( const ShapePtr &  shape)

Create a ShapeNode with the specified Aspects and an automatically assigned name: <BodyNodeName>_ShapeNode_<#>.

§ getBodyForce()

const Eigen::Vector6d & dart::dynamics::BodyNode::getBodyForce ( ) const

Get spatial body force transmitted from the parent joint.

The spatial body force is transmitted to this BodyNode from the parent body through the connecting joint. It is expressed in this BodyNode's frame.

§ getChainDofs()

const std::vector< const DegreeOfFreedom * > dart::dynamics::BodyNode::getChainDofs ( ) const
overridevirtual

Returns a DegreeOfFreedom vector containing the dofs that form a Chain leading up to this JacobianNode from the root of the Skeleton.

Implements dart::dynamics::JacobianNode.

§ getFrictionCoeff()

double dart::dynamics::BodyNode::getFrictionCoeff ( ) const

Return frictional coefficient.

Deprecated:
Deprecated since DART 6.10. Please set the friction coefficient per ShapeNode of the BodyNode. This will be removed in the next major release.

§ getJacobian()

const math::Jacobian & dart::dynamics::BodyNode::getJacobian ( ) const
finaloverridevirtual

Return the generalized Jacobian targeting the origin of this BodyNode.

The Jacobian is expressed in the Frame of this BodyNode.

Implements dart::dynamics::JacobianNode.

§ getJacobianClassicDeriv()

const math::Jacobian & dart::dynamics::BodyNode::getJacobianClassicDeriv ( ) const
finaloverridevirtual

Return the classical time derivative of the generalized Jacobian targeting the origin of this BodyNode.

The Jacobian is expressed in the World coordinate Frame.

NOTE: Since this is a classical time derivative, it should be used with classical linear and angular vectors. If you are using spatial vectors, use getJacobianSpatialDeriv() instead.

Implements dart::dynamics::JacobianNode.

§ getJacobianSpatialDeriv()

const math::Jacobian & dart::dynamics::BodyNode::getJacobianSpatialDeriv ( ) const
finaloverridevirtual

Return the spatial time derivative of the generalized Jacobian targeting the origin of this BodyNode.

The Jacobian is expressed in this BodyNode's coordinate Frame.

NOTE: Since this is a spatial time derivative, it should be used with spatial vectors. If you are using classical linear and angular acceleration vectors, then use getJacobianClassicDeriv(), getLinearJacobianDeriv(), or getAngularJacobianDeriv() instead.

Implements dart::dynamics::JacobianNode.

§ getPrimaryRelativeAcceleration()

const Eigen::Vector6d & dart::dynamics::BodyNode::getPrimaryRelativeAcceleration ( ) const
overridevirtual

The Featherstone ABI algorithm exploits a component of the spatial acceleration which we refer to as the partial acceleration, accessible by getPartialAcceleration().

We save operations during our forward kinematics by computing and storing the partial acceleration separately from the rest of the Frame's acceleration. getPrimaryRelativeAcceleration() will return the portion of the relative spatial acceleration that is not contained in the partial acceleration. To get the full spatial acceleration of this Frame relative to its parent Frame, use getRelativeSpatialAcceleration(). To get the full spatial acceleration of this Frame relative to the World Frame, use getSpatialAcceleration().

Implements dart::dynamics::Frame.

§ getRelativeSpatialAcceleration()

const Eigen::Vector6d & dart::dynamics::BodyNode::getRelativeSpatialAcceleration ( ) const
overridevirtual

Get the spatial acceleration of this Frame relative to its parent Frame, in the coordinates of this Frame.

Implements dart::dynamics::Frame.

§ getRelativeSpatialVelocity()

const Eigen::Vector6d & dart::dynamics::BodyNode::getRelativeSpatialVelocity ( ) const
overridevirtual

Get the spatial velocity of this Frame relative to its parent Frame, in its own coordinates.

Implements dart::dynamics::Frame.

§ getRelativeTransform()

const Eigen::Isometry3d & dart::dynamics::BodyNode::getRelativeTransform ( ) const
overridevirtual

Get the transform of this BodyNode with respect to its parent BodyNode, which is also its parent Frame.

Implements dart::dynamics::Frame.

§ getRestitutionCoeff()

double dart::dynamics::BodyNode::getRestitutionCoeff ( ) const

Return coefficient of restitution.

Deprecated:
Deprecated since DART 6.10.

Please set the restitution coefficient per ShapeNode of the BodyNode. This will be removed in the next major release.

§ getWorldJacobian()

const math::Jacobian & dart::dynamics::BodyNode::getWorldJacobian ( ) const
finaloverridevirtual

Return the generalized Jacobian targeting the origin of this BodyNode.

The Jacobian is expressed in the World Frame.

Implements dart::dynamics::JacobianNode.

§ isColliding()

bool dart::dynamics::BodyNode::isColliding ( )

Return whether this body node is set to be colliding with other objects.

Returns
True if this body node is colliding.

§ isReactive()

bool dart::dynamics::BodyNode::isReactive ( ) const

Return true if the body can react to force or constraint impulse.

A body node is reactive if the skeleton is mobile and the number of dependent generalized coordinates is non zero.

§ matchNodes()

void dart::dynamics::BodyNode::matchNodes ( const BodyNode otherBodyNode)

Make the Nodes of this BodyNode match the Nodes of otherBodyNode.

All existing Nodes in this BodyNode will be removed.

§ moveTo() [1/4]

bool dart::dynamics::BodyNode::moveTo ( BodyNode _newParent)

Remove this BodyNode and all of its children (recursively) from their current parent BodyNode, and move them to another parent BodyNode.

The new parent BodyNode can either be in a new Skeleton or the current one. If you pass in a nullptr, this BodyNode will become a new root BodyNode for its current Skeleton.

Using this function will result in changes to the indexing of (potentially) all BodyNodes and Joints in the current Skeleton, even if the BodyNodes are kept within the same Skeleton.

§ moveTo() [2/4]

bool dart::dynamics::BodyNode::moveTo ( const SkeletonPtr &  _newSkeleton,
BodyNode _newParent 
)

This is a version of moveTo(BodyNode*) that allows you to explicitly move this BodyNode into a different Skeleton.

The key difference for this version of the function is that you can make this BodyNode a root node in a different Skeleton, which is not something that can be done by the other version.

§ moveTo() [3/4]

template<class JointType >
JointType * dart::dynamics::BodyNode::moveTo ( BodyNode _newParent,
const typename JointType::Properties &  _joint = typename JointType::Properties() 
)

A version of moveTo(BodyNode*) that also changes the Joint type of the parent Joint of this BodyNode.

This function returns the pointer to the newly created Joint. The original parent Joint will be deleted.

This function can be used to change the Joint type of the parent Joint of this BodyNode, but note that the indexing of the BodyNodes and Joints in this Skeleton will still be changed, even if only the Joint type is changed.

§ moveTo() [4/4]

template<class JointType >
JointType * dart::dynamics::BodyNode::moveTo ( const SkeletonPtr &  _newSkeleton,
BodyNode _newParent,
const typename JointType::Properties &  _joint = typename JointType::Properties() 
)

A version of moveTo(SkeletonPtr, BodyNode*) that also changes the Joint type of the parent Joint of this BodyNode.

This function returns the pointer to the newly created Joint. The original Joint will be deleted.

§ remove()

SkeletonPtr dart::dynamics::BodyNode::remove ( const std::string &  _name = "temporary")

Remove this BodyNode and all of its children (recursively) from their Skeleton.

If a BodyNodePtr that references this BodyNode (or any of its children) still exists, the subtree will be moved into a new Skeleton with the given name. If the returned SkeletonPtr goes unused and no relevant BodyNodePtrs are held anywhere, then this BodyNode and all its children will be deleted.

Note that this function is actually the same as split(), but given a different name for semantic reasons.

§ setCollidable()

void dart::dynamics::BodyNode::setCollidable ( bool  _isCollidable)

Set whether this body node will collide with others in the world.

Parameters
[in]_isCollidableTrue to enable collisions

§ setColliding()

void dart::dynamics::BodyNode::setColliding ( bool  _isColliding)

Set whether this body node is colliding with other objects.

Note that this status is set by the constraint solver during dynamics simulation but not by collision detector.

Parameters
[in]_isCollidingTrue if this body node is colliding.

§ setConstraintImpulse()

void dart::dynamics::BodyNode::setConstraintImpulse ( const Eigen::Vector6d &  _constImp)

Set constraint impulse.

Parameters
[in]_constImpSpatial constraint impulse w.r.t. body frame

§ setExtTorque()

void dart::dynamics::BodyNode::setExtTorque ( const Eigen::Vector3d &  _torque,
bool  _isLocal = false 
)

Set applying Cartesian torque to the node.

The torque in local coordinates is accumulated in mExtTorqueBody.

§ setFrictionCoeff()

void dart::dynamics::BodyNode::setFrictionCoeff ( double  _coeff)

Set coefficient of friction in range of [0, ~].

Deprecated:
Deprecated since DART 6.10.

Please set the friction coefficient per ShapeNode of the BodyNode. This will be removed in the next major release.

§ setGravityMode()

void dart::dynamics::BodyNode::setGravityMode ( bool  _gravityMode)

Set whether gravity affects this body.

Parameters
[in]_gravityModeTrue to enable gravity

§ setMomentOfInertia()

void dart::dynamics::BodyNode::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.

Principal moments of inertia (_Ixx, _Iyy, _Izz) must be positive or zero values.

§ setName()

const std::string & dart::dynamics::BodyNode::setName ( const std::string &  _name)
overridevirtual

Set name.

If the name is already taken, this will return an altered version which will be used by the Skeleton

Implements dart::dynamics::Node.

§ setRestitutionCoeff()

void dart::dynamics::BodyNode::setRestitutionCoeff ( double  _coeff)

Set coefficient of restitution in range of [0, 1].

Deprecated:
Deprecated since DART 6.10.

Please set the restitution coefficient per ShapeNode of the BodyNode. This will be removed in the next major release.

§ split() [1/2]

SkeletonPtr dart::dynamics::BodyNode::split ( const std::string &  _skeletonName)

Remove this BodyNode and all of its children (recursively) from their current Skeleton and move them into a newly created Skeleton.

The newly created Skeleton will have the same Skeleton::Properties as the current Skeleton, except it will use the specified name. The return value is a shared_ptr to the newly created Skeleton.

Note that the parent Joint of this BodyNode will remain the same. If you want to change the Joint type of this BodyNode's parent Joint (for example, make it a FreeJoint), then use the templated split<JointType>() function.

§ split() [2/2]

template<class JointType >
SkeletonPtr dart::dynamics::BodyNode::split ( const std::string &  _skeletonName,
const typename JointType::Properties &  _joint = typename JointType::Properties() 
)

A version of split(const std::string&) that also changes the Joint type of the parent Joint of this BodyNode.

§ updateAccelerationID()

void dart::dynamics::BodyNode::updateAccelerationID ( )
protectedvirtual

Update spatial body acceleration with the partial spatial body acceleration for inverse dynamics.

§ updateArtInertia()

void dart::dynamics::BodyNode::updateArtInertia ( double  _timeStep) const
protectedvirtual

Update articulated body inertia for forward dynamics.

Parameters
[in]_timeStepRquired for implicit joint stiffness and damping.

§ updateBiasForce()

void dart::dynamics::BodyNode::updateBiasForce ( const Eigen::Vector3d &  _gravity,
double  _timeStep 
)
protectedvirtual

Update bias force associated with the articulated body inertia for forward dynamics.

Parameters
[in]_gravityVector of gravitational acceleration
[in]_timeStepRquired for implicit joint stiffness and damping.

§ updateBiasImpulse()

void dart::dynamics::BodyNode::updateBiasImpulse ( )
protectedvirtual

Update bias impulse associated with the articulated body inertia for impulse-based forward dynamics.

§ updateBodyJacobian()

void dart::dynamics::BodyNode::updateBodyJacobian ( ) const
protected

Update body Jacobian.

getJacobian() calls this function if mIsBodyJacobianDirty is true.

§ updateBodyJacobianSpatialDeriv()

void dart::dynamics::BodyNode::updateBodyJacobianSpatialDeriv ( ) const
protected

Update spatial time derivative of body Jacobian.

getJacobianSpatialTimeDeriv() calls this function if mIsBodyJacobianSpatialDerivDirty is true.

§ updateConstrainedTerms()

void dart::dynamics::BodyNode::updateConstrainedTerms ( double  _timeStep)
protectedvirtual

Update constrained terms due to the constraint impulses for foward dynamics.

§ updateTransmittedForceFD()

void dart::dynamics::BodyNode::updateTransmittedForceFD ( )
protectedvirtual

Update spatial body force for forward dynamics.

The spatial body force is transmitted to this BodyNode from the parent body through the connecting joint. It is expressed in this BodyNode's frame.

§ updateTransmittedForceID()

void dart::dynamics::BodyNode::updateTransmittedForceID ( const Eigen::Vector3d &  _gravity,
bool  _withExternalForces = false 
)
protectedvirtual

Update spatial body force for inverse dynamics.

The spatial body force is transmitted to this BodyNode from the parent body through the connecting joint. It is expressed in this BodyNode's frame.

§ updateTransmittedImpulse()

void dart::dynamics::BodyNode::updateTransmittedImpulse ( )
protectedvirtual

Update spatial body force for impulse-based forward dynamics.

The spatial body impulse is transmitted to this BodyNode from the parent body through the connecting joint. It is expressed in this BodyNode's frame.

§ updateWorldJacobian()

void dart::dynamics::BodyNode::updateWorldJacobian ( ) const
protected

Update the World Jacobian.

The commonality of using the World Jacobian makes it worth caching.

§ updateWorldJacobianClassicDeriv()

void dart::dynamics::BodyNode::updateWorldJacobianClassicDeriv ( ) const
protected

Update classic time derivative of body Jacobian.

getJacobianClassicDeriv() calls this function if mIsWorldJacobianClassicDerivDirty is true.

Member Data Documentation

§ mArtInertia

math::Inertia dart::dynamics::BodyNode::mArtInertia
mutableprotected

Articulated body inertia.

Do not use directly! Use getArticulatedInertia() to access this quantity

§ mArtInertiaImplicit

math::Inertia dart::dynamics::BodyNode::mArtInertiaImplicit
mutableprotected

Articulated body inertia for implicit joint damping and spring forces.

DO not use directly! Use getArticulatedInertiaImplicit() to access this

§ mBiasImpulse

Eigen::Vector6d dart::dynamics::BodyNode::mBiasImpulse
protected

Impulsive bias force due to external impulsive force exerted on bodies of the parent skeleton.

§ mBodyJacobian

math::Jacobian dart::dynamics::BodyNode::mBodyJacobian
mutableprotected

Body Jacobian.

Do not use directly! Use getJacobian() to access this quantity

§ mBodyJacobianSpatialDeriv

math::Jacobian dart::dynamics::BodyNode::mBodyJacobianSpatialDeriv
mutableprotected

Spatial time derivative of body Jacobian.

Do not use directly! Use getJacobianSpatialDeriv() to access this quantity

§ mDelV

Eigen::Vector6d dart::dynamics::BodyNode::mDelV
protected

Velocity change due to to external impulsive force exerted on bodies of the parent skeleton.

§ mIsColliding

bool dart::dynamics::BodyNode::mIsColliding
protected

Whether the node is currently in collision with another node.

Deprecated:
DART_DEPRECATED(6.0) See #670 for more detail.

§ mNonBodyNodeEntities

std::set<Entity*> dart::dynamics::BodyNode::mNonBodyNodeEntities
protected

Array of child Entities that are not BodyNodes.

Organizing them separately allows some performance optimizations.

§ mPartialAcceleration

Eigen::Vector6d dart::dynamics::BodyNode::mPartialAcceleration
mutableprotected

Partial spatial body acceleration due to parent joint's velocity.

Do not use directly! Use getPartialAcceleration() to access this quantity

§ mWorldJacobian

math::Jacobian dart::dynamics::BodyNode::mWorldJacobian
mutableprotected

Cached World Jacobian.

Do not use directly! Use getJacobian() to access this quantity

§ mWorldJacobianClassicDeriv

math::Jacobian dart::dynamics::BodyNode::mWorldJacobianClassicDeriv
mutableprotected

Classic time derivative of Body Jacobian.

Do not use directly! Use getJacobianClassicDeriv() to access this quantity


The documentation for this class was generated from the following files: