|
Robotran C Documentation
|
Go to the documentation of this file.
19 #define PERIOD_BACK_IN_VISU 0.03 // [s]
20 #define INTERRUPT_BACK_IN_VISU 0.25 // [s]
functions used to go backward or forward in the simulation time for visualization
double next_tsim
next gate to wait for simulation time [s]
Definition: realtime.h:93
double real_simu_speed_factor
real speed factor
Definition: realtime.h:109
@ LIGHT_GREEN_SDL
Definition: color_sdl.h:19
int simu_break
1 to make a break, 0 otherwise
Definition: realtime.h:103
user real-time option
Definition: realtime.h:42
Realtime_option * options
user options
Definition: realtime.h:145
double dt0
simulation time step [s]
Definition: realtime.h:47
double tf
final simulation time [s]
Definition: realtime.h:46
int screen_width
plot screen width in number of pixels
Definition: realtime.h:61
#define USEC_TO_SEC
factor from us to s
Definition: realtime.c:34
int max_nb_legends
maximum number of curves legends indicated
Definition: realtime.h:65
int get_simu_speed_flag(double simu_speed_factor)
get the 'simu_speed_flag' flag depending on simulation factor
Definition: realtime.c:924
Realtime_constraint * init_realtime_constraint(int delta_t_usec, int cur_t_usec, double tsim)
initialize one real-time constraint
Definition: realtime.c:544
@ BLUE_SDL
Definition: color_sdl.h:18
char * mbs_filename
Path to mbs file including the file with the extension (.mbs)
Definition: mbs_data.h:310
@ LIGHT_BLUE_SDL
Definition: color_sdl.h:19
int check_user_realtime_options(Realtime_option *options)
check that the modifications performed by the user on the options are correct
Definition: realtime.c:429
void user_realtime_options(MbsData *mbs_data, Realtime_option *options)
modify the real-time options
Definition: user_realtime_options.c:85
int buffer_size
size of the buffer for 3D and sdl
Definition: realtime.h:119
void update_realtime_constraint(Realtime_constraint *constraint, int simu_speed_flag)
update one real-time constraint
Definition: realtime.c:841
Simu_realtime * init_realtime(MbsData *mbs_data, Realtime_option *options, int *err)
initialize the real-time structure
Definition: realtime.c:569
int njoint
Number of joints in the system.
Definition: mbs_data.h:162
int next_t_usec
next gate to wait for real time [us]
Definition: realtime.h:92
void mbs_realtime_update(Simu_realtime *realtime, double tsim)
update save vectors for past investigations (graphs and Java visualization)
Definition: realtime.c:113
int init_t_sec
initial real time [s], without us
Definition: realtime.h:122
void time_get(int *t_sec, int *t_usec)
return the absolute time of the computer
Definition: time_functions.c:11
Java functions used for the visualization.
void update_realtime_constraints_break(Simu_realtime *realtime, int delta_break_u_sec)
update the real-time constraints after a break
Definition: realtime.c:952
int last_break
1 to indicate last break, 0 otherwise
Definition: realtime.h:104
int simu_quit
1 to quit the simulation, 0 otherwise
Definition: realtime.h:102
@ DARK_GREEN_SDL
Definition: color_sdl.h:18
void free_realtime_constraint(Realtime_constraint *constraint)
free one real-time constraint
Definition: realtime.c:785
#define _MBS_ERR_INIT
Generic error number Check user options at initialization = -10.
Definition: mbs_errors_names.h:156
double last_real_simu_speed_factor
last real speed factor
Definition: realtime.h:110
@ PINK_SDL
Definition: color_sdl.h:19
@ TURQUOISE_SDL
Definition: color_sdl.h:18
int delta_t_usec
delta time between to gates for real time [us]
Definition: realtime.h:91
Real-time constraints header for external modules.
#define NB_COLORS_SDL
number of colors available to the user
Definition: color_sdl.h:12
void mbs_realtime_update(Simu_realtime *realtime, double tsim)
update save vectors for past investigations (graphs and Java visualization)
Definition: realtime.c:113
int check_user_realtime_options(Realtime_option *options)
check that the modifications performed by the user on the options are correct
Definition: realtime.c:429
double t0
initial simulation time [s]
Definition: realtime.h:116
int mbs_realtime_finish(Simu_realtime *realtime)
release memory used for the real-time related functions
Definition: realtime.c:307
int mbs_realtime_loop(Simu_realtime *realtime, double tsim)
one loop iteration of the real-time process
Definition: realtime.c:139
@ GREEN_SDL
Definition: color_sdl.h:19
void update_realtime_constraint(Realtime_constraint *constraint, int simu_speed_flag)
update one real-time constraint
Definition: realtime.c:841
set_plot function called by the user to plot a curve
Realtime_option * init_Realtime_option(MbsData *mbs_data)
generates a real-time options structures with the default values
Definition: realtime.c:331
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
Definition: realtime.c:594
void update_realtime_constraints_break(Simu_realtime *realtime, int delta_break_u_sec)
update the real-time constraints after a break
Definition: realtime.c:952
void mbs_msg(char *msg,...)
Send a message.
Definition: mbs_message.c:76
double y_max_init
initial upper bound for the y values plotted
Definition: realtime.h:68
Realtime_extern * ext
external variables
Definition: realtime.h:143
main SDL functions (plot curves and handles keyboard, joystick... inputs)
int mbs_realtime_init(MbsData *mbs_data, double t0, double tf, double dt0)
initialize the real-time structures
Definition: realtime.c:61
@ YELLOW_SDL
Definition: color_sdl.h:19
#define NB_REAL_TIME_CONSTRAINTS
number of real-time constraints
Definition: realtime.c:36
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
Definition: realtime.c:594
int nb_models
number of models to load
Definition: realtime.h:77
double tf
final simulation time [s]
Definition: realtime.h:117
Realtime_constraint ** constraints
structures of multiple real-time constraints
Definition: realtime.h:141
double fqc_visu
frequence of the 3D visualization refreshment [Hz]
Definition: realtime.h:83
functions used to get the time expressed in us (micro seconds)
void compute_buffer_size(Realtime_option *options)
automatically compute the buffer size
Definition: realtime.c:530
#define DEFAULT_DELTA_T_USEC
default time between 2 refresh moments (in us)
Definition: realtime.c:35
double y_min_init
initial lower bound for the y values plotted
Definition: realtime.h:67
@ DARK_YELLOW_SDL
Definition: color_sdl.h:19
void free_realtime_constraint(Realtime_constraint *constraint)
free one real-time constraint
Definition: realtime.c:785
@ ORANGE_SDL
Definition: color_sdl.h:19
one constraint strcuture
Definition: realtime.h:89
int curve_width
plot curve width in number of pixels
Definition: realtime.h:60
int mbs_realtime_init(MbsData *mbs_data, double t0, double tf, double dt0)
initialize the real-time structures
Definition: realtime.c:61
int flag_plot
1 if SDL plots features activated, 0 otherwise
Definition: realtime.h:136
Simu_realtime * init_realtime(MbsData *mbs_data, Realtime_option *options, int *err)
initialize the real-time structure
Definition: realtime.c:569
int t_usec(int init_t_sec, int init_t_usec)
return the elapsed time (in us) since time 'init_t' (expressed in s and us)
Definition: time_functions.c:25
@ RED_SDL
Definition: color_sdl.h:18
int no_additional_constraint
1 if additional constraint, 0 otherwise
Definition: realtime.h:106
interface to call C++ functions from C code
int free_simu_realtime(Simu_realtime *realtime)
free the structure of all the real-time constraints
Definition: realtime.c:795
void update_simu_realtime(Simu_realtime *realtime)
update the structure of all the constraints
Definition: realtime.c:860
int mbs_realtime_loop(Simu_realtime *realtime, double tsim)
one loop iteration of the real-time process
Definition: realtime.c:139
double tsim
current simulation time [s]
Definition: realtime.h:114
int final_break
1 to finish with a break, 0 otherwise
Definition: realtime.h:51
double speed_last_tsim
last simulation time [s], to compute the simulation speed
Definition: realtime.h:127
double get_simu_speed_factor(int simu_speed_flag)
get simulation factor depending on the 'simu_speed_flag' flag
Definition: realtime.c:903
double next_tsim_gate
next gate to wait for simulation time [s]
Definition: realtime.h:134
void * realtime
Pointer to Simu_realtime structure.
Definition: mbs_data.h:322
#define REAL_TIME_SPEED_PERIOD_USEC
real time speed factor computation time [s]
Definition: realtime.c:37
int flag_visu
1 if Java visualization features activated, 0 otherwise
Definition: realtime.h:75
colors description, used for the SDL plots
int next_t_usec_gate
next gate to wait for real time [us]
Definition: realtime.h:133
void user_realtime_options(MbsData *mbs_data, Realtime_option *options)
modify the real-time options
Definition: user_realtime_options.c:85
char ** mbs_file
path and file name fot the .mbs file used for Java visualization (for each model)
Definition: realtime.h:79
int first_break
1 if during the first break, 0 otherwise
Definition: realtime.h:139
int init_break
1 to start with a break, 0 otherwise
Definition: realtime.h:50
Realtime_constraint * init_realtime_constraint(int delta_t_usec, int cur_t_usec, double tsim)
initialize one real-time constraint
Definition: realtime.c:544
int buffer_size
size of the buffer for 3D and sdl
Definition: realtime.h:53
external variables and stuctures
Definition: realtime.h:26
Definition: mbs_data.h:149
Real-time constraints main header.
real-time structure
Definition: realtime.h:99
int * nb_q
number of joints in the .mbs used for visualization (for each model)
Definition: realtime.h:78
int free_simu_realtime(Simu_realtime *realtime)
free the structure of all the real-time constraints
Definition: realtime.c:795
void update_simu_realtime(Simu_realtime *realtime)
update the structure of all the constraints
Definition: realtime.c:860
double t0
initial simulation time [s]
Definition: realtime.h:45
int screen_height
plot screen height in number of pixels
Definition: realtime.h:62
MbsData * mbs_data
Robotran main structure.
Definition: realtime.h:36
int max_nb_curves
maximum number of curves plotted
Definition: realtime.h:64
int speed_last_t_usec
last real time [us], to compute the simulation speed
Definition: realtime.h:126
int mbs_realtime_finish(Simu_realtime *realtime)
release memory used for the real-time related functions
Definition: realtime.c:307
void free_Realtime_option(Realtime_option *option)
release memory for the options structure
Definition: realtime.c:416
int flag_plot
1 if SDL plots features activated, 0 otherwise
Definition: realtime.h:58
int simu_speed_flag
used to compute the simulation factor
Definition: realtime.h:105
double pow_int(double basis, int expo)
compute efficiently pow with an integer exponent
Definition: useful_functions.c:60
double init_speed_factor
initial speed factor
Definition: realtime.h:55
void free_Realtime_option(Realtime_option *options)
release memory for the options structure
Definition: realtime.c:416
void compute_buffer_size(Realtime_option *option)
automatically compute the buffer size
Definition: realtime.c:530
@ PURPLE_SDL
Definition: color_sdl.h:18
double get_simu_speed_factor(int simu_speed_flag)
get simulation factor depending on the 'simu_speed_flag' flag
Definition: realtime.c:903
int init_t_usec
initial real time [us], without s (kind of modulo)
Definition: realtime.h:123
double fqc_screen
frequence of the SDL plots refreshment [Hz]
Definition: realtime.h:72
#define DEFAULT_MAX_MODELS
default maximal numbers of models to load
Definition: realtime.c:38
int flag_visu
1 if Java visualization features activated, 0 otherwise
Definition: realtime.h:137
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:44
int nb_constraints
number of real-time constraints
Definition: realtime.h:130
void mbs_warning_msg(char *msg,...)
Send a warning message.
Definition: mbs_message.c:89
int get_simu_speed_flag(double simu_speed_factor)
get the 'simu_speed_flag' flag depending on simulation factor
Definition: realtime.c:924
double last_tsim
last simulation time [s]
Definition: realtime.h:113
int color_tab[NB_COLORS_SDL]
colors of the curves
Definition: realtime.h:70
int start_viewpoint
initial visu viewpoint ID
Definition: realtime.h:81
Realtime_option * init_Realtime_option(MbsData *mbs_data)
generates a real-time options structures with the default values
Definition: realtime.c:331
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:44