|
Robotran C Documentation
|
MbsDirdyn * mbs_new_dirdyn(MbsData *mbs_data)
Create a new direct dynamic structure.
Definition: mbs_dirdyn.c:42
MbsInvOptions * options
Structure defining the option of a inverse kinematic analysis.
Definition: mbs_solvekin_struct.h:157
int mbs_anim_close_geo(MbsData *mbs_data, MbsAux *mbs_aux)
Generate the animation for failed Newton-Raphson procedure.
Definition: mbs_close_loops.c:118
char * resfilename
The keyword used for determining the name of result files.
Definition: mbs_solvekin_struct.h:94
@ BUFFER_QQ
Definition: mbs_buffer.h:21
int mbs_run_dirdyn(MbsDirdyn *dirdyn, MbsData *mbs_data)
Run the direct dynamic simulation.
Definition: mbs_dirdyn.c:221
int mbs_dirdyn_write_buffers(MbsDirdyn *dd)
Compute the derivatives of the system (1st derivatives to be given to the ODE integrator)
Definition: mbs_dirdyn.c:1155
int flag_precise_dynamics
= 1 to call the direct dynamics at the beginning of each time step of integration.
Definition: mbs_dirdyn_struct.h:118
int savePeriodCounter
counter for checking whether results must be saved
Definition: mbs_dirdyn_struct.h:198
int mbs_call_link3D(double **frc, double **trq, MbsData *s, double tsim)
Symbolic link 3D forces function declaration.
Definition: mbs_project_fct_ptr.c:40
@ BUFFER_LINK3D
Definition: mbs_buffer.h:23
char * buffer_format
if NULL, "%e" is used. Can be for instance XXX->options->buffer_format = "%4.7f";....
Definition: mbs_dirdyn_struct.h:86
void mbs_msg(const char *msg,...)
Send a message.
Definition: mbs_message.c:87
void print_warnings_integrator(MbsData *mbs_data, MbsDirdyn *mbs_dd, int type_of_integrator)
Check the options set by user to warn him when he modified an unused option for the integrator.
Definition: integrator.c:272
Realtime_option * options
user options
Definition: realtime.h:145
char * get_char_cpy(const char *fmt,...)
Copy the provided formatted string into a newly allocated memory.
Definition: useful_functions.c:196
int Ncons
Number of algebraic constraints.
Definition: mbs_data.h:317
mbs_invdynared_d_ptr mbs_invdynared_dqd
Definition: mbs_data.h:81
@ BUFFER_LINK_F
Definition: mbs_buffer.h:22
double * qd
Array with the current values of the generalized velocities.
Definition: mbs_data.h:285
int * qa
Array with the indices of actuated articulations (only for inverse dynamic).
Definition: mbs_data.h:277
double dt0
Initial value of the integration step size [s]. For dirdyn and invdyn only. This parameter is set fro...
Definition: mbs_data.h:309
int accelred
1 to use accelred, 0 otherwise, default = 0
Definition: mbs_dirdyn_struct.h:90
int check_user_dirdyn_options(MbsDirdyn *dd, MbsData *mbs_data)
check that the dirdyn options performed by the user are correct
Definition: mbs_dirdyn.c:156
void mbs_compute_sin_cos_qv(MbsData *s, int *qrot_qv_indvec)
Compute the sine and cosine of the q_sin and q_cos, only for the rotational joints that are dependent...
Definition: mbs_trigo.c:80
int mbs_dirdyn_finish(MbsDirdyn *dirdyn, MbsData *mbs_data)
Run the finalization operations of the run_dirdyn function.
Definition: mbs_dirdyn.c:1023
user realtime visu prototype
double tsim
The time value.
Definition: mbs_data.h:305
int nqrot
Number of rotational joint (R1, R2 or R3)
Definition: mbs_data.h:269
int Nlink3D
Number of 3D links.
Definition: mbs_data.h:337
void user_call_dirdyn_finish(MbsData *mbs_data, MbsDirdyn *mbs_dd)
Module redirection for user own dirdyn finish function, see user_dirdyn_finish().
Definition: mbs_project_fct_ptr.c:526
@ BUFFER_VISU
Definition: mbs_buffer.h:22
double * y
Pointer to the state vector, this is a dvec_0 of size nState.
Definition: mbs_dirdyn_struct.h:175
void user_call_realtime_visu(MbsData *mbs_data, int nb_models, int *nb_q, double **q_vec)
Redirection to the user-specified user function of realtime visualization.
Definition: mbs_project_fct_ptr.c:620
int nqv
Number of dependent articulations.
Definition: mbs_data.h:267
double baumgarte_beta
beta parameter of baumgarte stabilization (>0), default = 0.1 (1/s)
Definition: mbs_dirdyn_struct.h:124
int * qc
Array with the indices of driven (locked and driven) articulations.
Definition: mbs_data.h:272
int nState
size of the state vector
Definition: mbs_dirdyn_struct.h:174
void user_call_dirdyn_loop(MbsData *mbs_data, MbsDirdyn *mbs_dd)
Module redirection for user own dirdyn loop function, see user_dirdyn_loop().
Definition: mbs_project_fct_ptr.c:520
int mbs_run_dirdyn(MbsDirdyn *dd, MbsData *mbs_data)
Run the direct dynamic simulation.
Definition: mbs_dirdyn.c:221
@ BUFFER_UX
Definition: mbs_buffer.h:21
int nqu
Number of independent articulations.
Definition: mbs_data.h:262
void mbs_error_msg(int err, const char *msg,...)
Send an error message.
Definition: mbs_message.c:131
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
double dt_max
maximal time step [s], default = 1.0e-3
Definition: mbs_dirdyn_struct.h:136
#define _MBS_ERR_LOW_FILES
Low Level error number Error during opening/writing files = -9.
Definition: mbs_errors_names.h:157
double * yd
Pointers to the derivative vector (dvec_0) of size nState.
Definition: mbs_dirdyn_struct.h:182
@ RK4
Definition: integrator.h:29
void lubksb(double **a, int n, int *indx, double b[])
Definition: lubksb.c:10
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:57
#define DIRDYN_INTEGRATOR_OPTION_DEFAULT_dt_max
Definition: mbs_dirdyn_struct.h:31
int njoint
Number of joints in the system.
Definition: mbs_data.h:259
Declaration of functions that are project dependent.
int mbs_buffer_write(MbsBuffer *b)
Write the content of the buffer to disk.
Definition: mbs_buffer.c:389
int nmax
maximal number of steps [-], default = 1e9
Definition: mbs_dirdyn_struct.h:132
double tf
Final time of the simulation [s]. For dirdyn and invdyn only. This parameter is set from dirdyn/invyn...
Definition: mbs_data.h:308
int mbs_call_cons_jdqd(double *Jdqd, MbsData *s, double tsim)
Symbolic jdqd function declaration.
Definition: mbs_project_fct_ptr.c:105
#define _MBS_ERR_MID_UXD
Mid Level error number Related to uxd, i.e.
Definition: mbs_errors_names.h:82
#define DIRDYN_INTEGRATOR_OPTION_DEFAULT_atoler
Definition: mbs_dirdyn_struct.h:30
@ BUFFER_LAMBDA
Definition: mbs_buffer.h:23
int check_user_dirdyn_options(MbsDirdyn *dd, MbsData *mbs_data)
check that the dirdyn options performed by the user are correct
Definition: mbs_dirdyn.c:156
void mbs_realtime_update(Simu_realtime *realtime, double tsim)
update save vectors for past investigations (graphs and Java visualization)
Definition: realtime.c:112
double * user_call_JointForces(MbsData *s, double tsim)
Module redirection for user joint force function, see user_JointForces().
Definition: mbs_project_fct_ptr.c:202
void free_set_output()
release memory of auto_output
Definition: set_output.c:117
General structure of the inverse kinematics module.
Definition: mbs_solvekin_struct.h:153
@ BUFFER_QD
Definition: mbs_buffer.h:21
double * yout
Allocation of a vector (dvec_0) of size nState.
Definition: mbs_dirdyn_struct.h:177
@ BUFFER_QC
Definition: mbs_buffer.h:22
int mbs_fct_dirdyn(double tsim, double y[], double dydt[], MbsData *s, MbsDirdyn *dd)
direct dynamics derivative computation
Definition: mbs_dirdyn.c:1169
int mbs_buffer_save(MbsBuffer *b, double t, double *x)
Save the given array to the specified buffer with the specified time.
Definition: mbs_buffer.c:254
@ BUFFER_LINK_Z
Definition: mbs_buffer.h:22
#define DIRDYN_INTEGRATOR_OPTION_DEFAULT_toler
Definition: mbs_dirdyn_struct.h:28
int * compute_Qc
If options-flag_compute_Qc is set to 0, the vector allows to compute only the needed Qc.
Definition: mbs_dirdyn_struct.h:102
int mbs_call_link(double **frc, double **trq, double *Flnk, double *Z, double *Zd, MbsData *s, double tsim)
Symbolic link forces function declaration.
Definition: mbs_project_fct_ptr.c:29
void mbs_warning_msg(const char *msg,...)
Send a warning message.
Definition: mbs_message.c:100
int Nux
Number of user variable.
Definition: mbs_data.h:387
void copy_dvec_1(double *vec_src, double *vec_dest)
Copy the content of a vector (of size specified in vec_src[0]) of doubles to a second vector,...
Definition: mbs_1D_array.c:991
#define _MBS_ERR_MOD_DIRDYN
Module error number module: Direct Dynamics = -400.
Definition: mbs_errors_names.h:58
int mbs_growing_buffer_write(MbsGrowingBuffer *b)
write the content of the growing buffer to disk
Definition: mbs_buffer.c:599
double zero_division_thrs
Value from which a warning is raised if a division by zero (or close to) occurs. Default=1....
Definition: mbs_data.h:407
int simu_quit
1 to quit the simulation, 0 otherwise
Definition: realtime.h:102
int ludcmp(double **a, int n, int *indx, double *d)
LU decomposition of a matrix with index starting at 1.
Definition: ludcmp.c:19
int set_output_to_mbs(MbsData *mbs_data, int verbosity)
Set the address of this buffers in MbsData to expose memory + synchronize verbosity.
Definition: set_output.c:26
@ BUFFER_QDD
Definition: mbs_buffer.h:21
void mbs_delete_dirdyn(MbsDirdyn *dirdyn, MbsData *mbs_data)
Free memory of the direct dynamic structure The options (MbsDirdynOptions) and MbsAux structures are ...
Definition: mbs_dirdyn.c:206
@ COMPUTE_ALL_QC
Definition: mbs_dirdyn.h:42
MbsDirdyn * mbs_new_dirdyn_aux(MbsData *mbs_data, MbsAux *mbs_aux)
Create MbsDirdyn strucure and fill it with auxiliary structure.
Definition: mbs_dirdyn.c:54
#define _MBS_ERR_LOW_NAN
Low Level error number Number is NaN (not a number) = -7.
Definition: mbs_errors_names.h:147
int motion
Determines how the evolution of q, qd qdd are provided.
Definition: mbs_solvekin_struct.h:40
int framerate
Number of frame per second for the .anim file, default = 1000.
Definition: mbs_solvekin_struct.h:113
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
int bufferNb
Number of buffer required to save the current system topology (ie. coordinates, links....
Definition: mbs_dirdyn_struct.h:193
#define _MBS_ERR_INIT
Generic error number Check user options at initialization = -10.
Definition: mbs_errors_names.h:166
void mbs_close_kin(MbsData *s, MbsAux *mbs_aux)
compute the dependent velocities that solves the constraints.
Definition: mbs_close_loops.c:146
int save2file
Determine whether results are written to files on disk (in resultsR folder): 1: results are saved 0: ...
Definition: mbs_dirdyn_struct.h:51
void * integrator_struct
pointer to store integrator structure
Definition: mbs_dirdyn_struct.h:205
#define DIRDYN_INTEGRATOR_OPTION_DEFAULT_rtoler
Definition: mbs_dirdyn_struct.h:29
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
int saveperiod
The number of time steps between two buffer records default: 1 (every time step are recorded)
Definition: mbs_dirdyn_struct.h:74
finish_integrator_ptr finish_integrator
pointer to integrator closing function
Definition: mbs_dirdyn_struct.h:211
int * hu
Array with the indices of independent constraints.
Definition: mbs_data.h:280
char * mbs_dirname(const char *path, int verbose)
mbs_dirname returns the leading part of the path (UNIX and MAC).
Definition: mbs_path.c:407
double dt0
initial value of the integration step size, default = 0.001
Definition: mbs_dirdyn_struct.h:45
int Nxfrc
Number of points where an external force is applied into a body.
Definition: mbs_data.h:362
@ BUFFER_OTHER
Definition: mbs_buffer.h:23
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
int mbs_realtime_loop(Simu_realtime *realtime, double tsim)
one loop iteration of the real-time process
Definition: realtime.c:138
double norminf_vector_1(double *v, int n)
Compute the maximum of a vector.
Definition: norm.c:38
char * resfilename
The keyword used for determining the name of result files Default: 'dirdyn', or 'oneshot' in case the...
Definition: mbs_dirdyn_struct.h:54
int Nlink
Number of forces acting between two points of the system (force law implemented in user_LinkForces())...
Definition: mbs_data.h:336
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
@ BUFFER_Q
Definition: mbs_buffer.h:21
double tsim
current simulation time
Definition: mbs_dirdyn_struct.h:171
@ BUFFER_UXD
Definition: mbs_buffer.h:21
int mbs_dirdyn_save(MbsDirdyn *dd, MbsData *mbs_data, double t)
save the dirdyn results through the buffer
Definition: mbs_dirdyn.c:281
@ COMPUTE_CUSTOM_QC
Definition: mbs_dirdyn.h:44
int user_call_cons_jdqd(double *jdqd, MbsData *s, double tsim)
Module redirection for jdqd term of the user-specified constraints, see user_cons_jdqd() however the ...
Definition: mbs_project_fct_ptr.c:280
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
@ COMPUTE_NO_QC
Definition: mbs_dirdyn.h:43
void user_call_dirdyn_init(MbsData *mbs_data, MbsDirdyn *mbs_dd)
Module redirection for user own dirdyn initialization function, see user_dirdyn_init().
Definition: mbs_project_fct_ptr.c:514
MbsGrowingBuffer * user_buffer
growing buffer to store user values
Definition: mbs_dirdyn_struct.h:191
Definition: mbs_buffer.h:46
char * respath
Path in which result file are saved.
Definition: mbs_dirdyn_struct.h:58
Realtime_extern * ext
external variables
Definition: realtime.h:143
int mbs_growing_buffer_save(MbsGrowingBuffer *b, double t)
Save the given values of auto_output to the specified buffer with the specified time.
Definition: mbs_buffer.c:295
void mbs_delete_buffer(MbsBuffer *b)
Free memory of the specified MbsBuffer.
Definition: mbs_buffer.c:206
int flag_compute_Qc
choose to compute (or not) the Qc for driven variables.
Definition: mbs_dirdyn_struct.h:97
int MAX_NR_ITER
Maximal number of iterations for NR procedure, default 100.
Definition: mbs_data.h:320
int Nuserc
Number of user constraints.
Definition: mbs_data.h:318
int mbs_dirdyn_init(MbsDirdyn *dirdyn, MbsData *mbs_data)
Run the startup operations of the run_dirdyn function.
Definition: mbs_dirdyn.c:341
void mbs_delete_growing_buffer(MbsGrowingBuffer *b)
release memory for growing buffer
Definition: mbs_buffer.c:230
double * Fl
Array with the current values of the forces on each link (see: user_LinkForces()).
Definition: mbs_data.h:340
int * qu
Array with the indices of the independent articulations (free)
Definition: mbs_data.h:271
int nb_models
number of models to load
Definition: realtime.h:77
double NRerr
Maximal error on constraint allowed in Newton-Raphson algorithm, default 1.0e-9.
Definition: mbs_data.h:319
double tf
final time of the simulation, default = 5.0
Definition: mbs_dirdyn_struct.h:43
int save_visu
1 to save the visualizazion file (as it appears in 'user_realtime_visu.c'), 0 otherwise (only valid i...
Definition: mbs_dirdyn_struct.h:67
int flag_symbolic_jacobian
1 to use symbolic computation of the jacobian. Only used with implicit integrators....
Definition: mbs_dirdyn_struct.h:141
double ** trq
Matrix with the components of the resultant external torques (pure torque and couple produced by forc...
Definition: mbs_data.h:300
int show_failed_closure
1 to generate animation of the failed Newton-Raphson procedure, default = 0.
Definition: mbs_dirdyn_struct.h:144
int * qv
Array with the indices of the dependent articulations .
Definition: mbs_data.h:279
double * Qc
Array with the value of joint force introduced in driven joint to respect the user function.
Definition: mbs_data.h:332
int Nloopc
Number of loop constraints.
Definition: mbs_data.h:316
@ BUFFER_LINK_ZD
Definition: mbs_buffer.h:22
int buffersize
The number of time step that can be recorded in the buffer.
Definition: mbs_dirdyn_struct.h:85
int compute_all_uxd
choose to compute (or not) the user derivative during dirdyn time integration. For dirdyn only....
Definition: mbs_dirdyn_struct.h:100
double baumgarte_alpha
alpha parameter of baumgarte stabilization (>0), default = 0.1 (1/s)
Definition: mbs_dirdyn_struct.h:123
void freeMbsAux(MbsAux *mbs_aux, MbsData *s)
Definition: mbs_aux.c:174
double * Zd
Array with the current values of the speed (spreading) between of the points of a link (see: user_Lin...
Definition: mbs_data.h:339
int mbs_call_cons_hJ(double *h, double **Jac, MbsData *s, double tsim)
Symbolic constraints function declaration.
Definition: mbs_project_fct_ptr.c:94
int n_freeze
number of time step when the jacobian is freezed (computed once at the start of the n_freeze time ste...
Definition: mbs_dirdyn_struct.h:140
double * Qq
Array with the values of the joint forces.
Definition: mbs_data.h:301
double * q
Array with the current values of the generalized coordinates.
Definition: mbs_data.h:284
int verbose
Gives informations during the process.
Definition: mbs_solvekin_struct.h:147
void free_dvec_1(double *vec)
release memory for a vector of doubles, starting at index 1
Definition: mbs_1D_array.c:976
int framerate
number of frame per second for the .anim file, default = 1000
Definition: mbs_dirdyn_struct.h:69
char * project_path
Path to the mbs project folder.
Definition: mbs_data.h:411
int mbs_init_sin_cos_q_vecs(MbsData *s, int *qrot_qu_indvec, int *qrot_qc_indvec, int *qrot_qv_indvec)
Initialize the three vectors of indices (they are usually contained in the mbs_aux structure)
Definition: mbs_trigo.c:23
int mbs_call_accelred(MbsData *s, double tsim)
Symbolic reduced acceleration function declaration.
Definition: mbs_project_fct_ptr.c:62
double toler
mixed error tolerances [-], default = 1.0e-3
Definition: mbs_dirdyn_struct.h:133
int mbs_realtime_init(MbsData *mbs_data, double t0, double tf, double dt0)
initialize the real-time structures
Definition: realtime.c:60
int mbs_calc_jdqd(MbsData *s, MbsAux *mbs_aux)
compute the quadratic term of the constraints at acceleration level:
Definition: mbs_close_loops.c:236
int mbs_check_mbs_data_values(MbsAux *module_mbs_aux, MbsData *mbs_data)
Check the coherence between the mbs_data used before module initialization and module run.
Definition: mbs_check.c:88
This header defines the functions for trigonometric handling in MBsysC integrator in C.
int flag_oneshot
1 to compute the derivative function only once (no time integration !), default = 0 The time is the v...
Definition: mbs_dirdyn_struct.h:92
Functions fct
Structure to store the pointer to the project-specific functions.
Definition: mbs_data.h:414
int mbs_call_extforces(double **frc, double **trq, MbsData *s, double tsim)
Symbolic external forces function declaration.
Definition: mbs_project_fct_ptr.c:51
int mbs_comp_LUdcmp_mJv(MbsData *s, MbsAux *mbs_aux)
compute and update (!) the mJv matrix, decomposing it to the LU format mbs_aux->mJv[i][j] = -mbs_aux-...
Definition: mbs_close_loops.c:25
void init_sensor(MbsSensor *psens, int njoint)
Initialize all fields of MbsSensor structure to 0.
Definition: mbs_sensor_utilities.c:25
double ** frc
Matrix with the components of the resultant external forces (in the body fixed frame) applied to the ...
Definition: mbs_data.h:299
MbsGrowingBuffer * mbs_new_growing_buffer(int max_nx, int size, const char *respath)
create a new growing buffer for the user inputs to save
Definition: mbs_buffer.c:144
int mbs_dirdyn_finish(MbsDirdyn *dd, MbsData *mbs_data)
Run the finalization operations of the run_dirdyn function.
Definition: mbs_dirdyn.c:1023
MbsBuffer ** buffer_visu
buffer used to save the visualization as it appears in 'user_realtime_visu.c'
Definition: mbs_dirdyn_struct.h:188
int mbs_calc_force(MbsData *s)
compute the force and torques applied on the multibody system.
Definition: mbs_calc_force.c:16
int save_anim
1 to save the anim file, 0 otherwise (only valid if 'save2file' is set to 1), default = 1
Definition: mbs_dirdyn_struct.h:65
int save_realtime_update(MbsDirdyn *dd, MbsData *mbs_data)
update the real-time and saving modules if requested
Definition: mbs_dirdyn.c:1252
int mbs_dirdyn_save(MbsDirdyn *dd, MbsData *mbs_data, double t)
save the dirdyn results through the buffer
Definition: mbs_dirdyn.c:281
int nqc
Number of driven articulations, it includes qlocked and qdriven.
Definition: mbs_data.h:263
double ** l3DWr
Definition: mbs_data.h:342
set_output function called by the user to output his own variables
void * realtime
Pointer to Simu_realtime structure.
Definition: mbs_data.h:418
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
int flag_visu
1 if Java visualization features activated, 0 otherwise
Definition: realtime.h:75
int mbs_dirdyn_loop(MbsDirdyn *dd, MbsData *mbs_data)
Time loop of the run_dirdyn function:
Definition: mbs_dirdyn.c:974
int max_save_user
The maximal number of user variables saved default: 12.
Definition: mbs_dirdyn_struct.h:79
MbsAux * initMbsAux(MbsData *s)
Definition: mbs_aux.c:18
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
Definition: mbs_data.h:246
int user_call_Derivative(MbsData *s)
Module redirection for the time derivative of the user state variables, see user_Derivative() however...
Definition: mbs_project_fct_ptr.c:248
Real-time constraints main header.
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
#define DIRDYN_INTEGRATOR_WAYPOINT_TIME_ERROR_max
Definition: mbs_dirdyn_struct.h:32
double rtoler
relative error tolerances [-], default = 1.0e-3
Definition: mbs_dirdyn_struct.h:134
MbsAux * mbs_aux
Definition: mbs_dirdyn_struct.h:169
real-time structure
Definition: realtime.h:99
int flag_baumgarte_stabilization
1 if user wants baumgarte stabilization of the independant accelerations
Definition: mbs_dirdyn_struct.h:122
Structure defining the option of a direct dynamic.
Definition: mbs_dirdyn_struct.h:38
int mbs_run_solvekin(MbsSolvekin *sk, MbsData *mbs_data)
Run the inverse kinematic analysis.
Definition: mbs_solvekin.c:105
#define _MBS_ERR_MOD_SPEC_11
Mid Level error number Module specific errors range from -11 to -19 please read the error message...
Definition: mbs_errors_names.h:172
#define MBS_VERBOSE_WARNING
Definition: mbs_define.h:45
double * Qa
Array of active joint forces (in case of simulink,invdyna,equil,linearization,...)
Definition: mbs_data.h:302
double t0
initial time of the simulation, default = 0.0
Definition: mbs_dirdyn_struct.h:41
void set_integrator(MbsDirdyn *mbs_dd)
Set the function pointer in MbsDirdyn.
Definition: integrator.c:173
int get_output_vector_size(int index)
get the output vector size corresponding to the requested index
Definition: set_output.c:315
int dirdynared(MbsAux *mbs_aux, MbsData *s)
Compute the joint accelerations of the system in the current configuration.
Definition: mbs_dirdynared.c:26
double t0
Initial time of the simulation [s]. For dirdyn and invdyn only. This parameter is set from dirdyn/inv...
Definition: mbs_data.h:307
This header defines specific integrators functions in C.
int get_output_vector_nb()
get the number of user vector inputs
Definition: set_output.c:333
initialize_integrator_ptr initialize_integrator
pointer to integrator initialize function
Definition: mbs_dirdyn_struct.h:207
int mbs_realtime_finish(Simu_realtime *realtime)
release memory used for the real-time related functions
Definition: realtime.c:306
int integrator
Set integrator to use, available value: RK4, Dopri5, Rosenbrock, EulerEx, Eulaire,...
Definition: mbs_dirdyn_struct.h:109
#define DIRDYN_INTEGRATOR_OPTION_DEFAULT_nmax
Define of default options for integrator in DirdynStruc.
Definition: mbs_dirdyn_struct.h:27
void free_ivec_1(int *vec)
release memory for a vector of integers, starting with index 1
Definition: mbs_1D_array.c:495
void init_set_output(int max_nb_curves)
initialize the static auto_output structure
Definition: set_output.c:84
int mbs_dirdyn_write_buffers(MbsDirdyn *dd)
Compute the derivatives of the system (1st derivatives to be given to the ODE integrator)
Definition: mbs_dirdyn.c:1155
double * Z
Array with the current values of the distances between of the points of a link (see: user_LinkForces(...
Definition: mbs_data.h:338
int mbs_calc_hJ(MbsData *s, MbsAux *mbs_aux)
compute the current value of the constraints ( ) and the constraint Jacobian matrix ( ).
Definition: mbs_close_loops.c:194
int flag_stop
stop the simulation. For dirdyn, equil, invdyn and solvekin only.
Definition: mbs_data.h:397
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
int verbose
Verbosity level propagated to other compatible module:
Definition: mbs_dirdyn_struct.h:111
void free_dmat_1(double **mat)
release memory for a matrix of doubles, starting at index 1
Definition: mbs_matrix.c:340
double delta_t_wp
time interval between two waypoints [s], default = 1.0e-3
Definition: mbs_dirdyn_struct.h:129
int realtime
1 to activate to real-time features, 0 to deactivate them, default = 0
Definition: mbs_dirdyn_struct.h:88
#define MBS_INFO_SUCCESS
Definition: mbs_define.h:29
int flag_solout_wp
1 to call solout only at required waypoints (only if flag_waypoint activated), default = 0
Definition: mbs_dirdyn_struct.h:128
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:1323
double * lambda
Array with the values of the Lagrange Multipliers related to the constraints.
Definition: mbs_data.h:321
struct Functions::@4 symb
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
double * uxd
Array with the values of the time derivatives of the user variables.
Definition: mbs_data.h:385
int mbs_dirdyn_init(MbsDirdyn *dd, MbsData *mbs_data)
Run the startup operations of the run_dirdyn function.
Definition: mbs_dirdyn.c:341
void reset_flag_output()
reset the flag_output to 0. Useful when running several simulation in a row with different save2file ...
Definition: set_output.c:76
MbsBuffer ** buffers
buffer to store generalized coordinates, velocities, acceleration, joint forces...
Definition: mbs_dirdyn_struct.h:185
double atoler
absolute error tolerances [-], default = 1.0e-6
Definition: mbs_dirdyn_struct.h:135
General structure of the direct dynamic module.
Definition: mbs_dirdyn_struct.h:166
int mbs_dirdyn_loop(MbsDirdyn *dirdyn, MbsData *mbs_data)
Time loop of the run_dirdyn function:
Definition: mbs_dirdyn.c:974
int flag_waypoint
1 to use waypoints, 0 otherwise, default =0
Definition: mbs_dirdyn_struct.h:127
double dt
current integration step size
Definition: mbs_dirdyn_struct.h:172
MbsSolvekin * mbs_new_solvekin(MbsData *mbs_data)
Create a new inverse kinematic structure.
Definition: mbs_solvekin.c:33
int nqa
Number of actuated articulations.
Definition: mbs_data.h:266
void mbs_delete_dirdyn(MbsDirdyn *dirdyn, MbsData *mbs_data)
Free memory of the direct dynamic structure The options (MbsDirdynOptions) and MbsAux structures are ...
Definition: mbs_dirdyn.c:206
MbsDirdyn * mbs_new_dirdyn_aux(MbsData *mbs_data, MbsAux *mbs_aux)
Create MbsDirdyn strucure and fill it with auxiliary structure.
Definition: mbs_dirdyn.c:54
int mbs_step_close_geo(MbsData *s, MbsAux *mbs_aux)
compute an iteration of the position of the multibody system to solve the constraints
Definition: mbs_close_loops.c:81
double * qdd
Array with the current values of the generalized acceleration.
Definition: mbs_data.h:286
char * get_output_vector_label(int index)
get the output vector label corresponding to the requested index
Definition: set_output.c:304
void mbs_delete_solvekin(MbsSolvekin *solvekin, MbsData *mbs_data)
Free memory of the inverse kinematic structure The options (MbsInvOptions) and MbsAux structures are ...
Definition: mbs_solvekin.c:89
MbsBuffer * mbs_new_buffer(char *filename, char *anim_name, int nx, int size, int id, char *buf_format, int save_anim, int save_visu, double anim_period)
Allocate and initialize a MbsBuffer structure.
Definition: mbs_buffer.c:27
int mbs_makedirs(char *path)
Create (recursively) the specified directory.
Definition: mbs_path.c:586
loop_integrator_ptr loop_integrator
pointer to integrator looping function
Definition: mbs_dirdyn_struct.h:209
MbsDirdynOptions * options
structure defining the option of a direct dynamic
Definition: mbs_dirdyn_struct.h:168
int flag_stop_stiff
1 to stop integration if it become stiff, 0 (default value) otherwise, default = 0
Definition: mbs_dirdyn_struct.h:117
void mbs_delete_sensor(MbsSensor *psens)
Free the memory of MbsSensor structure. and its contents.
Definition: mbs_sensor_utilities.c:64
double * ux
Array with the values of the user variables.
Definition: mbs_data.h:384
MbsAux * mbs_aux
Structure to store auxiliary value needed during computation.
Definition: mbs_solvekin_struct.h:160
MbsDirdyn * mbs_new_dirdyn(MbsData *mbs_data)
Create a new direct dynamic structure.
Definition: mbs_dirdyn.c:42
mbs_invdynared_d_ptr mbs_invdynared_dq
Definition: mbs_data.h:80
char * animpath
Path in which anim file is saved.
Definition: mbs_dirdyn_struct.h:63
int nhu
Number of independent constraints.
Definition: mbs_data.h:268
#define _MBS_ERR_MID_CLOSE_GEO
Mid Level error number Related to the closing geometry, i.e.
Definition: mbs_errors_names.h:87
#define MBS_VERBOSE_ALL
Definition: mbs_define.h:46
double ** savedArrays
pointer to the array that must be saved to buffers
Definition: mbs_dirdyn_struct.h:195
double * get_output_vector_ptr(int index)
get the pointer to the output vector at the requested index
Definition: set_output.c:352
@ closeloop
Definition: mbs_solvekin_struct.h:25
void mbs_realtime_reset()
reset the realtime structures and flag. Useful in case we want to run several simulations in a row in...
Definition: realtime.c:43