Robotran C Documentation
Functions
user_ExtForces.c File Reference
#include "math.h"
#include "mbs_data.h"
#include "mbs_project_interface.h"

Functions

double * user_ExtForces (double PxF[4], double RxF[4][4], double VxF[4], double OMxF[4], double AxF[4], double OMPxF[4], MbsData *mbs_data, double tsim, int ixF)
 Compute an user-specified external force. More...
 

Function Documentation

◆ user_ExtForces()

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.

Parameters
[in]PxFposition vector (index starting at 1) of the force sensor expressed in the inertial frame: $PxF(1:3)=[P_x; P_y; P_z]$.
[in]RxFrotation matrix (index starting at 1) from the inertial frame to the force sensor frame: $[\hat{\mathbf{X}}^S]=RxF(1:3,1:3).[\hat{\mathbf{X}}^0]$
[in]VxFvelocity vector (index starting at 1) of the force sensor expressed in the inertial frame: $VxF(1:3)=[V_x; V_y; V_z]$.
[in]OMxFangular velocity vector (index starting at 1) of the force sensor expressed in the inertial frame: $OMxF(1:3)=[\omega_x; \omega_y; \omega_z]$.
[in]AxFacceleration vector (index starting at 1) of the force sensor expressed in the inertial frame: $AxF(1:3)=[A_x; A_y; A_z]$.
[in]OMPxFangular acceleration vector (index starting at 1) of the force sensor expressed in the inertial frame: $OMPxF(1:3)=[\dot\omega_x; \dot\omega_y; \dot\omega_z]$.
[in,out]sthe MbsData structure of the model on which the force is computed.
[in]tsimthe current time of the simulation
[in]ixFthe ID identifying the computed force sensor.
Returns
A vector (of size 9, index starting at 1) with the content described for MbsData::SWr

The content of the returned vector Swr is [Fx; Fy; Fz; Mx; My; Mz; dxF]:

  • Force components (expressed in the inertial frame) : Fx, Fy, Fz
  • Pure torque components (expressed in the inertial frame) : Mx, My, Mz
  • Application point local coordinates vector (expressed in the body-fixed frame): dxF(1:3,1)