Robotran C Documentation
mbs_part.h
Go to the documentation of this file.
1 
2 #ifndef PART_h
3 #define PART_h
4 
5 #include "mbs_data.h"
6 #include "MBSfun.h"
7 
13 typedef struct MbsPartOptions
14 {
15  int rowperm;
16  int visualize;
17  int drivers; // no = 0, yes = 1, defaut = 0
19  int verbose;
20  int clearmbsglobal; // inout = 1, out = 2, none = 3, all = 4, defaut = 1
22 
25 
26 
34 typedef struct MbsPart
35 {
37 
38  int n_qu;
39  int *ind_qu;
40 
41  int n_qv;
42  int *ind_qv;
43 
44  int n_hu;
45  int *ind_hu;
46 
47  int n_hv;
48  int *ind_hv;
49 
50  double *q_closed;
51 
52 } MbsPart;
53 
54 
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
70  int mbs_run_part(MbsPart* mbs_part, MbsData* mbs_data);
71 
79 MbsPart* mbs_new_part(MbsData* mbs_data);
80 
88 void mbs_delete_part(MbsPart* mbs_part);
89 
95 
102 void mbs_delete_part_options(MbsPartOptions* part_option_strct);
103 
104 
108 #ifdef __cplusplus
109 }
110 #endif
111 //void PART_get_options_from_user(MbsPartOptions *options);
112 
113 #endif
mbs_run_part
int mbs_run_part(MbsPart *mbs_part, MbsData *mbs_data)
Main function of the coordinate partitioning module.
Definition: mbs_part.c:494
conc_ivec_0
void conc_ivec_0(int *vec1_src, int l_vec1, int *vec2_src, int l_vec2, int *vec_dest)
concatenate the first (l_v1 sized) vector and the second (l_v2 sized) vectors of integers into the th...
Definition: mbs_1D_array.c:752
MbsData::Ncons
int Ncons
Number of algebraic constraints.
Definition: mbs_data.h:218
MbsPart::n_qv
int n_qv
Number of dependent variable needed.
Definition: mbs_part.h:41
MbsData::DonePart
int DonePart
Flag that indicates if the coordinate partitioning module has been executed (default: 0=not done; 1=d...
Definition: mbs_data.h:293
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
mbs_new_part
MbsPart * mbs_new_part(MbsData *mbs_data)
Allocate a new MbsPart structure for the given MbsData structure.
Definition: mbs_part.c:787
mbs_error_msg
void mbs_error_msg(char *msg,...)
Send an error message.
Definition: mbs_message.c:102
mbs_compute_sin_cos_q_all
void mbs_compute_sin_cos_q_all(MbsData *s)
Compute the sine and cosine of the q_sin and q_cos, for all the rotational joints.
Definition: mbs_trigo.c:94
MbsData::nqv
int nqv
Number of dependent articulations.
Definition: mbs_data.h:170
mbs_data.h
MbsData::qc
int * qc
Array with the indices of driven (locked and driven) articulations.
Definition: mbs_data.h:175
MbsPart::ind_hu
int * ind_hu
Array with the indices of best choice for independent constraints.
Definition: mbs_part.h:45
MbsData::nqu
int nqu
Number of independent articulations.
Definition: mbs_data.h:165
get_dvec_0
double * get_dvec_0(int l_v)
create (with memory allocation) a vector (length l_v) of doubles, starting at index 0
Definition: mbs_1D_array.c:880
MbsData::njoint
int njoint
Number of joints in the system.
Definition: mbs_data.h:162
mbs_project_interface.h
free_ivec_0
void free_ivec_0(int *vec)
release memory for a vector of integers, starting with index 0
Definition: mbs_1D_array.c:415
mbs_Mred
int mbs_Mred(MbsAux *mbs_aux, MbsData *s)
compute Mr, the reduced mass matrix [nqu x nqu] obtained after the 2 consecutive reductions (Robotran...
Definition: mbs_Mred.c:19
free_dmat_0
void free_dmat_0(double **mat)
release memory for a matrix of doubles, starting at index 0
Definition: mbs_matrix.c:293
MbsPart::options
MbsPartOptions * options
Structure containing the options for coordinate partitioning module.
Definition: mbs_part.h:36
f0123_ivec_0
void f0123_ivec_0(int *vec, int l_v)
Fill the (l_v sized) vector of integers as [0 1 2 3 ... l_v-1], starting with index 0.
Definition: mbs_1D_array.c:742
mbs_run_part
int mbs_run_part(MbsPart *mbs_part, MbsData *mbs_data)
Main function of the coordinate partitioning module.
Definition: mbs_part.c:494
frand
double frand(void)
Definition: mbs_part.c:137
mbs_new_part_options
MbsPartOptions * mbs_new_part_options(void)
Allocate a new MbsPartOptions structure and intialize options with default values.
Definition: mbs_part.c:766
_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
MbsPartOptions::visualize
int visualize
In case of loop closure failing, set to 1 to plot the closing procedure iteration,...
Definition: mbs_part.h:16
mbs_linalg.h
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
MbsPartOptions::clearmbsglobal
int clearmbsglobal
Definition: mbs_part.h:20
mbs_check_nhu_nqv
int mbs_check_nhu_nqv(MbsData *mbs_data)
Check the coherence between the number of (independant) constraints and the number of dependant varia...
Definition: mbs_check.c:19
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
get_dmat_0
double ** get_dmat_0(int nb_r, int nb_c)
create (with memory allocation) a [nb_r times nb_c] matrix of doubles, starting at index 0
Definition: mbs_matrix.c:238
MbsPart::n_hv
int n_hv
Number of redundant constraint.
Definition: mbs_part.h:47
slct_ivec_0
int slct_ivec_0(int *vec_src, int l_vec1, int *vec_ind_src, int l_vec2, int *vec_dest)
fill the third (l_v2 sized) vector by slicing the first (l_v1 sized) vector of integers at the indexe...
Definition: mbs_1D_array.c:783
get_ivec_1
int * get_ivec_1(int l_v)
create (with memory allocation) a vector (length l_v) of integers, starting at index 1
Definition: mbs_1D_array.c:404
mbs_delete_part_options
void mbs_delete_part_options(MbsPartOptions *part_option_strct)
Free the memory of the given MbsPartOptions structure.
Definition: mbs_part.c:782
copy_ivec_1
void copy_ivec_1(int *vec_src, int *vec_dest, int l_v)
Copy the content of a vector (of size l_v) of integers to a second vector, starting with index 1.
Definition: mbs_1D_array.c:435
MbsPart
Main structure for the coordinate partitioning module.
Definition: mbs_part.h:34
_MBS_ERR_MOD_PART
#define _MBS_ERR_MOD_PART
Module error number module: Partionning = -100.
Definition: mbs_errors_names.h:43
slct_dmat_0
int slct_dmat_0(double **tab_src, int nb_r1, int nb_c1, double **tab_out, int l2, int *vec)
fill the second [nb_r times l_vec] matrix by selecting the columns of the first [nb_r times nb_c] mat...
Definition: mbs_matrix.c:710
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
MbsData::Nuserc
int Nuserc
Number of user constraints.
Definition: mbs_data.h:219
MbsData::qu
int * qu
Array with the indices of the independent articulations (free)
Definition: mbs_data.h:174
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::Nloopc
int Nloopc
Number of loop constraints.
Definition: mbs_data.h:217
PART_calc_hJ
void PART_calc_hJ(MbsData *mbs_data, double *h, double **J)
Compute the current constraint error vector and its Jacobian.
Definition: mbs_part.c:149
freeMbsAux
void freeMbsAux(MbsAux *mbs_aux, MbsData *s)
Definition: mbs_aux.c:174
MbsData::q
double * q
Array with the current values of the generalized coordinates.
Definition: mbs_data.h:187
mbs_delete_part
void mbs_delete_part(MbsPart *mbs_part)
Free the memory of the given MbsPart structure.
Definition: mbs_part.c:812
free_dvec_1
void free_dvec_1(double *vec)
release memory for a vector of doubles, starting at index 1
Definition: mbs_1D_array.c:901
_MBS_ERR_MOD_SPEC_12
#define _MBS_ERR_MOD_SPEC_12
Generic error number Module specific errors range from -11 to -19 please read the error message a...
Definition: mbs_errors_names.h:168
MbsPartOptions::verbose
int verbose
1 to get print indications related partitioning module; 0 otherwise, defaut = 1
Definition: mbs_part.h:19
MbsPart::q_closed
double * q_closed
Array with the generalized coordinate in closed configuration (constraints solved)
Definition: mbs_part.h:50
mbs_trigo.h
This header defines the functions for trigonometric handling in MBsysC integrator in C.
PART_vec_perm
void PART_vec_perm(int *a, int *ipm, int irk)
Definition: mbs_part.c:15
nrfct.h
PART_coord_part
int PART_coord_part(MbsData *mbs_data, MbsPart *mbs_part, int *ind_u_des, int n_u_des, int *ind_c, int n_c, int first_partitioning)
Definition: mbs_part.c:190
user_cons_hJ
void user_cons_hJ(double *h, double **Jac, MbsData *mbs_data, double tsim)
Definition: user_cons_hJ.c:15
MbsData::nqc
int nqc
Number of driven articulations, it includes qlocked and qdriven.
Definition: mbs_data.h:166
mbs_message.h
MbsPart::n_qu
int n_qu
Number of independent variable needed.
Definition: mbs_part.h:38
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
initMbsAux
MbsAux * initMbsAux(MbsData *s)
Definition: mbs_aux.c:18
get_ivec_0
int * get_ivec_0(int l_v)
create (with memory allocation) a vector (length l_v) of integers, starting at index 0
Definition: mbs_1D_array.c:399
mbs_new_part_options
MbsPartOptions * mbs_new_part_options(void)
Allocate a new MbsPartOptions structure and intialize options with default values.
Definition: mbs_part.c:766
MbsData
Definition: mbs_data.h:149
mbs_new_part
MbsPart * mbs_new_part(MbsData *mbs_data)
Allocate a new MbsPart structure for the given MbsData structure.
Definition: mbs_part.c:787
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
mbs_delete_part
void mbs_delete_part(MbsPart *mbs_part)
Free the memory of the given MbsPart structure.
Definition: mbs_part.c:812
free_ivec_1
void free_ivec_1(int *vec)
release memory for a vector of integers, starting with index 1
Definition: mbs_1D_array.c:420
MbsPart::ind_qu
int * ind_qu
Array with the indices of best choice for independent variables.
Definition: mbs_part.h:39
MbsPartOptions
Structure defining the options of the coordinate partitioning module.
Definition: mbs_part.h:13
copy_ivec_0
void copy_ivec_0(int *vec_src, int *vec_dest, int l_v)
Copy the content of a vector(of size l_v) of integers to a second vector, starting with index 0.
Definition: mbs_1D_array.c:425
MbsPartOptions::random_amplitude
double random_amplitude
Amplitude of the random troubleshoot added to the initial value of generalized coordinates.
Definition: mbs_part.h:21
get_dvec_1
double * get_dvec_1(int l_v)
create (with memory allocation) a vector (length l_v) of doubles, starting at index 1
Definition: mbs_1D_array.c:885
MbsPart::ind_hv
int * ind_hv
Array with the indices of best choice for redundant constraints.
Definition: mbs_part.h:48
free_dmat_1
void free_dmat_1(double **mat)
release memory for a matrix of doubles, starting at index 1
Definition: mbs_matrix.c:301
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
MbsPartOptions::rowperm
int rowperm
1 to allow line permutation; 0 otherwise, defaut = 0
Definition: mbs_part.h:15
free_dvec_0
void free_dvec_0(double *vec)
release memory for a vector of doubles, starting at index 0
Definition: mbs_1D_array.c:896
PART_lutot
void PART_lutot(double **a, int nl, int nc, int rowperm, int *irk, int *ierr, int *row_perm, int *col_perm)
Definition: mbs_part.c:31
sort_ivec_0
void sort_ivec_0(int *vec_src, int *vec_dest, int l_v)
sort the first (l_v sized) vector of integers into the second vector, starting with index 0
Definition: mbs_1D_array.c:616
MbsPartOptions::drivers
int drivers
Definition: mbs_part.h:18
get_dmat_1
double ** get_dmat_1(int nb_r, int nb_c)
create (with memory allocation) a [nb_r times nb_c] matrix of doubles, starting at index 1
Definition: mbs_matrix.c:255
mbs_delete_part_options
void mbs_delete_part_options(MbsPartOptions *opt)
Free the memory of the given MbsPartOptions structure.
Definition: mbs_part.c:782
MbsPart::n_hu
int n_hu
Number of independent constraint.
Definition: mbs_part.h:44
mbs_check.h
mbs_rank_0
int mbs_rank_0(double **A, int m, int n)
Compute the rank of matrix_in.
Definition: rank_lapack.c:38
MbsPart::ind_qv
int * ind_qv
Array with the indices of best choice and order for dependent variables.
Definition: mbs_part.h:42
print_ivec_0
void print_ivec_0(int *vec, int l_v)
print a (l_v sized) vector of integers in console, starting with index 0
Definition: mbs_1D_array.c:494
mbs_part.h
MbsData::nhu
int nhu
Number of independent constraints.
Definition: mbs_data.h:171
_MBS_ERR_MID_CLOSE_GEO
#define _MBS_ERR_MID_CLOSE_GEO
Mid Level error number Related to the closing geometry, i.e.
Definition: mbs_errors_names.h:87
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