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 {
18  int rowperm;
22  int visualize;
26  int drivers;
31  int verbose;
52  unsigned int set_seed;
53 
55 
56 
64 typedef struct MbsPart
65 {
67 
68  int n_qu;
69  int *ind_qu;
70 
71  int n_qv;
72  int *ind_qv;
73 
74  int n_hu;
75  int *ind_hu;
76 
77  int n_hv;
78  int *ind_hv;
79 
80  double *q_closed;
81 
82 } MbsPart;
83 
84 
85 
86 #ifdef __cplusplus
87 extern "C" {
88 #endif
89 
100  int mbs_run_part(MbsPart* mbs_part, MbsData* mbs_data);
101 
109 MbsPart* mbs_new_part(MbsData* mbs_data);
110 
118 void mbs_delete_part(MbsPart* mbs_part);
119 
125 
132 void mbs_delete_part_options(MbsPartOptions* part_option_strct);
133 
134 
138 #ifdef __cplusplus
139 }
140 #endif
141 //void PART_get_options_from_user(MbsPartOptions *options);
142 
143 #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:532
mbs_msg
void mbs_msg(const char *msg,...)
Send a message.
Definition: mbs_message.c:87
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:827
MbsData::Ncons
int Ncons
Number of algebraic constraints.
Definition: mbs_data.h:317
MbsPart::n_qv
int n_qv
Number of dependent variable needed.
Definition: mbs_part.h:71
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:392
MbsData::tsim
double tsim
The time value.
Definition: mbs_data.h:305
MbsData::nqrot
int nqrot
Number of rotational joint (R1, R2 or R3)
Definition: mbs_data.h:269
mbs_new_part
MbsPart * mbs_new_part(MbsData *mbs_data)
Allocate a new MbsPart structure for the given MbsData structure.
Definition: mbs_part.c:868
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:267
MbsPartOptions::random_amplitude_rank
double random_amplitude_rank
Amplitude of the random troubleshoot of generalized coordinates for rank.
Definition: mbs_part.h:39
mbs_data.h
MbsData::qc
int * qc
Array with the indices of driven (locked and driven) articulations.
Definition: mbs_data.h:272
MbsPart::ind_hu
int * ind_hu
Array with the indices of best choice for independent constraints.
Definition: mbs_part.h:75
MbsData::nqu
int nqu
Number of independent articulations.
Definition: mbs_data.h:262
mbs_error_msg
void mbs_error_msg(int err, const char *msg,...)
Send an error message.
Definition: mbs_message.c:131
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:955
MbsData::njoint
int njoint
Number of joints in the system.
Definition: mbs_data.h:259
mbs_project_interface.h
Declaration of functions that are project dependent.
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:490
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:22
mbs_define.h
free_dmat_0
void free_dmat_0(double **mat)
release memory for a matrix of doubles, starting at index 0
Definition: mbs_matrix.c:332
MbsPart::options
MbsPartOptions * options
Structure containing the options for coordinate partitioning module.
Definition: mbs_part.h:66
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:817
mbs_run_part
int mbs_run_part(MbsPart *mbs_part, MbsData *mbs_data)
Main function of the coordinate partitioning module.
Definition: mbs_part.c:532
mbs_matrix.h
frand
double frand(void)
Definition: mbs_part.c:140
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:845
_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:147
mbs_1D_array.h
MbsPartOptions::visualize
int visualize
Flag to generate loop closure animation file when partitionning fails.
Definition: mbs_part.h:22
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:295
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:146
MbsPartOptions::clearmbsglobal
int clearmbsglobal
DEPRECATED OPTION.
Definition: mbs_part.h:33
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:20
MbsData::hu
int * hu
Array with the indices of independent constraints.
Definition: mbs_data.h:280
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:277
MbsPart::n_hv
int n_hv
Number of redundant constraint.
Definition: mbs_part.h:77
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:858
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:479
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:863
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:510
MbsPart
Main structure for the coordinate partitioning module.
Definition: mbs_part.h:64
_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:828
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:406
MbsData::Nuserc
int Nuserc
Number of user constraints.
Definition: mbs_data.h:318
_MBS_ERR_MID_MRED
#define _MBS_ERR_MID_MRED
Mid Level error number Related to the computation of the Mred matrix.
Definition: mbs_errors_names.h:107
MbsData::qu
int * qu
Array with the indices of the independent articulations (free)
Definition: mbs_data.h:271
MbsData::qv
int * qv
Array with the indices of the dependent articulations .
Definition: mbs_data.h:279
MbsData::Nloopc
int Nloopc
Number of loop constraints.
Definition: mbs_data.h:316
MbsPartOptions::set_seed
unsigned int set_seed
Flag to prevent the partitionning to set a constant seed number.
Definition: mbs_part.h:52
freeMbsAux
void freeMbsAux(MbsAux *mbs_aux, MbsData *s)
Definition: mbs_aux.c:174
mbs_call_cons_hJ
int mbs_call_cons_hJ(double *h, double **Jac, MbsData *s, double tsim)
Symbolic constraints function declaration.
Definition: mbs_project_fct_ptr.c:94
MbsData::q
double * q
Array with the current values of the generalized coordinates.
Definition: mbs_data.h:284
mbs_delete_part
void mbs_delete_part(MbsPart *mbs_part)
Free the memory of the given MbsPart structure.
Definition: mbs_part.c:893
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:976
_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:178
MbsPartOptions::verbose
int verbose
Verbosity level of the module, defined in file mbs_define.h.
Definition: mbs_part.h:31
MbsPart::q_closed
double * q_closed
Array with the generalized coordinate in closed configuration (constraints solved)
Definition: mbs_part.h:80
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:18
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:215
MbsData::nqc
int nqc
Number of driven articulations, it includes qlocked and qdriven.
Definition: mbs_data.h:263
mbs_message.h
MbsPart::n_qu
int n_qu
Number of independent variable needed.
Definition: mbs_part.h:68
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:474
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:845
MbsData
Definition: mbs_data.h:246
user_call_cons_hJ
int user_call_cons_hJ(double *h, double **Jac, MbsData *s, double tsim)
Module redirection for user joint force function, see user_cons_hJ() however the return differs.
Definition: mbs_project_fct_ptr.c:269
mbs_new_part
MbsPart * mbs_new_part(MbsData *mbs_data)
Allocate a new MbsPart structure for the given MbsData structure.
Definition: mbs_part.c:868
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:893
PART_calc_hJ
int PART_calc_hJ(MbsData *mbs_data, double *h, double **J)
Compute the current constraint error vector and its Jacobian.
Definition: mbs_part.c:154
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:495
MbsPart::ind_qu
int * ind_qu
Array with the indices of best choice for independent variables.
Definition: mbs_part.h:69
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:500
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:960
MbsPart::ind_hv
int * ind_hv
Array with the indices of best choice for redundant constraints.
Definition: mbs_part.h:78
free_dmat_1
void free_dmat_1(double **mat)
release memory for a matrix of doubles, starting at index 1
Definition: mbs_matrix.c:340
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:981
MbsPartOptions::rowperm
int rowperm
Flag to allow lines permutations: 0 no permutation (default).
Definition: mbs_part.h:18
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:971
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:34
mbs_call_dirdyna
int mbs_call_dirdyna(double **M, double *c, MbsData *s, double tsim)
Symbolic direct dynamic function declaration.
Definition: mbs_project_fct_ptr.c:72
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:691
MBS_INFO_SUCCESS
#define MBS_INFO_SUCCESS
Definition: mbs_define.h:29
MbsPartOptions::drivers
int drivers
DEPRECATED OPTION.
Definition: mbs_part.h:26
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:294
mbs_delete_part_options
void mbs_delete_part_options(MbsPartOptions *opt)
Free the memory of the given MbsPartOptions structure.
Definition: mbs_part.c:863
MbsPart::n_hu
int n_hu
Number of independent constraint.
Definition: mbs_part.h:74
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
user_call_DrivenJoints
int user_call_DrivenJoints(MbsData *s, double tsim)
Module redirection for the computation of driven joints, see user_DrivenJoints() however the return d...
Definition: mbs_project_fct_ptr.c:258
MbsPart::ind_qv
int * ind_qv
Array with the indices of best choice and order for dependent variables.
Definition: mbs_part.h:72
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:569
mbs_part.h
MbsData::nhu
int nhu
Number of independent constraints.
Definition: mbs_data.h:268
_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
MBS_VERBOSE_ALL
#define MBS_VERBOSE_ALL
Definition: mbs_define.h:46
mbs_errors_names.h
MbsPartOptions::random_amplitude_singul
double random_amplitude_singul
Amplitude of the random troubleshoot of generalized coordinates for solving constaints.
Definition: mbs_part.h:45