#include "mbs_data.h"
#include "mbs_aux.h"
#include "mbs_dirdyn_struct.h"
#include "mbs_equil_struct.h"
Go to the source code of this file.
Functions | |
void | mbs_get_project_functions (MbsData *mbs_data) |
loads the project function into the pointers defined in MbsData::fct More... | |
void | user_load_post (MbsData *MBSdata) |
User own initialization operations. More... | |
void | user_free (MbsData *MBSdata) |
User own freeing operations. More... | |
void | user_dirdyn_init (MbsData *MBSdata, MbsDirdyn *mbs_dd) |
user own initialization functions More... | |
void | user_dirdyn_loop (MbsData *MBSdata, MbsDirdyn *mbs_dd) |
user own loop functions More... | |
void | user_dirdyn_finish (MbsData *MBSdata, MbsDirdyn *mbs_dd) |
user own finishing functions More... | |
void | user_invdyn_init (MbsData *MBSdata, MbsInvdyn *mbs_invd) |
void | user_invdyn_loop (MbsData *MBSdata, MbsInvdyn *mbs_invd) |
void | user_invdyn_finish (MbsData *MBSdata, MbsInvdyn *mbs_invd) |
void | user_equil_init (MbsData *MBSdata, MbsEquil *mbs_equil) |
user own initialization functions More... | |
void | user_equil_loop (MbsData *MBSdata, MbsEquil *mbs_equil) |
user own loop functions More... | |
void | user_equil_finish (MbsData *MBSdata, 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... | |
void | user_cons_hJ (double *h, double **Jac, MbsData *s, double tsim) |
void | user_cons_jdqd (double *jdqd, MbsData *s, double tsim) |
void | user_Derivative (MbsData *s) |
void | user_DrivenJoints (MbsData *s, double tsim) |
Compute the positions, velocities and acceleration of driven joint. 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... | |
double * | user_GenExtForces (double PxF[4], double RxF[4][4], double VxF[4], double OMxF[4], double AxF[4], double OMPxF[4], MbsData *s, double tsim, int iBody) |
double * | user_JointForces (MbsData *s, double tsim) |
Compute the user-specified joint force in all joint. More... | |
double | user_LinkForces (double Z, double Zd, MbsData *s, double tsim, int ilnk) |
Compute the value of a link forces. 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... | |
int | 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 | mbs_cons_hJ (double *h, double **Jac, MbsData *s, double tsim) |
void | mbs_cons_jdqd (double *Jdqd, 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) |
void | mbs_extforces (double **frc, double **trq, MbsData *s, double tsim) |
int | mbs_accelred (MbsData *s, double tsim) |
void | mbs_gensensor (MbsSensor *sens, MbsData *s, int isens) |
void | mbs_sensor (MbsSensor *sens, MbsData *s, int isens) |
Compute all fields of a sensor (force sensor or classic sensor). More... | |
void | mbs_invdyna (double *Qq, MbsData *s, double tsim) |
void | mbs_dirdyna (double **M, double *c, MbsData *s, double tsim) |
Declaration of functions that are project dependent. It consists in user and symbolic functions.
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_get_project_functions | ( | MbsData * | mbs_data | ) |
loads the project function into the pointers defined in MbsData::fct
[in,out] | mbs_data | the MbsData structure of the model |
void mbs_invdyna | ( | double * | Qq, |
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 | ||
) |
int 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]:
void user_free | ( | MbsData * | mbs_data | ) |
User own freeing operations.
This function will automatically be called at the project freeing by mbs_delete_data() function. All memory allocated by the user (in the user model)ie. in a user model) should be properly freed. Such memory may have been allocated in the user_load_post() function.
[in,out] | mbs_data | data structure of the model |
double* user_GenExtForces | ( | double | PxF[4], |
double | RxF[4][4], | ||
double | VxF[4], | ||
double | OMxF[4], | ||
double | AxF[4], | ||
double | OMPxF[4], | ||
MbsData * | s, | ||
double | tsim, | ||
int | iBody | ||
) |
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. |
void user_load_post | ( | MbsData * | mbs_data | ) |
User own initialization operations.
This function will automatically be called at the project loading by mbs_load() function. The user can define in this function various initialization, allocation or configuration steps required by the project (ie. allocating and configuring user model of type being structure).
[in,out] | mbs_data | Data structure of the model. |