DART  6.10.1
ZeroDofJoint.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2021, The DART development contributors
3  * All rights reserved.
4  *
5  * The list of contributors can be found at:
6  * https://github.com/dartsim/dart/blob/master/LICENSE
7  *
8  * This file is provided under the following "BSD-style" License:
9  * Redistribution and use in source and binary forms, with or
10  * without modification, are permitted provided that the following
11  * conditions are met:
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
19  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
23  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
26  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef DART_DYNAMICS_ZERODOFJOINT_HPP_
34 #define DART_DYNAMICS_ZERODOFJOINT_HPP_
35 
36 #include <string>
37 
38 #include "dart/dynamics/Joint.hpp"
39 
40 namespace dart {
41 namespace dynamics {
42 
43 class BodyNode;
44 class Skeleton;
45 
47 class ZeroDofJoint : public Joint
48 {
49 public:
51  {
52  Properties(const Joint::Properties& _properties = Joint::Properties());
53  virtual ~Properties() = default;
54  };
55 
56  ZeroDofJoint(const ZeroDofJoint&) = delete;
57 
59  virtual ~ZeroDofJoint();
60 
63 
64  //----------------------------------------------------------------------------
65  // Interface for generalized coordinates
66  //----------------------------------------------------------------------------
67 
68  // Documentation inherited
69  DegreeOfFreedom* getDof(std::size_t) override;
70 
71  // Documentation inherited
72  const DegreeOfFreedom* getDof(std::size_t) const override;
73 
74  // Documentation inherited
75  const std::string& setDofName(std::size_t, const std::string&, bool) override;
76 
77  // Documentation inherited
78  void preserveDofName(std::size_t, bool) override;
79 
80  // Documentation inherited
81  bool isDofNamePreserved(std::size_t) const override;
82 
83  const std::string& getDofName(std::size_t) const override;
84 
85  // Documentation inherited
86  std::size_t getNumDofs() const override;
87 
88  // Documentation inherited
89  std::size_t getIndexInSkeleton(std::size_t _index) const override;
90 
91  // Documentation inherited
92  std::size_t getIndexInTree(std::size_t _index) const override;
93 
94  //----------------------------------------------------------------------------
95  // Command
96  //----------------------------------------------------------------------------
97 
98  // Documentation inherited
99  void setCommand(std::size_t _index, double _command) override;
100 
101  // Documentation inherited
102  double getCommand(std::size_t _index) const override;
103 
104  // Documentation inherited
105  void setCommands(const Eigen::VectorXd& _commands) override;
106 
107  // Documentation inherited
108  Eigen::VectorXd getCommands() const override;
109 
110  // Documentation inherited
111  void resetCommands() override;
112 
113  //----------------------------------------------------------------------------
114  // Position
115  //----------------------------------------------------------------------------
116 
117  // Documentation inherited
118  void setPosition(std::size_t, double) override;
119 
120  // Documentation inherited
121  double getPosition(std::size_t _index) const override;
122 
123  // Documentation inherited
124  void setPositions(const Eigen::VectorXd& _positions) override;
125 
126  // Documentation inherited
127  Eigen::VectorXd getPositions() const override;
128 
129  // Documentation inherited
130  void setPositionLowerLimit(std::size_t _index, double _position) override;
131 
132  // Documentation inherited
133  double getPositionLowerLimit(std::size_t _index) const override;
134 
135  // Documentation inherited
136  void setPositionLowerLimits(const Eigen::VectorXd& lowerLimits) override;
137 
138  // Documentation inherited
139  Eigen::VectorXd getPositionLowerLimits() const override;
140 
141  // Documentation inherited
142  void setPositionUpperLimit(std::size_t index, double position) override;
143 
144  // Documentation inherited
145  double getPositionUpperLimit(std::size_t index) const override;
146 
147  // Documentation inherited
148  void setPositionUpperLimits(const Eigen::VectorXd& upperLimits) override;
149 
150  // Documentation inherited
151  Eigen::VectorXd getPositionUpperLimits() const override;
152 
153  // Documentation inherited
154  bool hasPositionLimit(std::size_t _index) const override;
155 
156  // Documentation inherited
157  void resetPosition(std::size_t _index) override;
158 
159  // Documentation inherited
160  void resetPositions() override;
161 
162  // Documentation inherited
163  void setInitialPosition(std::size_t _index, double _initial) override;
164 
165  // Documentation inherited
166  double getInitialPosition(std::size_t _index) const override;
167 
168  // Documentation inherited
169  void setInitialPositions(const Eigen::VectorXd& _initial) override;
170 
171  // Documentation inherited
172  Eigen::VectorXd getInitialPositions() const override;
173 
174  //----------------------------------------------------------------------------
175  // Velocity
176  //----------------------------------------------------------------------------
177 
178  // Documentation inherited
179  void setVelocity(std::size_t _index, double _velocity) override;
180 
181  // Documentation inherited
182  double getVelocity(std::size_t _index) const override;
183 
184  // Documentation inherited
185  void setVelocities(const Eigen::VectorXd& _velocities) override;
186 
187  // Documentation inherited
188  Eigen::VectorXd getVelocities() const override;
189 
190  // Documentation inherited
191  void setVelocityLowerLimit(std::size_t _index, double _velocity) override;
192 
193  // Documentation inherited
194  double getVelocityLowerLimit(std::size_t _index) const override;
195 
196  // Documentation inherited
197  void setVelocityLowerLimits(const Eigen::VectorXd& lowerLimits) override;
198 
199  // Documentation inherited
200  Eigen::VectorXd getVelocityLowerLimits() const override;
201 
202  // Documentation inherited
203  void setVelocityUpperLimit(std::size_t _index, double _velocity) override;
204 
205  // Documentation inherited
206  double getVelocityUpperLimit(std::size_t _index) const override;
207 
208  // Documentation inherited
209  void setVelocityUpperLimits(const Eigen::VectorXd& upperLimits) override;
210 
211  // Documentation inherited
212  Eigen::VectorXd getVelocityUpperLimits() const override;
213 
214  // Documentation inherited
215  void resetVelocity(std::size_t _index) override;
216 
217  // Documentation inherited
218  void resetVelocities() override;
219 
220  // Documentation inherited
221  void setInitialVelocity(std::size_t _index, double _initial) override;
222 
223  // Documentation inherited
224  double getInitialVelocity(std::size_t _index) const override;
225 
226  // Documentation inherited
227  void setInitialVelocities(const Eigen::VectorXd& _initial) override;
228 
229  // Documentation inherited
230  Eigen::VectorXd getInitialVelocities() const override;
231 
232  //----------------------------------------------------------------------------
233  // Acceleration
234  //----------------------------------------------------------------------------
235 
236  // Documentation inherited
237  void setAcceleration(std::size_t _index, double _acceleration) override;
238 
239  // Documentation inherited
240  double getAcceleration(std::size_t _index) const override;
241 
242  // Documentation inherited
243  void setAccelerations(const Eigen::VectorXd& _accelerations) override;
244 
245  // Documentation inherited
246  Eigen::VectorXd getAccelerations() const override;
247 
248  // Documentation inherited
249  void resetAccelerations() override;
250 
251  // Documentation inherited
253  std::size_t _index, double _acceleration) override;
254 
255  // Documentation inherited
256  double getAccelerationLowerLimit(std::size_t _index) const override;
257 
258  // Documentation inherited
259  void setAccelerationLowerLimits(const Eigen::VectorXd& lowerLimits) override;
260 
261  // Documentation inherited
262  Eigen::VectorXd getAccelerationLowerLimits() const override;
263 
264  // Documentation inherited
266  std::size_t _index, double _acceleration) override;
267 
268  // Documentation inherited
269  double getAccelerationUpperLimit(std::size_t _index) const override;
270 
271  // Documentation inherited
272  void setAccelerationUpperLimits(const Eigen::VectorXd& upperLimits) override;
273 
274  // Documentation inherited
275  Eigen::VectorXd getAccelerationUpperLimits() const override;
276 
277  //----------------------------------------------------------------------------
278  // Force
279  //----------------------------------------------------------------------------
280 
281  // Documentation inherited
282  void setForce(std::size_t _index, double _force) override;
283 
284  // Documentation inherited
285  double getForce(std::size_t _index) const override;
286 
287  // Documentation inherited
288  void setForces(const Eigen::VectorXd& _forces) override;
289 
290  // Documentation inherited
291  Eigen::VectorXd getForces() const override;
292 
293  // Documentation inherited
294  void resetForces() override;
295 
296  // Documentation inherited
297  void setForceLowerLimit(std::size_t _index, double _force) override;
298 
299  // Documentation inherited
300  double getForceLowerLimit(std::size_t _index) const override;
301 
302  // Documentation inherited
303  void setForceLowerLimits(const Eigen::VectorXd& lowerLimits) override;
304 
305  // Documentation inherited
306  Eigen::VectorXd getForceLowerLimits() const override;
307 
308  // Documentation inherited
309  void setForceUpperLimit(std::size_t _index, double _force) override;
310 
311  // Documentation inherited
312  double getForceUpperLimit(std::size_t _index) const override;
313 
314  // Documentation inherited
315  void setForceUpperLimits(const Eigen::VectorXd& upperLimits) override;
316 
317  // Documentation inherited
318  Eigen::VectorXd getForceUpperLimits() const override;
319 
320  //----------------------------------------------------------------------------
321  // Velocity change
322  //----------------------------------------------------------------------------
323 
324  // Documentation inherited
325  void setVelocityChange(std::size_t _index, double _velocityChange) override;
326 
327  // Documentation inherited
328  double getVelocityChange(std::size_t _index) const override;
329 
330  // Documentation inherited
331  void resetVelocityChanges() override;
332 
333  //----------------------------------------------------------------------------
334  // Constraint impulse
335  //----------------------------------------------------------------------------
336 
337  // Documentation inherited
338  void setConstraintImpulse(std::size_t _index, double _impulse) override;
339 
340  // Documentation inherited
341  double getConstraintImpulse(std::size_t _index) const override;
342 
343  // Documentation inherited
344  void resetConstraintImpulses() override;
345 
346  //----------------------------------------------------------------------------
347  // Integration and finite difference
348  //----------------------------------------------------------------------------
349 
350  // Documentation inherited
351  void integratePositions(double _dt) override;
352 
353  // Documentation inherited
354  void integrateVelocities(double _dt) override;
355 
356  // Documentation inherited
357  Eigen::VectorXd getPositionDifferences(
358  const Eigen::VectorXd& _q2, const Eigen::VectorXd& _q1) const override;
359 
360  //----------------------------------------------------------------------------
362  //----------------------------------------------------------------------------
363 
364  // Documentation inherited
365  void setSpringStiffness(std::size_t _index, double _k) override;
366 
367  // Documentation inherited
368  double getSpringStiffness(std::size_t _index) const override;
369 
370  // Documentation inherited
371  void setRestPosition(std::size_t _index, double _q0) override;
372 
373  // Documentation inherited
374  double getRestPosition(std::size_t _index) const override;
375 
376  // Documentation inherited
377  void setDampingCoefficient(std::size_t _index, double _d) override;
378 
379  // Documentation inherited
380  double getDampingCoefficient(std::size_t _index) const override;
381 
382  // Documentation inherited
383  void setCoulombFriction(std::size_t _index, double _friction) override;
384 
385  // Documentation inherited
386  double getCoulombFriction(std::size_t _index) const override;
387 
389 
390  //----------------------------------------------------------------------------
391 
392  // Documentation inherited
393  double computePotentialEnergy() const override;
394 
395  // Documentation inherited
396  Eigen::Vector6d getBodyConstraintWrench() const override;
397 
398 protected:
400  ZeroDofJoint();
401 
402  // Documentation inherited
403  void registerDofs() override;
404 
405  // Documentation inherited
406  void updateDegreeOfFreedomNames() override;
407 
408  //----------------------------------------------------------------------------
410  //----------------------------------------------------------------------------
411 
412  // Documentation inherited
413  const math::Jacobian getRelativeJacobian() const override;
414 
415  // Documentation inherited
417  const Eigen::VectorXd& _positions) const override;
418 
419  // Documentation inherited
420  const math::Jacobian getRelativeJacobianTimeDeriv() const override;
421 
422  // Documentation inherited
423  void addVelocityTo(Eigen::Vector6d& _vel) override;
424 
425  // Documentation inherited
427  Eigen::Vector6d& _partialAcceleration,
428  const Eigen::Vector6d& _childVelocity) override;
429 
430  // Documentation inherited
431  void addAccelerationTo(Eigen::Vector6d& _acc) override;
432 
433  // Documentation inherited
434  void addVelocityChangeTo(Eigen::Vector6d& _velocityChange) override;
435 
436  // Documentation inherited
438  Eigen::Matrix6d& _parentArtInertia,
439  const Eigen::Matrix6d& _childArtInertia) override;
440 
441  // Documentation inherited
443  Eigen::Matrix6d& _parentArtInertia,
444  const Eigen::Matrix6d& _childArtInertia) override;
445 
446  // Documentation inherited
447  void updateInvProjArtInertia(const Eigen::Matrix6d& _artInertia) override;
448 
449  // Documentation inherited
451  const Eigen::Matrix6d& _artInertia, double _timeStep) override;
452 
453  // Documentation inherited
454  void addChildBiasForceTo(
455  Eigen::Vector6d& _parentBiasForce,
456  const Eigen::Matrix6d& _childArtInertia,
457  const Eigen::Vector6d& _childBiasForce,
458  const Eigen::Vector6d& _childPartialAcc) override;
459 
460  // Documentation inherited
462  Eigen::Vector6d& _parentBiasImpulse,
463  const Eigen::Matrix6d& _childArtInertia,
464  const Eigen::Vector6d& _childBiasImpulse) override;
465 
466  // Documentation inherited
467  void updateTotalForce(
468  const Eigen::Vector6d& _bodyForce, double _timeStep) override;
469 
470  // Documentation inherited
471  void updateTotalImpulse(const Eigen::Vector6d& _bodyImpulse) override;
472 
473  // Documentation inherited
474  void resetTotalImpulses() override;
475 
476  // Documentation inherited
477  void updateAcceleration(
478  const Eigen::Matrix6d& _artInertia,
479  const Eigen::Vector6d& _spatialAcc) override;
480 
481  // Documentation inherited
483  const Eigen::Matrix6d& _artInertia,
484  const Eigen::Vector6d& _velocityChange) override;
485 
486  // Documentation inherited
487  void updateForceID(
488  const Eigen::Vector6d& _bodyForce,
489  double _timeStep,
490  bool _withDampingForces,
491  bool _withSpringForces) override;
492 
493  // Documentation inherited
494  void updateForceFD(
495  const Eigen::Vector6d& _bodyForce,
496  double _timeStep,
497  bool _withDampingForces,
498  bool _withSpringForces) override;
499 
500  // Documentation inherited
501  void updateImpulseID(const Eigen::Vector6d& _bodyImpulse) override;
502 
503  // Documentation inherited
504  void updateImpulseFD(const Eigen::Vector6d& _bodyImpulse) override;
505 
506  // Documentation inherited
507  void updateConstrainedTerms(double _timeStep) override;
508 
510 
511  //----------------------------------------------------------------------------
513  //----------------------------------------------------------------------------
514 
517  Eigen::Vector6d& _parentBiasForce,
518  const Eigen::Matrix6d& _childArtInertia,
519  const Eigen::Vector6d& _childBiasForce) override;
520 
523  Eigen::Vector6d& _parentBiasForce,
524  const Eigen::Matrix6d& _childArtInertia,
525  const Eigen::Vector6d& _childBiasForce) override;
526 
529  const Eigen::Vector6d& _bodyForce) override;
530 
531  // Documentation inherited
533  Eigen::MatrixXd& _invMassMat,
534  const std::size_t _col,
535  const Eigen::Matrix6d& _artInertia,
536  const Eigen::Vector6d& _spatialAcc) override;
537 
538  // Documentation inherited
540  Eigen::MatrixXd& _invMassMat,
541  const std::size_t _col,
542  const Eigen::Matrix6d& _artInertia,
543  const Eigen::Vector6d& _spatialAcc) override;
544 
545  // Documentation inherited
546  void addInvMassMatrixSegmentTo(Eigen::Vector6d& _acc) override;
547 
548  // Documentation inherited
549  Eigen::VectorXd getSpatialToGeneralized(
550  const Eigen::Vector6d& _spatial) override;
551 
553 
554 private:
556  const std::string emptyString;
557 };
558 
559 } // namespace dynamics
560 } // namespace dart
561 
562 #endif // DART_DYNAMICS_ZERODOFJOINT_HPP_
std::size_t index
Definition: SkelParser.cpp:1672
Eigen::VectorXd position
Definition: SkelParser.cpp:108
DegreeOfFreedom class is a proxy class for accessing single degrees of freedom (aka generalized coord...
Definition: DegreeOfFreedom.hpp:55
class Joint
Definition: Joint.hpp:60
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:722
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:884
Eigen::VectorXd getVelocities() const override
Get the velocities of all generalized coordinates in this Joint.
Definition: ZeroDofJoint.cpp:304
const std::string & getDofName(std::size_t) const override
Alternative to DegreeOfFreedom::getName()
Definition: ZeroDofJoint.cpp:100
void setForceLowerLimits(const Eigen::VectorXd &lowerLimits) override
Set the force upper limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:524
void updateImpulseFD(const Eigen::Vector6d &_bodyImpulse) override
Update joint impulses for forward dynamics.
Definition: ZeroDofJoint.cpp:863
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:122
void setAccelerationUpperLimit(std::size_t _index, double _acceleration) override
Set upper limit for acceleration.
Definition: ZeroDofJoint.cpp:456
bool isDofNamePreserved(std::size_t) const override
Alternative to DegreeOfFreedom::isNamePreserved()
Definition: ZeroDofJoint.cpp:94
double getConstraintImpulse(std::size_t _index) const override
Get a single constraint impulse.
Definition: ZeroDofJoint.cpp:586
void setCommands(const Eigen::VectorXd &_commands) override
Set all commands for this Joint.
Definition: ZeroDofJoint.cpp:147
void setCoulombFriction(std::size_t _index, double _friction) override
Set joint Coulomb friction froce.
Definition: ZeroDofJoint.cpp:653
void addInvMassMatrixSegmentTo(Eigen::Vector6d &_acc) override
Definition: ZeroDofJoint.cpp:920
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:875
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:138
double getSpringStiffness(std::size_t _index) const override
Get stiffness of joint spring force.
Definition: ZeroDofJoint.cpp:623
void setVelocityChange(std::size_t _index, double _velocityChange) override
Set a single velocity change.
Definition: ZeroDofJoint.cpp:560
double getVelocity(std::size_t _index) const override
Get the velocity of a single generalized coordinate.
Definition: ZeroDofJoint.cpp:292
void setPartialAccelerationTo(Eigen::Vector6d &_partialAcceleration, const Eigen::Vector6d &_childVelocity) override
Set joint partial acceleration to _partialAcceleration.
Definition: ZeroDofJoint.cpp:728
void setConstraintImpulse(std::size_t _index, double _impulse) override
Set a single constraint impulse.
Definition: ZeroDofJoint.cpp:579
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:697
void addChildArtInertiaTo(Eigen::Matrix6d &_parentArtInertia, const Eigen::Matrix6d &_childArtInertia) override
Add child's articulated inertia to parent's one.
Definition: ZeroDofJoint.cpp:742
void setInitialPositions(const Eigen::VectorXd &_initial) override
Change the positions that resetPositions() will give to this Joint's coordinates.
Definition: ZeroDofJoint.cpp:274
void preserveDofName(std::size_t, bool) override
Alternative to DegreeOfFreedom::preserveName()
Definition: ZeroDofJoint.cpp:88
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:790
double getVelocityLowerLimit(std::size_t _index) const override
Get lower limit for velocity.
Definition: ZeroDofJoint.cpp:317
double computePotentialEnergy() const override
Compute and return the potential energy.
Definition: ZeroDofJoint.cpp:666
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:776
void setForceUpperLimits(const Eigen::VectorXd &upperLimits) override
Set the force upper limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:548
double getRestPosition(std::size_t _index) const override
Get rest position of spring force.
Definition: ZeroDofJoint.cpp:635
double getForceLowerLimit(std::size_t _index) const override
Get lower limit for force.
Definition: ZeroDofJoint.cpp:518
void integrateVelocities(double _dt) override
Integrate velocities using Euler method.
Definition: ZeroDofJoint.cpp:604
Eigen::VectorXd getForceUpperLimits() const override
Get the force upper limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:554
Eigen::VectorXd getAccelerationLowerLimits() const override
Get the acceleration upper limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:450
void setVelocityUpperLimit(std::size_t _index, double _velocity) override
Set upper limit for velocity.
Definition: ZeroDofJoint.cpp:336
void updateForceID(const Eigen::Vector6d &_bodyForce, double _timeStep, bool _withDampingForces, bool _withSpringForces) override
Update joint force for inverse dynamics.
Definition: ZeroDofJoint.cpp:837
void updateImpulseID(const Eigen::Vector6d &_bodyImpulse) override
Update joint impulses for inverse dynamics.
Definition: ZeroDofJoint.cpp:857
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:752
Properties getZeroDofJointProperties() const
Get the Properties of this ZeroDofJoint.
Definition: ZeroDofJoint.cpp:57
ZeroDofJoint()
Constructor called by inheriting classes.
Definition: ZeroDofJoint.cpp:672
void setAccelerationUpperLimits(const Eigen::VectorXd &upperLimits) override
Set the acceleration upper limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:469
void addAccelerationTo(Eigen::Vector6d &_acc) override
Add joint acceleration to _acc.
Definition: ZeroDofJoint.cpp:736
void resetCommands() override
Set all the commands for this Joint to zero.
Definition: ZeroDofJoint.cpp:159
Eigen::VectorXd getForceLowerLimits() const override
Get the force upper limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:530
std::size_t getNumDofs() const override
Get number of generalized coordinates.
Definition: ZeroDofJoint.cpp:106
Eigen::Vector6d getBodyConstraintWrench() const override
Get constraint wrench expressed in body node frame.
Definition: ZeroDofJoint.cpp:690
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:387
void resetConstraintImpulses() override
Set zero all the constraint impulses.
Definition: ZeroDofJoint.cpp:592
void getInvAugMassMatrixSegment(Eigen::MatrixXd &_invMassMat, const std::size_t _col, const Eigen::Matrix6d &_artInertia, const Eigen::Vector6d &_spatialAcc) override
Definition: ZeroDofJoint.cpp:910
void setForce(std::size_t _index, double _force) override
Set the force of a single generalized coordinate.
Definition: ZeroDofJoint.cpp:482
double getAccelerationLowerLimit(std::size_t _index) const override
Get lower limit for acceleration.
Definition: ZeroDofJoint.cpp:437
void setPosition(std::size_t, double) override
Set the position of a single generalized coordinate.
Definition: ZeroDofJoint.cpp:165
double getForce(std::size_t _index) const override
Get the force of a single generalized coordinate.
Definition: ZeroDofJoint.cpp:488
void setVelocityLowerLimit(std::size_t _index, double _velocity) override
Set lower limit for velocity.
Definition: ZeroDofJoint.cpp:310
void resetVelocityChanges() override
Set zero all the velocity change.
Definition: ZeroDofJoint.cpp:573
void registerDofs() override
Called by the Skeleton class.
Definition: ZeroDofJoint.cpp:678
Eigen::VectorXd getSpatialToGeneralized(const Eigen::Vector6d &_spatial) override
Definition: ZeroDofJoint.cpp:926
double getVelocityChange(std::size_t _index) const override
Get a single velocity change.
Definition: ZeroDofJoint.cpp:567
void setSpringStiffness(std::size_t _index, double _k) override
Set stiffness of joint spring force.
Definition: ZeroDofJoint.cpp:617
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:132
Eigen::VectorXd getAccelerations() const override
Get the accelerations of all generalized coordinates in this Joint.
Definition: ZeroDofJoint.cpp:418
void addVelocityTo(Eigen::Vector6d &_vel) override
Add joint velocity to _vel.
Definition: ZeroDofJoint.cpp:716
double getInitialVelocity(std::size_t _index) const override
Get the velocity that resetVelocity() will give to this coordinate.
Definition: ZeroDofJoint.cpp:381
void setRestPosition(std::size_t _index, double _q0) override
Set rest position of spring force.
Definition: ZeroDofJoint.cpp:629
Eigen::VectorXd getCommands() const override
Get all commands for this Joint.
Definition: ZeroDofJoint.cpp:153
void setAcceleration(std::size_t _index, double _acceleration) override
Set the acceleration of a single generalized coordinate.
Definition: ZeroDofJoint.cpp:399
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:112
void resetForces() override
Set the forces of all generalized coordinates in this Joint to zero.
Definition: ZeroDofJoint.cpp:506
void setInitialVelocity(std::size_t _index, double _initial) override
Change the velocity that resetVelocity() will give to this coordinate.
Definition: ZeroDofJoint.cpp:374
void updateVelocityChange(const Eigen::Matrix6d &_artInertia, const Eigen::Vector6d &_velocityChange) override
Update joint velocity change.
Definition: ZeroDofJoint.cpp:829
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:847
void resetVelocities() override
Set the velocities of all generalized coordinates in this Joint to their initial velocities.
Definition: ZeroDofJoint.cpp:368
void updateInvProjArtInertiaImplicit(const Eigen::Matrix6d &_artInertia, double _timeStep) override
Forward dynamics routine.
Definition: ZeroDofJoint.cpp:769
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:809
double getDampingCoefficient(std::size_t _index) const override
Get coefficient of joint damping (viscous friction) force.
Definition: ZeroDofJoint.cpp:647
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:869
void setVelocityLowerLimits(const Eigen::VectorXd &lowerLimits) override
Set the velocity lower limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:323
double getForceUpperLimit(std::size_t _index) const override
Get upper limit for force.
Definition: ZeroDofJoint.cpp:542
void getInvMassMatrixSegment(Eigen::MatrixXd &_invMassMat, const std::size_t _col, const Eigen::Matrix6d &_artInertia, const Eigen::Vector6d &_spatialAcc) override
Definition: ZeroDofJoint.cpp:900
Eigen::VectorXd getAccelerationUpperLimits() const override
Get the acceleration upper limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:476
Eigen::VectorXd getForces() const override
Get the forces of all generalized coordinates in this Joint.
Definition: ZeroDofJoint.cpp:500
void updateTotalForce(const Eigen::Vector6d &_bodyForce, double _timeStep) override
Update joint total force.
Definition: ZeroDofJoint.cpp:802
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:641
void setForceLowerLimit(std::size_t _index, double _force) override
Set lower limit for force.
Definition: ZeroDofJoint.cpp:512
Eigen::VectorXd getVelocityUpperLimits() const override
Get the velocity upper limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:356
void setVelocities(const Eigen::VectorXd &_velocities) override
Set the velocities of all generalized coordinates in this Joint.
Definition: ZeroDofJoint.cpp:298
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:684
double getVelocityUpperLimit(std::size_t _index) const override
Get upper limit for velocity.
Definition: ZeroDofJoint.cpp:343
double getInitialPosition(std::size_t _index) const override
Get the position that resetPosition() will give to this coordinate.
Definition: ZeroDofJoint.cpp:268
void updateTotalForceForInvMassMatrix(const Eigen::Vector6d &_bodyForce) override
Definition: ZeroDofJoint.cpp:893
double getCoulombFriction(std::size_t _index) const override
Get joint Coulomb friction froce.
Definition: ZeroDofJoint.cpp:660
void updateInvProjArtInertia(const Eigen::Matrix6d &_artInertia) override
Update inverse of projected articulated body inertia.
Definition: ZeroDofJoint.cpp:762
void setVelocityUpperLimits(const Eigen::VectorXd &upperLimits) override
Set the velocity upper limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:349
void resetTotalImpulses() override
Set total impulses to zero.
Definition: ZeroDofJoint.cpp:815
void resetVelocity(std::size_t _index) override
Set the velocity of a generalized coordinate in this Joint to its initial velocity.
Definition: ZeroDofJoint.cpp:362
void setAccelerationLowerLimit(std::size_t _index, double _acceleration) override
Set lower limit for acceleration.
Definition: ZeroDofJoint.cpp:430
Eigen::VectorXd getInitialPositions() const override
Get the positions that resetPositions() will give to this Joint's coordinates.
Definition: ZeroDofJoint.cpp:280
void integratePositions(double _dt) override
Integrate positions using Euler method.
Definition: ZeroDofJoint.cpp:598
void setVelocity(std::size_t _index, double _velocity) override
Set the velocity of a single generalized coordinate.
Definition: ZeroDofJoint.cpp:286
ZeroDofJoint(const ZeroDofJoint &)=delete
void resetAccelerations() override
Set the accelerations of all generalized coordinates in this Joint to zero.
Definition: ZeroDofJoint.cpp:424
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:536
double getAcceleration(std::size_t _index) const override
Get the acceleration of a single generalized coordinate.
Definition: ZeroDofJoint.cpp:406
double getPosition(std::size_t _index) const override
Get the position of a single generalized coordinate.
Definition: ZeroDofJoint.cpp:171
Eigen::VectorXd getVelocityLowerLimits() const override
Get the velocity lower limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:330
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:710
Eigen::VectorXd getInitialVelocities() const override
Get the velocities that resetVelocities() will give to this Joint's coordinates.
Definition: ZeroDofJoint.cpp:393
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:610
double getAccelerationUpperLimit(std::size_t _index) const override
Get upper limit for acceleration.
Definition: ZeroDofJoint.cpp:463
void setAccelerationLowerLimits(const Eigen::VectorXd &lowerLimits) override
Set the acceleration upper limits of all the generalized coordinates.
Definition: ZeroDofJoint.cpp:443
void updateAcceleration(const Eigen::Matrix6d &_artInertia, const Eigen::Vector6d &_spatialAcc) override
Update joint acceleration.
Definition: ZeroDofJoint.cpp:821
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:412
void setForces(const Eigen::VectorXd &_forces) override
Set the forces of all generalized coordinates in this Joint.
Definition: ZeroDofJoint.cpp:494
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:114
Definition: BulletCollisionDetector.cpp:65
Definition: ZeroDofJoint.hpp:51
Properties(const Joint::Properties &_properties=Joint::Properties())
Definition: ZeroDofJoint.cpp:44
Definition: JointAspect.hpp:112