SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
taoABDynamics.h
1 /* Copyright (c) 2005 Arachi, Inc. and Stanford University. All rights reserved.
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining
4  * a copy of this software and associated documentation files (the
5  * "Software"), to deal in the Software without restriction, including
6  * without limitation the rights to use, copy, modify, merge, publish,
7  * distribute, sublicense, and/or sell copies of the Software, and to
8  * permit persons to whom the Software is furnished to do so, subject
9  * to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included
12  * in all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22 
26 #ifndef _taoABDynamics_h
27 #define _taoABDynamics_h
28 
29 #include "taoTypes.h"
30 
31 class taoDNode;
32 class deMatrix3;
33 class deMatrix6;
34 class deVector3;
35 class deVector6;
36 class deFrame;
37 class taoABDynamicsData;
38 class taoABDynamicsData2;
39 
40 //#ifndef DOXYGEN_SHOULD_SKIP_THIS
41 
49 {
50 public:
52  static void updateLocalXTreeOut(taoDNode* root);
54  static void resetInertiaTreeOut(taoDNode* root);
56  static void resetFlagTreeOut(taoDNode* root);
58 
62  static void forwardDynamics(taoDNode* root, const deVector3* gravity);
64 
68  static void inverseDynamics(taoDNode* root, const deVector3* gravity);
69 
71 
78  static void forwardDynamicsImpulse(taoDNode* contact, const deVector3* point, const deVector3* impulse, const deInt dist);
80 
84  static void globalJacobianOut(taoDNode* root);
86 
90  static void opSpaceInertiaMatrixOut(taoDNode* root, const deMatrix6* Oah = NULL);
91  static void biasAccelerationOut(taoDNode* root, const deVector6* Hh = NULL);
92  static void compute_Jg_Omega_H(taoDNode* root, const deMatrix6* Oah = NULL, const deVector6* Hh = NULL);
93  static deFloat effectiveMassInv(taoDNode* node, const deVector3* point, const deVector3* dir);
94 
95  // ddXn is expressed in {n} for {n} --> ddX = n ddX n
96  static void opSpaceInvDynamics(taoDNode* opNode, deVector6* ddXn);
97  // Fg is expressed in {o} for {n}
98  static void add2Tau_JgT_F(taoDNode* node, const deVector6* Fg);
99 
101 
104  static deFloat potentialEnergy(taoDNode* root, const deVector3* gravity);
106 
110  static deFloat kineticEnergy(taoDNode* root, const deVector6* Vh = NULL);
112  static void resetInertia(taoDNode* node);
113 
114 private:
115  static void _forwardDynamicsOutIn(taoDNode* root, taoABDynamicsData* datah, deVector6* Pah, const deVector6* Vh);
116  static void _inverseDynamicsOutIn(taoDNode* root, taoABDynamicsData2* datah, deVector6* Fh, const deVector6* Vh, const deVector6* Ah);
117  static void _accelerationTreeOut(taoDNode* root, const deVector6* Ah);
118  static void _articulatedImpulsePathIn(taoDNode* contact, const deInt dist);
119  static void _velocityDeltaTreeOut(taoDNode* root, const deVector6* dVh, const deVector6* Vh, const deInt dist);
120  static void _plusEq_Jg_ddQ(taoDNode* node, deVector6* A);
121 };
122 
123 //#endif // DOXYGEN_SHOULD_SKIP_THIS
124 
125 #endif // _taoABDynamics_h
126 
static void resetFlagTreeOut(taoDNode *root)
resets flags in the subtree with root
Definition: taoABDynamics.cpp:73
3x1 vector classThis is a C++ wrapper class of deVector3f.
Definition: TaoDeVector3.h:32
static void resetInertia(taoDNode *node)
resets inertia of node
Definition: taoABDynamics.cpp:60
static void opSpaceInertiaMatrixOut(taoDNode *root, const deMatrix6 *Oah=NULL)
computes inverse operational space inertia matrix for each node: diagonal terms: Omega_i_i ...
Definition: taoABDynamics.cpp:81
static void updateLocalXTreeOut(taoDNode *root)
updates local transforms in the subtree with root
Definition: taoABDynamics.cpp:52
6x1 vector classThis class consists of two 3x1 vectors.
Definition: TaoDeVector6.h:33
abstract node class for articulated bodyA dynamics node = {Articulated Body Link + Set of associated ...
Definition: taoDNode.h:46
static deFloat potentialEnergy(taoDNode *root, const deVector3 *gravity)
computes the potential energy of the subtree with root under gravity
Definition: taoABDynamics.cpp:379
static void resetInertiaTreeOut(taoDNode *root)
resets inertias in the subtree with root
Definition: taoABDynamics.cpp:65
static void forwardDynamics(taoDNode *root, const deVector3 *gravity)
computes forward dynamics of the subtree with root under gravity
Definition: taoABDynamics.cpp:256
static void forwardDynamicsImpulse(taoDNode *contact, const deVector3 *point, const deVector3 *impulse, const deInt dist)
computes velocity changes given impulse
Definition: taoABDynamics.cpp:274
Transformation class using quaternionThis class consists of a quaternion for rotation and a vector fo...
Definition: TaoDeFrame.h:36
6x6 matrix classThis class consists of four 3x3 matrices.
Definition: TaoDeMatrix6.h:33
static void globalJacobianOut(taoDNode *root)
computes global Jacobina matrices
Definition: taoABDynamics.cpp:91
Definition: taoABDynamics.cpp:43
static deFloat kineticEnergy(taoDNode *root, const deVector6 *Vh=NULL)
computes the kinetic energy of the subtree with root under gravity
Definition: taoABDynamics.cpp:391
3x3 matrix classThis is a C++ wrapper class of deMatrix3f.
Definition: TaoDeMatrix3.h:33
Definition: taoABDynamics.cpp:35
Articulated body dynamics classThis class provides inverse and forward dynamics for articulated body...
Definition: taoABDynamics.h:48
static void inverseDynamics(taoDNode *root, const deVector3 *gravity)
computes inverse dynamics of the subtree with root under gravity
Definition: taoABDynamics.cpp:266