Go to the source code of this file.
Functions | |
| int | dirdynared (MbsAux *mbs_aux, MbsData *s) |
| Compute the joint accelerations of the system in the current configuration. More... | |
| int | invdynared (MbsAux *mbs_aux, MbsData *s) |
| Compute the required forces ont the actuated joints in a configuration. More... | |
| int | mbs_Mred (MbsAux *mbs_aux, MbsData *s) |
| compute Mr, the reduced mass matrix [nqu x nqu] obtained after the 2 consecutive reductions (Robotran Basics). More... | |
| int | mbs_Rred (MbsAux *mbs_aux, MbsData *s) |
| Compute the reduced equations of motions on a residual form [nqu x 1]. More... | |
| int | mbs_Rred_core (MbsAux *mbs_aux, MbsData *s) |
| Compute the residual force on independant joints and required force in driven joints. More... | |
| int | mbs_comp_LUdcmp_mJv (MbsData *s, MbsAux *mbs_aux) |
| compute and update (!) the mJv matrix, decomposing it to the LU format mbs_aux->mJv[i][j] = -mbs_aux->Jac[s->hu[i]][s->qv[j]]; return ludcmp(mbs_aux->mJv, s->nqv, mbs_aux->ind_mJv, &d); More... | |
| int | mbs_close_geo (MbsData *s, MbsAux *mbs_aux) |
| compute a position of the multibody system which solves the constraints More... | |
| int | mbs_step_close_geo (MbsData *s, MbsAux *mbs_aux) |
| compute an iteration of the position of the multibody system to solve the constraints More... | |
| int | mbs_anim_close_geo (MbsData *mbs_data, MbsAux *mbs_aux) |
| Generate the animation for failed Newton-Raphson procedure. More... | |
| void | mbs_close_kin (MbsData *s, MbsAux *mbs_aux) |
| compute the dependent velocities that solves the constraints. More... | |
| int | mbs_calc_hJ (MbsData *s, MbsAux *mbs_aux) |
compute the current value of the constraints ( ) and the constraint Jacobian matrix ( ). More... | |
| int | mbs_calc_jdqd (MbsData *s, MbsAux *mbs_aux) |
compute the quadratic term of the constraints at acceleration level: More... | |
| int | mbs_calc_force (MbsData *s) |
| compute the force and torques applied on the multibody system. More... | |
| double * | get_ball_force (MbsData *mbs_data, MbsSensor *sens, int ancestor, int ball_id, double forces_I[3]) |
| Express the force component of a ball constraint in the inertial frame. More... | |
| double * | get_rod_force (MbsData *mbs_data, MbsSensor *sens, int rod_id, int body_1_id, int pt_1_id, int body_2_id, int pt_2_id, double forces_I[3]) |
| Return the forces components of a rod constraints in inertial frame. More... | |
| double * | get_link_force (MbsData *mbs_data, MbsSensor *sens, int link_id, int body_1_id, int pt_1_id, int body_2_id, int pt_2_id, double *trsh, double forces_I[3]) |
| Compute the component of the forces in a link force in the inertial frame. More... | |
| int dirdynared | ( | MbsAux * | mbs_aux, |
| MbsData * | s | ||
| ) |
Compute the joint accelerations of the system in the current configuration.
The current configuration must be considered after the following updates:
| [in,out] | mbs_aux | the local computation structure, where the result is stored in the variable Mr. |
| [in,out] | s | the MbsData of the system, where q(iqv),qd(iqv) and qdd(iqv) are updated. |
MBS_INFO_SUCCESS in case of success, any other value in case of error. | double* get_ball_force | ( | MbsData * | mbs_data, |
| MbsSensor * | sens, | ||
| int | ancestor, | ||
| int | ball_id, | ||
| double | forces_I[3] | ||
| ) |
Express the force component of a ball constraint in the inertial frame.
The function needs that the Lagrangre's multipliers in MbsData::lambda are already computed. They are computed during the computation of the system dynamic.
| [in] | mbs_data | Pointer to the multibody model structure. |
| [out] | sens | Pointer to the sensor available for computation. A new sensor is allocated (and freed) if the provided pointer is NULL. |
| [in] | ancestor | The index of the first common ancestor to the two ball extremities. The base index is 0. |
| [in] | ball_id | Index of the ball cut. |
| [out] | forces_I | The array where to fill the forces components in inertial frame. If NULL a new array is allocated and must be freed by the caller. |
forces_I except if NULL was provided. NULL is returned in case of error. | double* get_link_force | ( | MbsData * | mbs_data, |
| MbsSensor * | sens, | ||
| int | link_id, | ||
| int | body_1_id, | ||
| int | pt_1_id, | ||
| int | body_2_id, | ||
| int | pt_2_id, | ||
| double * | trsh, | ||
| double | forces_I[3] | ||
| ) |
Compute the component of the forces in a link force in the inertial frame.
The function needs that the link force amplitude in MbsData::Fl is already computed. It is computed during the computation of the system dynamic. The sign convention of the link forces are currently:
The computed force is applied at the point pt_2_id located on the body body_2_id.
The components of the force applied on the other point are simply the opposite of the returned force. It can also be obtained by inversing the bodies and points indices.
| [in] | mbs_data | Pointer to the multibody model structure. |
| [out] | sens | Pointer to the sensor available for computation. A new sensor is allocated (and freed) if the provided pointer is NULL. |
| [in] | link_id | The index of the link. |
| [in] | body_1_id | The index of the body with the first extremity of the link. The base is referenced by index 0. |
| [in] | pt_1_id | The index of the anchor point which is the first extremity of the link force. If the extremity is located on a body origin, the index 0 must be provided. |
| [in] | body_2_id | The index of the body with the second extremity of the link. The base is referenced by index 0. The returned force component are applied on this body. |
| [in] | pt_2_id | The index of the anchor point which is the second extremity of the link force. If the extremity is located on a body origin, the index 0 must be provided. The returned force component are applied on this point. |
| [in] | trsh | Pointer to the minimal link length allowed when computed. A default value of 1e-14 is used if NULL is provided. If the lenght of the rod is lower than this value, NULL is returned. |
A pointer to a negative value (ie `trsh[0] < 0) will allow any link length which can lead to division by zero.
| [out] | forces_I | The array where to fill the forces components in inertial frame. It is filled with INFINITY if an error occurs. If NULL a new array is allocated and must be freed by the caller. |
forces_I except if NULL was provided. NULL is returned in case of error. | double* get_rod_force | ( | MbsData * | mbs_data, |
| MbsSensor * | sens, | ||
| int | rod_id, | ||
| int | body_1_id, | ||
| int | pt_1_id, | ||
| int | body_2_id, | ||
| int | pt_2_id, | ||
| double | forces_I[3] | ||
| ) |
Return the forces components of a rod constraints in inertial frame.
The function needs that the Lagrangre's multipliers in MbsData::lambda are already computed. They are computed during the computation of the system dynamic. The sign convention of the Lagrange multiplier assiciate to rod are:
The computed force is applied at the point pt_2_id located on the body body_2_id.
The components of the force applied on the other point are simply the opposite of the returned force. It can also be obtained by inversing the bodies and points indices.
The length of the rod is not required in input as the computation multiply:
| [in] | mbs_data | Pointer to the multibody model structure. |
| [out] | sens | Pointer to the sensor available for computation. A new sensor is allocated (and freed) if the provided pointer is NULL. |
| [in] | rod_id | The index of the rod cut. |
| [in] | body_1_id | The index of the body with the first extremity of the link. The base is referenced by index 0. |
| [in] | pt_1_id | The index of the anchor point which is the first extremity of the link force. If the extremity is located on a body origin, the index 0 must be provided. |
| [in] | body_2_id | The index of the body with the second extremity of the link. The base is referenced by index 0. The returned force component are applied on this body. |
| [in] | pt_2_id | The index of the anchor point which is the second extremity of the link force. If the extremity is located on a body origin, the index 0 must be provided. The returned force component are applied on this point. |
| [out] | forces_I | The array where to fill the forces components in inertial frame. It is filled with INFINITY if an error occurs. If NULL a new array is allocated and must be freed by the caller. |
forces_I except if NULL was provided. NULL is returned in case of error. | int invdynared | ( | MbsAux * | mbs_aux, |
| MbsData * | s | ||
| ) |
Compute the required forces ont the actuated joints in a configuration.
| [in,out] | mbs_aux | the local computation structure, where the result is stored in the variable Mr. |
| [in,out] | s | the MbsData of the system, where q(iqv),qd(iqv) and qdd(iqv) are updated. |
MBS_INFO_SUCCESS in case of success, any other value in case of error. case 1 : UNconstrained system
case 2 : UNconstrained system, fully driven
case 3 : constrained system with u : no actuated driven, overactuation possible
case 4 : constrained fully driven : actionnement sur c ou v
| int mbs_anim_close_geo | ( | MbsData * | mbs_data, |
| MbsAux * | mbs_aux | ||
| ) |
Generate the animation for failed Newton-Raphson procedure.
| [in,out] | mbs_data | the MbsData structure. |
| [in] | mbs_aux | the mbs_aux structure of the failed process. The initial coordinates vector values are stored in MbsAux::q_save. |
| int mbs_calc_force | ( | MbsData * | s | ) |
compute the force and torques applied on the multibody system.
Set the matrices MbsData::frc and MbsData::trq at zero, then compute the contribution of:
| [in,out] | s | the MbsData structure. |
MBS_INFO_SUCCESS if everything went well, <0 if an error has occured | int mbs_calc_hJ | ( | MbsData * | s, |
| MbsAux * | mbs_aux | ||
| ) |
| int mbs_calc_jdqd | ( | MbsData * | s, |
| MbsAux * | mbs_aux | ||
| ) |
| int mbs_close_geo | ( | MbsData * | s, |
| MbsAux * | mbs_aux | ||
| ) |
compute a position of the multibody system which solves the constraints
The algorithm calls a Newton/Raphson procedure which solves the equation:
.
Robotran Basics Eq(17), chapter 3.2.1, pp. 12
| [in,out] | s | the MbsData structure. |
| [in,out] | mbs_aux | the MbsAux structure related to the MbsData structure. |
| void mbs_close_kin | ( | MbsData * | s, |
| MbsAux * | mbs_aux | ||
| ) |
| int mbs_comp_LUdcmp_mJv | ( | MbsData * | s, |
| MbsAux * | mbs_aux | ||
| ) |
compute and update (!) the mJv matrix, decomposing it to the LU format mbs_aux->mJv[i][j] = -mbs_aux->Jac[s->hu[i]][s->qv[j]]; return ludcmp(mbs_aux->mJv, s->nqv, mbs_aux->ind_mJv, &d);
! modify the field mbs_aux->mJv
| [in,out] | s | the MbsData structure. |
| [in,out] | mbs_aux | the MbsAux structure related to the MbsData structure. |
| int mbs_Mred | ( | MbsAux * | mbs_aux, |
| MbsData * | s | ||
| ) |
compute Mr, the reduced mass matrix [nqu x nqu] obtained after the 2 consecutive reductions (Robotran Basics).
necessary for
| [in,out] | mbs_aux | the local computation structure, where the result is stored in the variable Mr. |
| [in,out] | s | the MbsData of the system, where q(iqv),qd(iqv) and qdd(iqv) are updated. |
MBS_INFO_SUCCESS in case of success. | int mbs_Rred | ( | MbsAux * | mbs_aux, |
| MbsData * | s | ||
| ) |
Compute the reduced equations of motions on a residual form [nqu x 1].
This form is oobtained after the 2 consecutive reductions (see theory; for example µ in Robotran Basics). The reduced form of the equations is necessary for:
This function solves the constraints then call the mbs_Rred_core() function.
| [in,out] | mbs_aux | the local computation structure, where the result Rred is stored. |
| [in,out] | s | the MbsData of the system, where q(iqv),qd(iqv) and qdd(iqv) are updated. |
MBS_INFO_SUCCESS in case of success. | int mbs_Rred_core | ( | MbsAux * | mbs_aux, |
| MbsData * | s | ||
| ) |
Compute the residual force on independant joints and required force in driven joints.
This function is the computationnal core of Rred and Invdynared computations.
It requires the invdyna symbolic function.
It requires that all independent joints and all driven joints are up-to-date (coordinates, velocities and accelerations).
It will update the forces applied on the system (internals and externals).
| [in,out] | mbs_aux | The local computation structure, where the result Rred and Qc are stored. |
| [in,out] | s | The MbsData of the system. |
| int mbs_step_close_geo | ( | MbsData * | s, |
| MbsAux * | mbs_aux | ||
| ) |
compute an iteration of the position of the multibody system to solve the constraints
The algorithm is one step of a Newton/Raphson procedure which solves the equation:
.
Robotran Basics Eq(17), chapter 3.2.1, pp. 12
| [in,out] | s | the MbsData structure. |
| [in,out] | mbs_aux | the MbsAux structure related to the MbsData structure. |
1.8.17