Robotran C Documentation
mbs_sensor.h
Go to the documentation of this file.
1 #ifndef _SENSOR_UTILITIES_H
2 #define _SENSOR_UTILITIES_H
3 
4 #include "mbs_sensor_struct.h"
5 
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9 
10 // forward declaration
11 struct MbsData;
12 
18 void allocate_sensor(MbsSensor *psens, int njoint);
19 
25 void init_sensor(MbsSensor *psens, int njoint);
26 
33 void free_sensor(MbsSensor *psens);
34 
35 
41 MbsSensor* mbs_new_sensor(struct MbsData* mbs_data);
42 
50 void mbs_delete_sensor(MbsSensor *psens);
51 
52 
59 void mbs_comp_F_sensor(MbsSensor *psens, struct MbsData *mbs_data, int isens);
60 
67 void mbs_comp_S_sensor(MbsSensor *psens, struct MbsData *mbs_data, int isens);
68 
75 void mbs_comp_gen_sensor(MbsSensor *psens, struct MbsData *mbs_data, int joint_id);
76 
77 #ifdef __cplusplus
78 }
79 #endif
80 
81 #endif
mbs_Rred
int mbs_Rred(MbsAux *mbs_aux, MbsData *s)
compute Rred, the reduced equations of motions on a residual form [nqu x 1] obtained after the 2 cons...
Definition: mbs_Rred.c:20
user_equil_finish
void user_equil_finish(MbsData *mbs_data, MbsEquil *mbs_equil)
user own finishing functions
Definition: mbs_project_fct_ptr.c:149
MbsData::Ncons
int Ncons
Number of algebraic constraints.
Definition: mbs_data.h:218
user_dirdyn_loop
void user_dirdyn_loop(MbsData *mbs_data, MbsDirdyn *mbs_dd)
user own loop functions
Definition: mbs_project_fct_ptr.c:117
user_invdyn_init
void user_invdyn_init(MbsData *mbs_data, MbsInvdyn *mbs_invd)
Definition: mbs_project_fct_ptr.c:127
MbsInvdyn
General structure of the inverse dynamics module.
Definition: mbs_invdyn_struct.h:27
Functions::mbs_cons_hJ
mbs_cons_hJ_ptr mbs_cons_hJ
Definition: mbs_data.h:76
user_DrivenJoints
void user_DrivenJoints(MbsData *s, double tsim)
Compute the positions, velocities and acceleration of driven joint.
Definition: mbs_project_fct_ptr.c:95
Functions::user_equil_finish
user_equil_finish_ptr user_equil_finish
Definition: mbs_data.h:99
MbsData::tsim
double tsim
The time value.
Definition: mbs_data.h:208
MbsData::nqrot
int nqrot
Number of rotational joint (R1, R2 or R3)
Definition: mbs_data.h:172
user_equil_init
void user_equil_init(MbsData *mbs_data, MbsEquil *mbs_equil)
user own initialization functions
Definition: mbs_project_fct_ptr.c:141
MbsData::nqv
int nqv
Number of dependent articulations.
Definition: mbs_data.h:170
Functions::mbs_link
mbs_link_ptr mbs_link
Definition: mbs_data.h:70
mbs_data.h
MbsData::qc
int * qc
Array with the indices of driven (locked and driven) articulations.
Definition: mbs_data.h:175
Functions::mbs_invdyna
mbs_invdyna_ptr mbs_invdyna
Definition: mbs_data.h:75
MbsData::nqu
int nqu
Number of independent articulations.
Definition: mbs_data.h:165
user_JointForces
double * user_JointForces(MbsData *s, double tsim)
Compute the user-specified joint force in all joint.
Definition: mbs_project_fct_ptr.c:69
lubksb
void lubksb(double **a, int n, int *indx, double b[])
Definition: lubksb.c:10
mbs_new_sensor
MbsSensor * mbs_new_sensor(struct MbsData *mbs_data)
Create a new MbsSensor structure, allocate and initialize the memory for all fields.
Definition: mbs_sensor_utilities.c:50
MbsData::njoint
int njoint
Number of joints in the system.
Definition: mbs_data.h:162
mbs_project_interface.h
Functions::symb
struct Functions::@7 symb
Functions::user_equil_init
user_equil_init_ptr user_equil_init
Definition: mbs_data.h:97
Functions::user_dirdyn_init
user_dirdyn_init_ptr user_dirdyn_init
Definition: mbs_data.h:89
Functions::user_equil_loop
user_equil_loop_ptr user_equil_loop
Definition: mbs_data.h:98
Functions::user_dirdyn_loop
user_dirdyn_loop_ptr user_dirdyn_loop
Definition: mbs_data.h:90
Functions::user_invdyn_finish
user_invdyn_finish_ptr user_invdyn_finish
Definition: mbs_data.h:95
ludcmp
int ludcmp(double **a, int n, int *indx, double *d)
LU decomposition of a matrix with index starting at 1.
Definition: ludcmp.c:19
Functions::user_ExtForces
user_ExtForces_ptr user_ExtForces
Definition: mbs_data.h:109
Functions::mbs_dirdyna
mbs_dirdyna_ptr mbs_dirdyna
Definition: mbs_data.h:74
mbs_cons_jdqd
void mbs_cons_jdqd(double *Jdqd, MbsData *s, double tsim)
Definition: mbs_project_fct_ptr.c:52
_MBS_ERR_LOW_NAN
#define _MBS_ERR_LOW_NAN
Low Level error number Number is NaN (not a number) = -7.
Definition: mbs_errors_names.h:142
MbsData::flag_optim_symb_sin_cos
int flag_optim_symb_sin_cos
allow the "optimisation" of the computation of the sine/cosine in the symbolic files....
Definition: mbs_data.h:198
MBSfun.h
mbs_close_kin
void mbs_close_kin(MbsData *s, MbsAux *mbs_aux)
compute the dependent velocities that solves the constraints.
Definition: mbs_close_loops.c:140
Functions::mbs_link3D
mbs_link3D_ptr mbs_link3D
Definition: mbs_data.h:71
Functions::user_Link3DForces
user_Link3DForces_ptr user_Link3DForces
Definition: mbs_data.h:108
MbsData::hu
int * hu
Array with the indices of independent constraints.
Definition: mbs_data.h:183
mbs_dirdyna
void mbs_dirdyna(double **M, double *c, MbsData *s, double tsim)
Definition: mbs_project_fct_ptr.c:40
mbs_sensor_struct.h
user_dirdyn_init
void user_dirdyn_init(MbsData *mbs_data, MbsDirdyn *mbs_dd)
user own initialization functions
Definition: mbs_project_fct_ptr.c:113
user_LinkForces
double user_LinkForces(double Z, double Zd, MbsData *s, double tsim, int ilnk)
Compute the value of a link forces.
Definition: mbs_project_fct_ptr.c:80
MbsEquil
Definition: mbs_equil_struct.h:68
user_cons_hJ
void user_cons_hJ(double *h, double **Jac, MbsData *s, double tsim)
Definition: mbs_project_fct_ptr.c:99
MbsData::flag_safety_checks
int flag_safety_checks
Flag to activate safety checks everywhere in mbsysc core. Faster computation if this flag is put to 0...
Definition: mbs_data.h:307
mbs_msg
void mbs_msg(char *msg,...)
Send a message.
Definition: mbs_message.c:76
mbs_gensensor
void mbs_gensensor(MbsSensor *sens, MbsData *s, int isens)
Definition: mbs_project_fct_ptr.c:60
mbs_accelred
int mbs_accelred(MbsData *s, double tsim)
Definition: mbs_project_fct_ptr.c:36
Functions::mbs_sensor
mbs_sensor_ptr mbs_sensor
Definition: mbs_data.h:78
user_dirdyn_finish
void user_dirdyn_finish(MbsData *mbs_data, MbsDirdyn *mbs_dd)
user own finishing functions
Definition: mbs_project_fct_ptr.c:121
Functions::user_equil_fxe
user_equil_fxe_ptr user_equil_fxe
Definition: mbs_data.h:100
user_invdyn_finish
void user_invdyn_finish(MbsData *mbs_data, MbsInvdyn *mbs_invd)
Definition: mbs_project_fct_ptr.c:135
_MBS_ERR_MID_RRED
#define _MBS_ERR_MID_RRED
Mid Level error number Related to the computation of the Rred matrix.
Definition: mbs_errors_names.h:102
MbsData::qu
int * qu
Array with the indices of the independent articulations (free)
Definition: mbs_data.h:174
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.
Definition: mbs_project_fct_ptr.c:84
MbsData::qv
int * qv
Array with the indices of the dependent articulations .
Definition: mbs_data.h:182
mbs_cons_hJ
void mbs_cons_hJ(double *h, double **Jac, MbsData *s, double tsim)
Definition: mbs_project_fct_ptr.c:48
MbsData::Qc
double * Qc
Array with the value of joint force introduced in driven joint to respect the user function.
Definition: mbs_data.h:233
mbs_invdyna
void mbs_invdyna(double *Q, MbsData *s, double tsim)
Definition: mbs_project_fct_ptr.c:44
Functions::mbs_extforces
mbs_extforces_ptr mbs_extforces
Definition: mbs_data.h:72
Functions::user_cons_hJ
user_cons_hJ_ptr user_cons_hJ
Definition: mbs_data.h:104
Functions::user_LinkForces
user_LinkForces_ptr user_LinkForces
Definition: mbs_data.h:107
MbsData::Qq
double * Qq
Array with the values of the joint forces.
Definition: mbs_data.h:204
user_cons_jdqd
void user_cons_jdqd(double *jdqd, MbsData *s, double tsim)
Definition: mbs_project_fct_ptr.c:103
user_Derivative
void user_Derivative(MbsData *s)
Definition: mbs_project_fct_ptr.c:91
mbs_trigo.h
This header defines the functions for trigonometric handling in MBsysC integrator in C.
MbsData::fct
Functions fct
Structure to store the pointer to the project-specific functions.
Definition: mbs_data.h:316
Functions::user_Derivative
user_Derivative_ptr user_Derivative
Definition: mbs_data.h:102
user_equil_loop
void user_equil_loop(MbsData *mbs_data, MbsEquil *mbs_equil)
user own loop functions
Definition: mbs_project_fct_ptr.c:145
nrfct.h
Functions::user_invdyn_loop
user_invdyn_loop_ptr user_invdyn_loop
Definition: mbs_data.h:94
init_sensor
void init_sensor(MbsSensor *psens, int njoint)
Initialize all fields of MbsSensor structure to 0.
Definition: mbs_sensor_utilities.c:22
mbs_comp_gen_sensor
void mbs_comp_gen_sensor(MbsSensor *psens, struct MbsData *mbs_data, int joint_id)
Compute all fields of a sensor located on the specified joint.
Definition: mbs_sensor_utilities.c:76
mbs_calc_force
int mbs_calc_force(MbsData *s)
compute the force and torques applied on the multibody system.
Definition: mbs_calc_force.c:13
MbsData::nqc
int nqc
Number of driven articulations, it includes qlocked and qdriven.
Definition: mbs_data.h:166
mbs_message.h
mbs_close_geo
int mbs_close_geo(MbsData *s, MbsAux *mbs_aux)
compute a position of the multibody system which solves the constraints
Definition: mbs_close_loops.c:43
Functions::mbs_accelred
mbs_accelred_ptr mbs_accelred
Definition: mbs_data.h:73
mbs_calc_jdqd
void mbs_calc_jdqd(MbsData *s, MbsAux *mbs_aux)
compute the quadratic term of the constraints at acceleration level:
Definition: mbs_close_loops.c:216
mbs_extforces
void mbs_extforces(double **frc, double **trq, MbsData *s, double tsim)
Definition: mbs_project_fct_ptr.c:32
mbs_comp_S_sensor
void mbs_comp_S_sensor(MbsSensor *psens, struct MbsData *mbs_data, int isens)
Compute all fields of the specified sensor.
Definition: mbs_sensor_utilities.c:66
MbsData
Definition: mbs_data.h:149
Functions::mbs_gensensor
mbs_gensensor_ptr mbs_gensensor
Definition: mbs_data.h:79
Functions::user_cons_J_accelred
user_cons_J_accelred_ptr user_cons_J_accelred
Definition: mbs_data.h:106
Functions::user
struct Functions::@8 user
mbs_compute_sin_cos_quc
void mbs_compute_sin_cos_quc(MbsData *s, int *qrot_qu_indvec, int *qrot_qc_indvec)
Compute the sine and cosine of the q_sin and q_cos, only for the rotational joints that are independe...
Definition: mbs_trigo.c:65
user_equil_fxe
void user_equil_fxe(MbsData *mbs_data, double *f)
user own implementation of added equilibrium equations Fxe Necessary to express equilibrium f(x)=0
Definition: mbs_project_fct_ptr.c:153
MbsSensor
Definition: mbs_sensor_struct.h:18
user_cons_J_accelred
void 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 con...
Definition: mbs_project_fct_ptr.c:107
mbs_sensor
void mbs_sensor(MbsSensor *sens, MbsData *s, int isens)
Compute all fields of a sensor (force sensor or classic sensor).
Definition: mbs_project_fct_ptr.c:56
Functions::user_cons_jdqd
user_cons_jdqd_ptr user_cons_jdqd
Definition: mbs_data.h:105
Functions::user_DrivenJoints
user_DrivenJoints_ptr user_DrivenJoints
Definition: mbs_data.h:103
Functions::user_invdyn_init
user_invdyn_init_ptr user_invdyn_init
Definition: mbs_data.h:93
mbs_link
void mbs_link(double **frc, double **trq, double *Flnk, double *Z, double *Zd, MbsData *s, double tsim)
Definition: mbs_project_fct_ptr.c: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_utilities.c:17
free_sensor
void free_sensor(MbsSensor *psens)
Deprecated: Free the memory inside MbsSensor structure. i.e. free the space allocated for the jacobia...
Definition: mbs_sensor_utilities.c:44
copy_dvec_0
void copy_dvec_0(double *vec_src, double *vec_dest, int l_v)
Copy the content of a vector (of sizel_v) of doubles to a second vector, starting with index 0.
Definition: mbs_1D_array.c:906
slct_dvec_1
void slct_dvec_1(double *vec_src, int *vec_ind_src, int l_v, double *vec_dest)
fill the third vector by slicing the first vector of doubles at the indexes specified in the second (...
Definition: mbs_1D_array.c:1248
pick_and_place_dvec_1
void pick_and_place_dvec_1(double *src, int *index, int n, double *dest)
Pick the values from an array and set them in the destination array at the specified index.
Definition: mbs_1D_array.c:1230
MbsData::lambda
double * lambda
Array with the values of the Lagrange Multipliers related to the constraints.
Definition: mbs_data.h:222
MbsDirdyn
General structure of the direct dynamic module.
Definition: mbs_dirdyn_struct.h:144
mbs_link3D
void mbs_link3D(double **frc, double **trq, MbsData *s, double tsim)
Definition: mbs_project_fct_ptr.c:28
MbsData::qdd
double * qdd
Array with the current values of the generalized acceleration.
Definition: mbs_data.h:189
Functions::mbs_cons_jdqd
mbs_cons_jdqd_ptr mbs_cons_jdqd
Definition: mbs_data.h:77
mbs_comp_F_sensor
void mbs_comp_F_sensor(MbsSensor *psens, struct MbsData *mbs_data, int isens)
Compute all fields of the specified force sensor.
Definition: mbs_sensor_utilities.c:71
mbs_Rred_core
int mbs_Rred_core(MbsAux *mbs_aux, MbsData *s)
Compute the residual force on independant joints and required force in driven joints.
Definition: mbs_Rred.c:35
mbs_delete_sensor
void mbs_delete_sensor(MbsSensor *psens)
Free the memory of MbsSensor structure. and its contents.
Definition: mbs_sensor_utilities.c:57
user_invdyn_loop
void user_invdyn_loop(MbsData *mbs_data, MbsInvdyn *mbs_invd)
Definition: mbs_project_fct_ptr.c:131
user_Link3DForces
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.
Definition: mbs_project_fct_ptr.c:73
Functions::user_JointForces
user_JointForces_ptr user_JointForces
Definition: mbs_data.h:84
MbsData::nhu
int nhu
Number of independent constraints.
Definition: mbs_data.h:171
user_DrivenJoints
void user_DrivenJoints(MbsData *mbs_data, double tsim)
Compute the positions, velocities and acceleration of driven joint.
Definition: user_DrivenJoints.c:15
mbs_errors_names.h
Functions::user_dirdyn_finish
user_dirdyn_finish_ptr user_dirdyn_finish
Definition: mbs_data.h:91