mbs_sensor2.h
Go to the documentation of this file.
1 //---------------------------
2 // UCL-CEREM-MBS
3 //
4 // @version MBsysLab_s 1.7.a
5 //
6 // Creation : 2006
7 // Last update : 01/10/2008
8 //---------------------------
9 //
10 // Gestion via Bugzilla :
11 // 01/10/2008 : JFC : Bug n°38
12 //
13 
14 #pragma once
15 /*--------------------*/
16 
17 typedef struct MbsSensor
18 {
19  double P[4]; ///< Position vector of the sensor expressed in the inertial frame: \f$P(1:3)=[P_x; P_y; P_z]\f$.
20  double R[4][4]; ///< Rotation matrix from the inertial frame to the sensor frame: \f$[\hat{\mathbf{X}}^S]=R(1:3,1:3).[\hat{\mathbf{X}}^0]\f$
21  double V[4]; ///< Velocity vector of the sensor expressed in the inertial frame: \f$V(1:3)=[V_x; V_y; V_z]\f$.
22  double OM[4]; ///< Angular velocity vector of the sensor expressed in the inertial frame: \f$OM(1:3)=[\omega_x; \omega_y; \omega_z]\f$.
23  double A[4]; ///< Acceleration vector of the sensor expressed in the inertial frame: \f$A(1:3)=[A_x; A_y; A_z]\f$.
24  double OMP[4]; ///< Angular acceleration vector of the sensor expressed in the inertial frame: \f$OMP(1:3)=[\dot\omega_x; \dot\omega_y; \dot\omega_z]\f$.
25  /**
26  * Jacobian matrix of the sensor:
27  * \f$J(1:njoint,1:6)=\left[ \frac{\partial V}{\partial \dot q^T} \quad \frac{\partial OM}{\partial \dot q^T} \right]^\top \f$
28  */
29  double* J[7];
30 
31  /**/
32 } MbsSensor;
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 /*!
38  * \brief Allocate the Jacobian matrix of the MbsSensor according to the number of joints in the multibody system.
39  * \param[in,out] psens Pointer to the MbsSensor structure to modify.
40  * \param[in] njoint Number of joint in the MBS, see MbsData::njoint.
41  */
42 void allocate_sensor(MbsSensor* psens, int njoint);
43 
44 /*!
45  * \brief Initialize all fields of MbsSensor structure to 0.
46  * \param[in,out] psens Pointer to the MbsSensor structure to initialize.
47  * \param[in] njoint Number of joint in the MBS, see MbsData::njoint.
48  */
49 void init_sensor(MbsSensor* psens, int njoint);
50 
51 /*!
52  * \brief Free the memory of MbsSensor structure.
53  * \param[in,out] psens Pointer to the MbsSensor structure to be freed.
54  */
55 void free_sensor(MbsSensor* psens);
56 
57 #ifdef __cplusplus
58 }
59 #endif
60 
MbsSensor::V
double V[4]
Velocity vector of the sensor expressed in the inertial frame: .
Definition: mbs_sensor2.h:21
MbsSensor::OMP
double OMP[4]
Angular acceleration vector of the sensor expressed in the inertial frame: .
Definition: mbs_sensor2.h:24
allocate_sensor
void allocate_sensor(MbsSensor *psens, int njoint)
Allocate the Jacobian matrix of the MbsSensor according to the number of joints in the multibody syst...
Definition: mbs_sensor.c:14
init_sensor
void init_sensor(MbsSensor *psens, int njoint)
Initialize all fields of MbsSensor structure to 0.
Definition: mbs_sensor.c:25
MbsSensor::J
double * J[7]
Jacobian matrix of the sensor: .
Definition: mbs_sensor2.h:29
MbsSensor::P
double P[4]
Position vector of the sensor expressed in the inertial frame: .
Definition: mbs_sensor2.h:19
free_sensor
void free_sensor(MbsSensor *psens)
Free the memory of MbsSensor structure.
Definition: mbs_sensor.c:49
MbsSensor
struct MbsSensor MbsSensor
MbsSensor::OM
double OM[4]
Angular velocity vector of the sensor expressed in the inertial frame: .
Definition: mbs_sensor2.h:22
MbsSensor
Definition: mbs_sensor2.h:17
MbsSensor::R
double R[4][4]
Rotation matrix from the inertial frame to the sensor frame: .
Definition: mbs_sensor2.h:20
MbsSensor::A
double A[4]
Acceleration vector of the sensor expressed in the inertial frame: .
Definition: mbs_sensor2.h:23