Real-time constraints main header. More...
#include "realtime_ext.h"
#include "color_sdl.h"
#include "mbs_data.h"
#include "mbs_project_fct_ptr.h"
Go to the source code of this file.
Classes | |
struct | Realtime_extern |
external variables and stuctures More... | |
struct | Realtime_option |
user real-time option More... | |
struct | Realtime_constraint |
one constraint strcuture More... | |
struct | Simu_realtime |
real-time structure More... | |
Macros | |
#define | PERIOD_BACK_IN_VISU 0.03 |
#define | INTERRUPT_BACK_IN_VISU 0.25 |
Functions | |
void | mbs_realtime_reset () |
reset the realtime structures and flag. Useful in case we want to run several simulations in a row in the same process. More... | |
int | mbs_realtime_init (MbsData *mbs_data, double t0, double tf, double dt0) |
initialize the real-time structures More... | |
int | mbs_realtime_loop (Simu_realtime *realtime, double tsim) |
one loop iteration of the real-time process More... | |
void | mbs_realtime_update (Simu_realtime *realtime, double tsim) |
update save vectors for past investigations (graphs and Java visualization) More... | |
int | mbs_realtime_finish (Simu_realtime *realtime) |
release memory used for the real-time related functions More... | |
Simu_realtime * | init_realtime (MbsData *mbs_data, Realtime_option *options, int *err) |
initialize the real-time structure More... | |
Simu_realtime * | init_simu_realtime (MbsData *mbs_data, Realtime_option *options, int nb_constraints, double *fqc_tab, int *err) |
initialize the structure with all the real-time constraints More... | |
Realtime_constraint * | init_realtime_constraint (int delta_t_usec, int cur_t_usec, double tsim) |
initialize one real-time constraint More... | |
void | free_realtime_constraint (Realtime_constraint *constraint) |
free one real-time constraint More... | |
int | free_simu_realtime (Simu_realtime *realtime) |
free the structure of all the real-time constraints More... | |
void | update_simu_realtime (Simu_realtime *realtime) |
update the structure of all the constraints More... | |
void | update_realtime_constraint (Realtime_constraint *constraint, int simu_speed_flag) |
update one real-time constraint More... | |
void | update_realtime_constraints_break (Simu_realtime *realtime, int delta_break_u_sec) |
update the real-time constraints after a break More... | |
double | get_simu_speed_factor (int simu_speed_flag) |
get simulation factor depending on the 'simu_speed_flag' flag More... | |
int | get_simu_speed_flag (double simu_speed_factor) |
get the 'simu_speed_flag' flag depending on simulation factor More... | |
Realtime_option * | init_Realtime_option (MbsData *mbs_data) |
generates a real-time options structures with the default values More... | |
void | free_Realtime_option (Realtime_option *option) |
release memory for the options structure More... | |
int | check_user_realtime_options (Realtime_option *options) |
check that the modifications performed by the user on the options are correct More... | |
void | compute_buffer_size (Realtime_option *option) |
automatically compute the buffer size More... | |
void | user_realtime_options (MbsData *mbs_data, Realtime_option *options) |
modify the real-time options More... | |
Real-time constraints main header.
#define INTERRUPT_BACK_IN_VISU 0.25 |
#define PERIOD_BACK_IN_VISU 0.03 |
int check_user_realtime_options | ( | Realtime_option * | options | ) |
check that the modifications performed by the user on the options are correct
[in,out] | options | options structure |
void compute_buffer_size | ( | Realtime_option * | options | ) |
automatically compute the buffer size
[in,out] | options | options structure |
void free_realtime_constraint | ( | Realtime_constraint * | constraint | ) |
free one real-time constraint
[out] | constraint | constraint to release memory |
void free_Realtime_option | ( | Realtime_option * | options | ) |
release memory for the options structure
[out] | options | options structure |
int free_simu_realtime | ( | Simu_realtime * | realtime | ) |
free the structure of all the real-time constraints
[out] | realtime | real-time structure to release memory |
double get_simu_speed_factor | ( | int | simu_speed_flag | ) |
get simulation factor depending on the 'simu_speed_flag' flag
[in] | simu_speed_flag | index used to compute the speed factor |
int get_simu_speed_flag | ( | double | simu_speed_factor | ) |
get the 'simu_speed_flag' flag depending on simulation factor
[in] | simu_speed_factor | speed factor |
Simu_realtime* init_realtime | ( | MbsData * | mbs_data, |
Realtime_option * | options, | ||
int * | err | ||
) |
initialize the real-time structure
[in,out] | mbs_data | Robotran main structure |
[in] | options | options structure |
[in,out] | err | <0 if error occurs |
Realtime_constraint* init_realtime_constraint | ( | int | delta_t_usec, |
int | cur_t_usec, | ||
double | tsim | ||
) |
initialize one real-time constraint
[in] | delta_t_usec | time step for this constraint [us] |
[in] | cur_t_usec | current time (real-time) [us] |
[in] | tsim | current simulation time [s] |
Realtime_option* init_Realtime_option | ( | MbsData * | mbs_data | ) |
generates a real-time options structures with the default values
< initial simulation time [s]
< final simulation time [s]
< simulation time step [s]
< 1 to start with a break, 0 otherwise
< 1 to finish with a break, 0 otherwise
< size of the buffer for 3D visu and sdl
< initial speed factor
< 1 if SDL plots features activated, 0 otherwise
< plot curve width in number of pixels
< plot screen width in number of pixels
< plot screen height in number of pixels
< maximum number of curves plotted
< maximum number of curves legends indicated
< initial lower bound for the y values plotted
< initial upper bound for the y values plotted
< frequence of the SDL plots refreshment [Hz]
< 1 if Java visualization features activated, 0 otherwise
< number of models to load
< initial visu viewpoint ID
< frequence of the 3D visualization refreshment [Hz]
Simu_realtime* init_simu_realtime | ( | MbsData * | mbs_data, |
Realtime_option * | options, | ||
int | nb_constraints, | ||
double * | fqc_tab, | ||
int * | err | ||
) |
initialize the structure with all the real-time constraints
[in,out] | mbs_data | Robotran main structure |
[in] | options | options structure |
[in] | nb_constraints | number of real-time constraints |
[in] | fqc_tab | tabular with the constraints freqeuncies |
[in,out] | err | <0 if error occurs |
int mbs_realtime_finish | ( | Simu_realtime * | realtime | ) |
release memory used for the real-time related functions
[out] | realtime | real-time structure to release memory |
int mbs_realtime_init | ( | MbsData * | mbs_data, |
double | t0, | ||
double | tf, | ||
double | dt0 | ||
) |
initialize the real-time structures
[in,out] | mbs_data | Robotran main structure |
[in] | t0 | initial time [s] |
[in] | tf | final time [s] |
[in] | dt0 | intitial time step [s] |
int mbs_realtime_loop | ( | Simu_realtime * | realtime, |
double | tsim | ||
) |
one loop iteration of the real-time process
[in,out] | realtime | real-time structure |
[in] | tsim | current simulation time [s] |
void mbs_realtime_reset | ( | ) |
reset the realtime structures and flag. Useful in case we want to run several simulations in a row in the same process.
void mbs_realtime_update | ( | Simu_realtime * | realtime, |
double | tsim | ||
) |
update save vectors for past investigations (graphs and Java visualization)
[in,out] | realtime | real-time structure |
[in] | tsim | current simulation time [s] |
void update_realtime_constraint | ( | Realtime_constraint * | constraint, |
int | simu_speed_flag | ||
) |
update one real-time constraint
[in] | constraint | real-time constraint |
[in] | simu_speed_flag | index used to compute the speed factor |
void update_realtime_constraints_break | ( | Simu_realtime * | realtime, |
int | delta_break_u_sec | ||
) |
update the real-time constraints after a break
[in,out] | realtime | real-time structure |
[in] | delta_break_u_sec | delta of time for next gate [us] |
void update_simu_realtime | ( | Simu_realtime * | realtime | ) |
update the structure of all the constraints
[in,out] | realtime | real-time structure |
void user_realtime_options | ( | MbsData * | mbs_data, |
Realtime_option * | options | ||
) |
modify the real-time options
[in] | mbs_data | Robotran main structure |
[out] | options | real-time options |
These are the options that the user can configure:
example: options->y_min_init = 0.0; options->y_max_init = 10.0;