Biomech-Sim-Toolbox 1
Toolbox for movement simulation and analysis
Loading...
Searching...
No Matches
gait2dc.h
Go to the documentation of this file.
1
18#define NDOF 9 // number of kinematic degrees of freedom
19#define NMOM 6 // number of joint moment inputs to equation of motion
20#define NGRF 6 // number of GRF inputs to equation of motion (2D force and moment on each foot
21#define NSTICK 6 // number of stick figure points generated by Autolev code
22#define NFK 42 // number of forward kinematic outputs generated by Autolev: R(2x2) and p(2) for each segment
23
24typedef struct {
25 // Gravity
26 double gravity;
27 double slope;
28
29 // Air drag
30 double airdrag; // drag coefficient, N/(m/s)^2
31 double wind; // wind speed, m/s (positive value is a tailwind)
32
33 // Body segment parameters
34 double TrunkMass, TrunkInertia, TrunkCMy;
35 double ThighMass, ThighInertia, ThighCMy, ThighLen;
36 double ShankMass, ShankInertia, ShankCMy, ShankLen;
37 double FootMass, FootInertia, FootCMx, FootCMy;
38 double bodyweight;
39
40 // Other parameters
41 double MinAngle[NMOM], MaxAngle[NMOM]; // passive joint range of motion
42 double JointK2[NMOM], JointD[NMOM]; // parameters for nonlinear joint stiffness model
43 double JointK1[NMOM], JointPhi0[NMOM], JointB[NMOM]; // parameters for linear joint stiffness and damping
44
46
47// define struct that holds contact properties
48typedef struct {
49 int foot; // Which foot it is attached to: 0=right, 1=left
50 double x,y; // Resting position on segment
51 double k1,k2,a; // Principal stiffnesses and orientation between segment and stiffness
52 double kxx,kyy,kxy; // Stiffness matrix (symmetric)
53 double b; // Damping between contact point and segment
54 double c; // Friction coefficient
55 double LambdaX; // smoothing parameter for normal force model
56 double LambdaY; // smoothing parameter for friction model
57 double oldcontactmodel; // set to 1 if user wants to use old contact model
58 double k,d0,bo,v0,gamma; // the parameters of the old contact model
60
61// prototype for the Autolev C function for multibody dynamics
63 double q[NDOF],
64 double qd[NDOF],
65 double qdd[NDOF],
66 double mom[NMOM],
67 double grf[NGRF],
68 double Zero[NDOF],
69 double dz_dq[NDOF][NDOF],
70 double dz_dqd[NDOF][NDOF],
71 double dz_dqdd[NDOF][NDOF],
72 double dz_dmom[NDOF][NMOM],
73 double dz_dgrf[NDOF][NGRF],
74 double fk[NFK],
75 double dfk_dq[NFK][NDOF],
76 double fkdot[NFK],
77 double dfkdot_dq[NFK][NDOF]);
78
79// prototype for the Autolev C function for forward kinematics
81 double q[NDOF],
82 double qd[NDOF],
83 double qdd[NDOF],
84 double fk[NFK],
85 double dfk_dq[NFK][NDOF],
86 double fkdot[NFK],
87 double dfkdot_dq[NFK][NDOF]);
88
89// prototype for the Autolev C function for stick figure
91 double q[NDOF],
92 double qd[NDOF],
93 double qdd[NDOF],
94 double fk[NFK],
95 double dfk_dq[NFK][NDOF],
96 double fkdot[NFK],
97 double dfkdot_dq[NFK][NDOF],
98 double Stick[NSTICK][2]);
99
100// prototype for the Autolev C function for contact deformation
101void contact_al(contactprop* contact, // parameters for one contact point
102 double fk[6], double fkdot[6], double xc[4], double xcdot[2], // inputs for one contact point
103 double f[4], double df_dfk[4][6], double df_dfkdot[4][6],
104 double df_dxc[4][4], double df_dxcdot[4][2]); // outputs
105
106// prototype for the Autolev C function for accelerometer model
107 void acc_al(param_struct* par,
108 double q[NDOF],
109 double qd[NDOF],
110 double qdd[NDOF],
111 double acc[42],
112 double dacc_dq[42][NDOF],
113 double dacc_dqd[42][NDOF],
114 double dacc_dqdd[42][NDOF]);
double f[4]
Definition: contact_2d_raw.c:20
double df_dfk[4][6]
Definition: contact_2d_raw.c:20
double xc
Definition: contact_2d_raw.c:19
double df_dfkdot[4][6]
Definition: contact_2d_raw.c:20
double fkdot[48]
Definition: gait10dof18musc_FK_raw.c:24
double dfk_dq[48][10]
Definition: gait10dof18musc_FK_raw.c:24
double fk[48]
Definition: gait10dof18musc_FK_raw.c:24
double dfkdot_dq[48][10]
Definition: gait10dof18musc_FK_raw.c:25
#define NSTICK
Definition: gait2dc.h:21
void contact_al(contactprop *contact, double fk[6], double fkdot[6], double xc[4], double xcdot[2], double f[4], double df_dfk[4][6], double df_dfkdot[4][6], double df_dxc[4][4], double df_dxcdot[4][2])
Definition: contact_al.c:5
#define NGRF
Definition: gait2dc.h:20
void gait2dc_stick_al(param_struct *par, double q[NDOF], double qd[NDOF], double qdd[NDOF], double fk[NFK], double dfk_dq[NFK][NDOF], double fkdot[NFK], double dfkdot_dq[NFK][NDOF], double Stick[NSTICK][2])
Definition: gait2dc_stick_al.c:5
void gait2dc_FK_al(param_struct *par, double q[NDOF], double qd[NDOF], double qdd[NDOF], double fk[NFK], double dfk_dq[NFK][NDOF], double fkdot[NFK], double dfkdot_dq[NFK][NDOF])
Definition: gait2dc_FK_al.c:5
void gait2dc_dynamics_al(param_struct *par, double q[NDOF], double qd[NDOF], double qdd[NDOF], double mom[NMOM], double grf[NGRF], double Zero[NDOF], double dz_dq[NDOF][NDOF], double dz_dqd[NDOF][NDOF], double dz_dqdd[NDOF][NDOF], double dz_dmom[NDOF][NMOM], double dz_dgrf[NDOF][NGRF], double fk[NFK], double dfk_dq[NFK][NDOF], double fkdot[NFK], double dfkdot_dq[NFK][NDOF])
Definition: gait2dc_dyn_al.c:5
#define NMOM
Definition: gait2dc.h:19
#define NFK
Definition: gait2dc.h:22
void acc_al(param_struct *par, double q[NDOF], double qd[NDOF], double qdd[NDOF], double acc[42], double dacc_dq[42][NDOF], double dacc_dqd[42][NDOF], double dacc_dqdd[42][NDOF])
Definition: gait2dc_acc_al.c:5
#define NDOF
Definition: gait2dc.h:18
Definition: gait2d_osim_contact.h:9
double a
Definition: gait2dc.h:51
double b
Definition: gait2dc.h:53
double bo
Definition: gait2dc.h:58
double c
Definition: gait2dc.h:54
double oldcontactmodel
Definition: gait2dc.h:57
int foot
Definition: gait2dc.h:49
double LambdaY
Definition: gait2dc.h:56
double LambdaX
Definition: gait2dc.h:55
double x
Definition: gait2dc.h:50
double kxx
Definition: gait2dc.h:52
Definition: gait10dof18musc_multibody.h:13
double ThighCMy
Definition: gait2dc.h:35
double TrunkCMy
Definition: gait2dc.h:34
double slope
Definition: gait2dc.h:27
double ShankCMy
Definition: gait2dc.h:36
double FootCMx
Definition: gait2dc.h:37
double gravity
Definition: gait2dc.h:26