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 
18 typedef struct MbsSensor
19 {
20  double P
21  [4]; ///< Position vector of the sensor expressed in the inertial frame: \f$P(1:3)=[P_x; P_y; P_z]\f$.
22  double R
23  [4]
24  [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$
25  double V
26  [4]; ///< Velocity vector of the sensor expressed in the inertial frame: \f$V(1:3)=[V_x; V_y; V_z]\f$.
27  double OM
28  [4]; ///< Angular velocity vector of the sensor expressed in the inertial frame: \f$OM(1:3)=[\omega_x; \omega_y; \omega_z]\f$.
29  double A
30  [4]; ///< Acceleration vector of the sensor expressed in the inertial frame: \f$A(1:3)=[A_x; A_y; A_z]\f$.
31  double OMP
32  [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$.
33  /**
34  * Jacobian matrix of the sensor:
35  * \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$
36  */
37  double* J[7];
38 
39  /**/
40 } MbsSensor;
41 
42 #ifdef __cplusplus
43 extern "C"
44 {
45 #endif
46  /*!
47  * \brief Allocate the Jacobian matrix of the MbsSensor according to the number of joints in the multibody system.
48  * \param[in,out] psens Pointer to the MbsSensor structure to modify.
49  * \param[in] njoint Number of joint in the MBS, see MbsData::njoint.
50  */
51  void allocate_sensor(MbsSensor* psens, int njoint);
52 
53  /*!
54  * \brief Initialize all fields of MbsSensor structure to 0.
55  * \param[in,out] psens Pointer to the MbsSensor structure to initialize.
56  * \param[in] njoint Number of joint in the MBS, see MbsData::njoint.
57  */
58  void init_sensor(MbsSensor* psens, int njoint);
59 
60  /*!
61  * \brief Free the memory of MbsSensor structure.
62  * \param[in,out] psens Pointer to the MbsSensor structure to be freed.
63  */
64  void free_sensor(MbsSensor* psens);
65 
66 #ifdef __cplusplus
67 }
68 #endif
MbsSensor::V
double V[4]
Velocity vector of the sensor expressed in the inertial frame: .
Definition: mbs_sensor2.h:26
MbsSensor::OMP
double OMP[4]
Angular acceleration vector of the sensor expressed in the inertial frame: .
Definition: mbs_sensor2.h:32
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:37
MbsSensor::P
double P[4]
Position vector of the sensor expressed in the inertial frame: .
Definition: mbs_sensor2.h:21
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:28
MbsSensor
Definition: mbs_sensor2.h:18
MbsSensor::R
double R[4][4]
Rotation matrix from the inertial frame to the sensor frame: .
Definition: mbs_sensor2.h:24
MbsSensor::A
double A[4]
Acceleration vector of the sensor expressed in the inertial frame: .
Definition: mbs_sensor2.h:30