33 #ifndef DART_DYNAMICS_ZERODOFJOINT_HPP_
34 #define DART_DYNAMICS_ZERODOFJOINT_HPP_
76 const std::string&
setDofName(std::size_t,
const std::string&,
bool )
override;
84 const std::string&
getDofName(std::size_t)
const override;
100 void setCommand(std::size_t _index,
double _command)
override;
103 double getCommand(std::size_t _index)
const override;
106 void setCommands(
const Eigen::VectorXd& _commands)
override;
122 double getPosition(std::size_t _index)
const override;
125 void setPositions(
const Eigen::VectorXd& _positions)
override;
180 void setVelocity(std::size_t _index,
double _velocity)
override;
183 double getVelocity(std::size_t _index)
const override;
186 void setVelocities(
const Eigen::VectorXd& _velocities)
override;
238 void setAcceleration(std::size_t _index,
double _acceleration)
override;
281 void setForce(std::size_t _index,
double _force)
override;
284 double getForce(std::size_t _index)
const override;
287 void setForces(
const Eigen::VectorXd& _forces)
override;
290 Eigen::VectorXd
getForces()
const override;
357 const Eigen::VectorXd& _q2,
const Eigen::VectorXd& _q1)
const override;
417 const Eigen::VectorXd& _positions)
const override;
453 double _timeStep)
override;
470 double _timeStep)
override;
492 bool _withDampingForces,
493 bool _withSpringForces)
override;
498 bool _withDampingForces,
499 bool _withSpringForces)
override;
534 const std::size_t _col,
540 const std::size_t _col,
std::size_t index
Definition: SkelParser.cpp:1617
Eigen::VectorXd position
Definition: SkelParser.cpp:107
DegreeOfFreedom class is a proxy class for accessing single degrees of freedom (aka generalized coord...
Definition: DegreeOfFreedom.hpp:53
class Joint
Definition: Joint.hpp:59
class ZeroDofJoint
Definition: ZeroDofJoint.hpp:48
const std::string & setDofName(std::size_t, const std::string &, bool) override
Alternative to DegreeOfFreedom::setName()
Definition: ZeroDofJoint.cpp:81
double getPositionLowerLimit(std::size_t _index) const override
Get lower limit for position.
Definition: ZeroDofJoint.cpp:198
void addVelocityChangeTo(Eigen::Vector6d &_velocityChange) override
Add joint velocity change to _velocityChange.
Definition: ZeroDofJoint.cpp:714
void addChildBiasForceForInvAugMassMatrix(Eigen::Vector6d &_parentBiasForce, const Eigen::Matrix6d &_childArtInertia, const Eigen::Vector6d &_childBiasForce) override
Add child's bias force to parent's one.
Definition: ZeroDofJoint.cpp:873
Eigen::VectorXd getVelocities() const override
Get the velocities of all generalized coordinates in this Joint.
Definition: ZeroDofJoint.cpp:303
const std::string & getDofName(std::size_t) const override
Alternative to DegreeOfFreedom::getName()
Definition: ZeroDofJoint.cpp:99
void setForceLowerLimits(const Eigen::VectorXd &lowerLimits) override
Set the force upper limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:517
void updateImpulseFD(const Eigen::Vector6d &_bodyImpulse) override
Update joint impulses for forward dynamics.
Definition: ZeroDofJoint.cpp:852
std::size_t getIndexInTree(std::size_t _index) const override
Get a unique index in the kinematic tree of a generalized coordinate in this Joint.
Definition: ZeroDofJoint.cpp:121
void setAccelerationUpperLimit(std::size_t _index, double _acceleration) override
Set upper limit for acceleration.
Definition: ZeroDofJoint.cpp:450
bool isDofNamePreserved(std::size_t) const override
Alternative to DegreeOfFreedom::isNamePreserved()
Definition: ZeroDofJoint.cpp:93
double getConstraintImpulse(std::size_t _index) const override
Get a single constraint impulse.
Definition: ZeroDofJoint.cpp:578
void setCommands(const Eigen::VectorXd &_commands) override
Set all commands for this Joint.
Definition: ZeroDofJoint.cpp:146
void setCoulombFriction(std::size_t _index, double _friction) override
Set joint Coulomb friction froce.
Definition: ZeroDofJoint.cpp:646
void addInvMassMatrixSegmentTo(Eigen::Vector6d &_acc) override
Definition: ZeroDofJoint.cpp:909
void addChildBiasForceForInvMassMatrix(Eigen::Vector6d &_parentBiasForce, const Eigen::Matrix6d &_childArtInertia, const Eigen::Vector6d &_childBiasForce) override
Add child's bias force to parent's one.
Definition: ZeroDofJoint.cpp:864
Eigen::VectorXd getPositionLowerLimits() const override
Get the position lower limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:211
double getCommand(std::size_t _index) const override
Get a single command.
Definition: ZeroDofJoint.cpp:137
double getSpringStiffness(std::size_t _index) const override
Get stiffness of joint spring force.
Definition: ZeroDofJoint.cpp:616
void setVelocityChange(std::size_t _index, double _velocityChange) override
Set a single velocity change.
Definition: ZeroDofJoint.cpp:553
double getVelocity(std::size_t _index) const override
Get the velocity of a single generalized coordinate.
Definition: ZeroDofJoint.cpp:291
void setPartialAccelerationTo(Eigen::Vector6d &_partialAcceleration, const Eigen::Vector6d &_childVelocity) override
Set joint partial acceleration to _partialAcceleration.
Definition: ZeroDofJoint.cpp:720
void setConstraintImpulse(std::size_t _index, double _impulse) override
Set a single constraint impulse.
Definition: ZeroDofJoint.cpp:572
Eigen::VectorXd getPositions() const override
Get the positions of all generalized coordinates in this Joint.
Definition: ZeroDofJoint.cpp:185
const math::Jacobian getRelativeJacobian() const override
Get spatial Jacobian of the child BodyNode relative to the parent BodyNode expressed in the child Bod...
Definition: ZeroDofJoint.cpp:689
void addChildArtInertiaTo(Eigen::Matrix6d &_parentArtInertia, const Eigen::Matrix6d &_childArtInertia) override
Add child's articulated inertia to parent's one.
Definition: ZeroDofJoint.cpp:734
void setInitialPositions(const Eigen::VectorXd &_initial) override
Change the positions that resetPositions() will give to this Joint's coordinates.
Definition: ZeroDofJoint.cpp:273
void preserveDofName(std::size_t, bool) override
Alternative to DegreeOfFreedom::preserveName()
Definition: ZeroDofJoint.cpp:87
void addChildBiasImpulseTo(Eigen::Vector6d &_parentBiasImpulse, const Eigen::Matrix6d &_childArtInertia, const Eigen::Vector6d &_childBiasImpulse) override
Add child's bias impulse to parent's one.
Definition: ZeroDofJoint.cpp:783
double getVelocityLowerLimit(std::size_t _index) const override
Get lower limit for velocity.
Definition: ZeroDofJoint.cpp:316
double computePotentialEnergy() const override
Compute and return the potential energy.
Definition: ZeroDofJoint.cpp:658
void setPositionUpperLimits(const Eigen::VectorXd &upperLimits) override
Set the position upper limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:230
void addChildBiasForceTo(Eigen::Vector6d &_parentBiasForce, const Eigen::Matrix6d &_childArtInertia, const Eigen::Vector6d &_childBiasForce, const Eigen::Vector6d &_childPartialAcc) override
Add child's bias force to parent's one.
Definition: ZeroDofJoint.cpp:770
void setForceUpperLimits(const Eigen::VectorXd &upperLimits) override
Set the force upper limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:541
double getRestPosition(std::size_t _index) const override
Get rest position of spring force.
Definition: ZeroDofJoint.cpp:628
double getForceLowerLimit(std::size_t _index) const override
Get lower limit for force.
Definition: ZeroDofJoint.cpp:511
void integrateVelocities(double _dt) override
Integrate velocities using Euler method.
Definition: ZeroDofJoint.cpp:596
Eigen::VectorXd getForceUpperLimits() const override
Get the force upper limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:547
Eigen::VectorXd getAccelerationLowerLimits() const override
Get the acceleration upper limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:444
void setVelocityUpperLimit(std::size_t _index, double _velocity) override
Set upper limit for velocity.
Definition: ZeroDofJoint.cpp:334
void updateForceID(const Eigen::Vector6d &_bodyForce, double _timeStep, bool _withDampingForces, bool _withSpringForces) override
Update joint force for inverse dynamics.
Definition: ZeroDofJoint.cpp:828
void updateImpulseID(const Eigen::Vector6d &_bodyImpulse) override
Update joint impulses for inverse dynamics.
Definition: ZeroDofJoint.cpp:846
void addChildArtInertiaImplicitTo(Eigen::Matrix6d &_parentArtInertia, const Eigen::Matrix6d &_childArtInertia) override
Add child's articulated inertia to parent's one. Forward dynamics routine.
Definition: ZeroDofJoint.cpp:745
Properties getZeroDofJointProperties() const
Get the Properties of this ZeroDofJoint.
Definition: ZeroDofJoint.cpp:57
ZeroDofJoint()
Constructor called by inheriting classes.
Definition: ZeroDofJoint.cpp:664
void setAccelerationUpperLimits(const Eigen::VectorXd &upperLimits) override
Set the acceleration upper limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:463
void addAccelerationTo(Eigen::Vector6d &_acc) override
Add joint acceleration to _acc.
Definition: ZeroDofJoint.cpp:728
void resetCommands() override
Set all the commands for this Joint to zero.
Definition: ZeroDofJoint.cpp:158
Eigen::VectorXd getForceLowerLimits() const override
Get the force upper limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:523
std::size_t getNumDofs() const override
Get number of generalized coordinates.
Definition: ZeroDofJoint.cpp:105
Eigen::Vector6d getBodyConstraintWrench() const override
Get constraint wrench expressed in body node frame.
Definition: ZeroDofJoint.cpp:682
const std::string emptyString
Used by getDofName()
Definition: ZeroDofJoint.hpp:556
void setInitialVelocities(const Eigen::VectorXd &_initial) override
Change the velocities that resetVelocities() will give to this Joint's coordinates.
Definition: ZeroDofJoint.cpp:383
void resetConstraintImpulses() override
Set zero all the constraint impulses.
Definition: ZeroDofJoint.cpp:584
void getInvAugMassMatrixSegment(Eigen::MatrixXd &_invMassMat, const std::size_t _col, const Eigen::Matrix6d &_artInertia, const Eigen::Vector6d &_spatialAcc) override
Definition: ZeroDofJoint.cpp:899
void setForce(std::size_t _index, double _force) override
Set the force of a single generalized coordinate.
Definition: ZeroDofJoint.cpp:475
double getAccelerationLowerLimit(std::size_t _index) const override
Get lower limit for acceleration.
Definition: ZeroDofJoint.cpp:432
void setPosition(std::size_t, double) override
Set the position of a single generalized coordinate.
Definition: ZeroDofJoint.cpp:164
double getForce(std::size_t _index) const override
Get the force of a single generalized coordinate.
Definition: ZeroDofJoint.cpp:481
void setVelocityLowerLimit(std::size_t _index, double _velocity) override
Set lower limit for velocity.
Definition: ZeroDofJoint.cpp:309
void resetVelocityChanges() override
Set zero all the velocity change.
Definition: ZeroDofJoint.cpp:566
void registerDofs() override
Called by the Skeleton class.
Definition: ZeroDofJoint.cpp:670
Eigen::VectorXd getSpatialToGeneralized(const Eigen::Vector6d &_spatial) override
Definition: ZeroDofJoint.cpp:915
double getVelocityChange(std::size_t _index) const override
Get a single velocity change.
Definition: ZeroDofJoint.cpp:560
void setSpringStiffness(std::size_t _index, double _k) override
Set stiffness of joint spring force.
Definition: ZeroDofJoint.cpp:610
void resetPosition(std::size_t _index) override
Set the position of this generalized coordinate to its initial position.
Definition: ZeroDofJoint.cpp:249
void setCommand(std::size_t _index, double _command) override
Set a single command.
Definition: ZeroDofJoint.cpp:131
Eigen::VectorXd getAccelerations() const override
Get the accelerations of all generalized coordinates in this Joint.
Definition: ZeroDofJoint.cpp:413
void addVelocityTo(Eigen::Vector6d &_vel) override
Add joint velocity to _vel.
Definition: ZeroDofJoint.cpp:708
double getInitialVelocity(std::size_t _index) const override
Get the velocity that resetVelocity() will give to this coordinate.
Definition: ZeroDofJoint.cpp:377
void setRestPosition(std::size_t _index, double _q0) override
Set rest position of spring force.
Definition: ZeroDofJoint.cpp:622
Eigen::VectorXd getCommands() const override
Get all commands for this Joint.
Definition: ZeroDofJoint.cpp:152
void setAcceleration(std::size_t _index, double _acceleration) override
Set the acceleration of a single generalized coordinate.
Definition: ZeroDofJoint.cpp:395
std::size_t getIndexInSkeleton(std::size_t _index) const override
Get a unique index in skeleton of a generalized coordinate in this Joint.
Definition: ZeroDofJoint.cpp:111
void resetForces() override
Set the forces of all generalized coordinates in this Joint to zero.
Definition: ZeroDofJoint.cpp:499
void setInitialVelocity(std::size_t _index, double _initial) override
Change the velocity that resetVelocity() will give to this coordinate.
Definition: ZeroDofJoint.cpp:371
void updateVelocityChange(const Eigen::Matrix6d &_artInertia, const Eigen::Vector6d &_velocityChange) override
Update joint velocity change.
Definition: ZeroDofJoint.cpp:820
void setPositionLowerLimits(const Eigen::VectorXd &lowerLimits) override
Set the position lower limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:204
void updateForceFD(const Eigen::Vector6d &_bodyForce, double _timeStep, bool _withDampingForces, bool _withSpringForces) override
Update joint force for forward dynamics.
Definition: ZeroDofJoint.cpp:837
void resetVelocities() override
Set the velocities of all generalized coordinates in this Joint to their initial velocities.
Definition: ZeroDofJoint.cpp:365
void updateInvProjArtInertiaImplicit(const Eigen::Matrix6d &_artInertia, double _timeStep) override
Forward dynamics routine.
Definition: ZeroDofJoint.cpp:762
void resetPositions() override
Set the positions of all generalized coordinates in this Joint to their initial positions.
Definition: ZeroDofJoint.cpp:255
void updateTotalImpulse(const Eigen::Vector6d &_bodyImpulse) override
Update joint total impulse.
Definition: ZeroDofJoint.cpp:801
double getDampingCoefficient(std::size_t _index) const override
Get coefficient of joint damping (viscous friction) force.
Definition: ZeroDofJoint.cpp:640
bool hasPositionLimit(std::size_t _index) const override
Get whether the position of a generalized coordinate has limits.
Definition: ZeroDofJoint.cpp:243
void updateConstrainedTerms(double _timeStep) override
Update constrained terms for forward dynamics.
Definition: ZeroDofJoint.cpp:858
void setVelocityLowerLimits(const Eigen::VectorXd &lowerLimits) override
Set the velocity lower limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:322
double getForceUpperLimit(std::size_t _index) const override
Get upper limit for force.
Definition: ZeroDofJoint.cpp:535
void getInvMassMatrixSegment(Eigen::MatrixXd &_invMassMat, const std::size_t _col, const Eigen::Matrix6d &_artInertia, const Eigen::Vector6d &_spatialAcc) override
Definition: ZeroDofJoint.cpp:889
Eigen::VectorXd getAccelerationUpperLimits() const override
Get the acceleration upper limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:469
Eigen::VectorXd getForces() const override
Get the forces of all generalized coordinates in this Joint.
Definition: ZeroDofJoint.cpp:493
void updateTotalForce(const Eigen::Vector6d &_bodyForce, double _timeStep) override
Update joint total force.
Definition: ZeroDofJoint.cpp:794
void setInitialPosition(std::size_t _index, double _initial) override
Change the position that resetPositions() will give to this coordinate.
Definition: ZeroDofJoint.cpp:261
DegreeOfFreedom * getDof(std::size_t) override
Get an object to access the _index-th degree of freedom (generalized coordinate) of this Joint.
Definition: ZeroDofJoint.cpp:63
double getPositionUpperLimit(std::size_t index) const override
Get upper limit for position.
Definition: ZeroDofJoint.cpp:224
void setDampingCoefficient(std::size_t _index, double _d) override
Set coefficient of joint damping (viscous friction) force.
Definition: ZeroDofJoint.cpp:634
void setForceLowerLimit(std::size_t _index, double _force) override
Set lower limit for force.
Definition: ZeroDofJoint.cpp:505
Eigen::VectorXd getVelocityUpperLimits() const override
Get the velocity upper limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:353
void setVelocities(const Eigen::VectorXd &_velocities) override
Set the velocities of all generalized coordinates in this Joint.
Definition: ZeroDofJoint.cpp:297
Eigen::VectorXd getPositionUpperLimits() const override
Get the position upper limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:237
void updateDegreeOfFreedomNames() override
Update the names of the joint's degrees of freedom.
Definition: ZeroDofJoint.cpp:676
double getVelocityUpperLimit(std::size_t _index) const override
Get upper limit for velocity.
Definition: ZeroDofJoint.cpp:341
double getInitialPosition(std::size_t _index) const override
Get the position that resetPosition() will give to this coordinate.
Definition: ZeroDofJoint.cpp:267
void updateTotalForceForInvMassMatrix(const Eigen::Vector6d &_bodyForce) override
Definition: ZeroDofJoint.cpp:882
double getCoulombFriction(std::size_t _index) const override
Get joint Coulomb friction froce.
Definition: ZeroDofJoint.cpp:652
void updateInvProjArtInertia(const Eigen::Matrix6d &_artInertia) override
Update inverse of projected articulated body inertia.
Definition: ZeroDofJoint.cpp:755
void setVelocityUpperLimits(const Eigen::VectorXd &upperLimits) override
Set the velocity upper limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:347
void resetTotalImpulses() override
Set total impulses to zero.
Definition: ZeroDofJoint.cpp:807
void resetVelocity(std::size_t _index) override
Set the velocity of a generalized coordinate in this Joint to its initial velocity.
Definition: ZeroDofJoint.cpp:359
void setAccelerationLowerLimit(std::size_t _index, double _acceleration) override
Set lower limit for acceleration.
Definition: ZeroDofJoint.cpp:425
Eigen::VectorXd getInitialPositions() const override
Get the positions that resetPositions() will give to this Joint's coordinates.
Definition: ZeroDofJoint.cpp:279
void integratePositions(double _dt) override
Integrate positions using Euler method.
Definition: ZeroDofJoint.cpp:590
void setVelocity(std::size_t _index, double _velocity) override
Set the velocity of a single generalized coordinate.
Definition: ZeroDofJoint.cpp:285
ZeroDofJoint(const ZeroDofJoint &)=delete
void resetAccelerations() override
Set the accelerations of all generalized coordinates in this Joint to zero.
Definition: ZeroDofJoint.cpp:419
virtual ~ZeroDofJoint()
Destructor.
Definition: ZeroDofJoint.cpp:51
void setPositions(const Eigen::VectorXd &_positions) override
Set the positions of all generalized coordinates in this Joint.
Definition: ZeroDofJoint.cpp:179
void setForceUpperLimit(std::size_t _index, double _force) override
Set upper limit for force.
Definition: ZeroDofJoint.cpp:529
double getAcceleration(std::size_t _index) const override
Get the acceleration of a single generalized coordinate.
Definition: ZeroDofJoint.cpp:401
double getPosition(std::size_t _index) const override
Get the position of a single generalized coordinate.
Definition: ZeroDofJoint.cpp:170
Eigen::VectorXd getVelocityLowerLimits() const override
Get the velocity lower limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:328
const math::Jacobian getRelativeJacobianTimeDeriv() const override
Get time derivative of spatial Jacobian of the child BodyNode relative to the parent BodyNode express...
Definition: ZeroDofJoint.cpp:702
Eigen::VectorXd getInitialVelocities() const override
Get the velocities that resetVelocities() will give to this Joint's coordinates.
Definition: ZeroDofJoint.cpp:389
Eigen::VectorXd getPositionDifferences(const Eigen::VectorXd &_q2, const Eigen::VectorXd &_q1) const override
Return the difference of two generalized coordinates which are measured in the configuration space of...
Definition: ZeroDofJoint.cpp:602
double getAccelerationUpperLimit(std::size_t _index) const override
Get upper limit for acceleration.
Definition: ZeroDofJoint.cpp:457
void setAccelerationLowerLimits(const Eigen::VectorXd &lowerLimits) override
Set the acceleration upper limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:438
void updateAcceleration(const Eigen::Matrix6d &_artInertia, const Eigen::Vector6d &_spatialAcc) override
Update joint acceleration.
Definition: ZeroDofJoint.cpp:813
void setPositionUpperLimit(std::size_t index, double position) override
Set upper limit for position.
Definition: ZeroDofJoint.cpp:217
void setPositionLowerLimit(std::size_t _index, double _position) override
Set lower limit for position.
Definition: ZeroDofJoint.cpp:191
void setAccelerations(const Eigen::VectorXd &_accelerations) override
Set the accelerations of all generalized coordinates in this Joint.
Definition: ZeroDofJoint.cpp:407
void setForces(const Eigen::VectorXd &_forces) override
Set the forces of all generalized coordinates in this Joint.
Definition: ZeroDofJoint.cpp:487
Matrix< double, 6, 1 > Vector6d
Definition: MathTypes.hpp:49
Matrix< double, 6, 6 > Matrix6d
Definition: MathTypes.hpp:50
Eigen::Matrix< double, 6, Eigen::Dynamic > Jacobian
Definition: MathTypes.hpp:108
Definition: BulletCollisionDetector.cpp:63
Definition: ZeroDofJoint.hpp:52
virtual ~Properties()=default
Properties(const Joint::Properties &_properties=Joint::Properties())
Definition: ZeroDofJoint.cpp:44
Definition: JointAspect.hpp:112