Functions | |
void | mbs_link (double **frc, double **trq, double *Flnk, double *Z, double *Zd, MbsData *s, double tsim) |
void | mbs_link3D (double **frc, double **trq, MbsData *s, double tsim) |
void | mbs_extforces (double **frc, double **trq, MbsData *s, double tsim) |
int | mbs_accelred (MbsData *s, double tsim) |
void | mbs_dirdyna (double **M, double *c, MbsData *s, double tsim) |
void | mbs_invdyna (double *Q, MbsData *s, double tsim) |
void | mbs_cons_hJ (double *h, double **Jac, MbsData *s, double tsim) |
void | mbs_cons_jdqd (double *Jdqd, MbsData *s, double tsim) |
void | mbs_sensor (MbsSensor *sens, MbsData *s, int isens) |
Compute all fields of a sensor (force sensor or classic sensor). More... | |
void | mbs_gensensor (MbsSensor *sens, MbsData *s, int isens) |
double * | user_JointForces (MbsData *s, double tsim) |
Compute the user-specified joint force in all joint. More... | |
double * | user_Link3DForces (double PxF[4], double RxF[4][4], double VxF[4], double OMxF[4], double AxF[4], double OMPxF[4], MbsData *s, double tsim, int ixF) |
Compute an user-specified point to point force, with arbitrary line of action. More... | |
double | user_LinkForces (double Z, double Zd, MbsData *s, double tsim, int ilnk) |
Compute the value of a link forces. More... | |
double * | user_ExtForces (double PxF[4], double RxF[4][4], double VxF[4], double OMxF[4], double AxF[4], double OMPxF[4], MbsData *s, double tsim, int ixF) |
Compute an user-specified external force. More... | |
void | user_Derivative (MbsData *s) |
void | user_DrivenJoints (MbsData *s, double tsim) |
Compute the positions, velocities and acceleration of driven joint. More... | |
void | user_cons_hJ (double *h, double **Jac, MbsData *s, double tsim) |
void | user_cons_jdqd (double *jdqd, MbsData *s, double tsim) |
void | user_cons_J_accelred (MbsData *s, double tsim) |
[Accelred only] Compute the Jac_user matrix nqv x Njoint matrix (starting at one) for custom user constraints in accelred. More... | |
void | user_dirdyn_init (MbsData *mbs_data, MbsDirdyn *mbs_dd) |
user own initialization functions More... | |
void | user_dirdyn_loop (MbsData *mbs_data, MbsDirdyn *mbs_dd) |
user own loop functions More... | |
void | user_dirdyn_finish (MbsData *mbs_data, MbsDirdyn *mbs_dd) |
user own finishing functions More... | |
void | user_invdyn_init (MbsData *mbs_data, MbsInvdyn *mbs_invd) |
void | user_invdyn_loop (MbsData *mbs_data, MbsInvdyn *mbs_invd) |
void | user_invdyn_finish (MbsData *mbs_data, MbsInvdyn *mbs_invd) |
void | user_equil_init (MbsData *mbs_data, MbsEquil *mbs_equil) |
user own initialization functions More... | |
void | user_equil_loop (MbsData *mbs_data, MbsEquil *mbs_equil) |
user own loop functions More... | |
void | user_equil_finish (MbsData *mbs_data, MbsEquil *mbs_equil) |
user own finishing functions More... | |
void | user_equil_fxe (MbsData *mbs_data, double *f) |
user own implementation of added equilibrium equations Fxe Necessary to express equilibrium f(x)=0 More... | |
Define template functions that call the user and symbolic function stored via pointers in the MbsData structure
int mbs_accelred | ( | MbsData * | s, |
double | tsim | ||
) |
void mbs_cons_hJ | ( | double * | h, |
double ** | Jac, | ||
MbsData * | s, | ||
double | tsim | ||
) |
void mbs_cons_jdqd | ( | double * | Jdqd, |
MbsData * | s, | ||
double | tsim | ||
) |
void mbs_dirdyna | ( | double ** | M, |
double * | c, | ||
MbsData * | s, | ||
double | tsim | ||
) |
void mbs_extforces | ( | double ** | frc, |
double ** | trq, | ||
MbsData * | s, | ||
double | tsim | ||
) |
void mbs_invdyna | ( | double * | Q, |
MbsData * | s, | ||
double | tsim | ||
) |
void mbs_link | ( | double ** | frc, |
double ** | trq, | ||
double * | Flnk, | ||
double * | Z, | ||
double * | Zd, | ||
MbsData * | s, | ||
double | tsim | ||
) |
void mbs_link3D | ( | double ** | frc, |
double ** | trq, | ||
MbsData * | s, | ||
double | tsim | ||
) |
Compute all fields of a sensor (force sensor or classic sensor).
[in,out] | sens | Pointer to the MbsSensor structure to compute. |
[in] | s | pointer to the MbsData structure of the model related to the sensor. |
[in] | isens | the ID of the sensor, for Force sensor the id has to be incremented by MbsData::Nsensor. |
void user_cons_hJ | ( | double * | h, |
double ** | Jac, | ||
MbsData * | s, | ||
double | tsim | ||
) |
void user_cons_J_accelred | ( | MbsData * | s, |
double | tsim | ||
) |
[Accelred only] Compute the Jac_user matrix nqv x Njoint matrix (starting at one) for custom user constraints in accelred.
The constraints are assumed to be solved by the user, inside this function. Thus, only the Jacobian of the constraints is needed (in the configuration of solved constraints ! )
[in,out] | s | the MbsData structure of the model on which the user constraints are computed. |
[in] | tsim | the current time of the simulation |
The only field that should be modified is the MbsData::jac_user matrix
void user_cons_jdqd | ( | double * | jdqd, |
MbsData * | s, | ||
double | tsim | ||
) |
void user_Derivative | ( | MbsData * | s | ) |
user own loop functions
This function is called a every time step. Warning: if the used integrator is multi-steps, user_dirdyn_loop is only called once: i.e. at the real time step (and not internal time steps)
[in,out] | mbs_data | data structure of the model |
[in,out] | mbs_dd | general structure of the direct dynamic module (for advanced users) |
For beginners, it is advised to only use the MbsData structure. The field MbsDirdyn is provided for more advanced users.
void user_DrivenJoints | ( | MbsData * | s, |
double | tsim | ||
) |
Compute the positions, velocities and acceleration of driven joint.
[in,out] | s | the MbsData structure of the model on which the driven joint are computed. |
[in] | tsim | the current time of the simulation |
The only fields that should be updated are MbsData::q, MbsData::qd and MbsData::qdd at the indexes MbsData::qc
void user_equil_fxe | ( | MbsData * | mbs_data, |
double * | f | ||
) |
user own implementation of added equilibrium equations Fxe Necessary to express equilibrium f(x)=0
[in] | mbs_data | data structure of the model |
[out] | f | vectors which contains the added equibrium functions : =f(xe, ... ) |
user own initialization functions
Robotran - MBsysC
Template file for equilibrium module
This files enable the user to call custom at specific places in the time simulation. It is a template file that can be edited by the user.
(c) Universite catholique de Louvain
[in,out] | mbs_data | data structure of the model |
[in,out] | mbs_equil | general structure of the equilibrium module (for advance users) |
For beginners, it is advised to only use the MbsData structure. The field MbsEquil is provided for more advance users.
double* user_ExtForces | ( | double | PxF[4], |
double | RxF[4][4], | ||
double | VxF[4], | ||
double | OMxF[4], | ||
double | AxF[4], | ||
double | OMPxF[4], | ||
MbsData * | s, | ||
double | tsim, | ||
int | ixF | ||
) |
Compute an user-specified external force.
[in] | PxF | position vector (index starting at 1) of the force sensor expressed in the inertial frame: . |
[in] | RxF | rotation matrix (index starting at 1) from the inertial frame to the force sensor frame: |
[in] | VxF | velocity vector (index starting at 1) of the force sensor expressed in the inertial frame: . |
[in] | OMxF | angular velocity vector (index starting at 1) of the force sensor expressed in the inertial frame: . |
[in] | AxF | acceleration vector (index starting at 1) of the force sensor expressed in the inertial frame: . |
[in] | OMPxF | angular acceleration vector (index starting at 1) of the force sensor expressed in the inertial frame: . |
[in,out] | s | the MbsData structure of the model on which the force is computed. |
[in] | tsim | the current time of the simulation |
[in] | ixF | the ID identifying the computed force sensor. |
The content of the returned vector Swr is [Fx; Fy; Fz; Mx; My; Mz; dxF]:
double* user_JointForces | ( | MbsData * | s, |
double | tsim | ||
) |
Compute the user-specified joint force in all joint.
[in,out] | s | the MbsData structure of the model on which the joint forces are computed. |
[in] | tsim | the current time of the simulation |
The only field that should be incremented is the MbsData::Qq at the indexes of MbsData::qc
double* user_Link3DForces | ( | double | PxF[4], |
double | RxF[4][4], | ||
double | VxF[4], | ||
double | OMxF[4], | ||
double | AxF[4], | ||
double | OMPxF[4], | ||
MbsData * | s, | ||
double | tsim, | ||
int | ixF | ||
) |
Compute an user-specified point to point force, with arbitrary line of action.
A 3D link force is attached from a body (called the parent body) to a second body (called children body). The parent and children bodies cannot be inverted as it change the definition of both the inputs arguments and outputs results.
For the documentation below, let:
The returned force/torque component are expressed in the frame [P] and applied on both parent and children body at the location of point "B".
[in] | PxF | The vector "AB" (index starting at 1) with components expressed in frame [P]. |
[in] | RxF | The rotation matrix (index starting at 1) such as [C] = Rxf*[P]. |
[in] | VxF | The differential velocity vector (index starting at 1) with components expressed in frame [P]. The velocities are computed at the coordinates of point "M" linked to parent (Md_p), then linked to children (Md_c) body. The differential velocity vector is : Md_c - Md_p. |
[in] | OMxF | The differential angular velocity vector (index starting at 1) with components expressed in frame [P]. It is the difference between the parent angular velocity and the children angular velocity. |
[in] | AxF | The differential acceleration vector (index starting at 1) with components expressed in frame [P]. The accelerations are computed at the coordinates of point "M" linked to parent (Mdd_p), then linked to children (Mdd_c) body. The differential acceleration vector is : Mdd_c - Mdd_p. |
[in] | OMPxF | The differential angular acceleration vector (index starting at 1) with components expressed in frame [P]. It is the difference between the parent angular acceleration and the children angular acceleration. |
[in,out] | s | The MbsData structure of the model on which the force is computed. |
[in] | tsim | The current time of the simulation |
[in] | ixF | The ID identifying the computed link3D force. |
double user_LinkForces | ( | double | Z, |
double | Zd, | ||
MbsData * | s, | ||
double | tsim, | ||
int | ilnk | ||
) |
Compute the value of a link forces.
[in] | Z | the distance (>0) between the extremities of the link force. |
[in] | Zd | the relative velocity between the extremities of the link force, negative if the points get closer. |
[in] | s | the MbsData structure of the model on which the driven joint are computed. |
[in] | tsim | the current time of the simulation. |
[in] | ilnk | the ID identifying the computed link force. |