|
Robotran C Documentation
|
Go to the documentation of this file.
18 #define PERIOD_BACK_IN_VISU 0.03 // [s]
19 #define INTERRUPT_BACK_IN_VISU 0.25 // [s]
double next_tsim
next gate to wait for simulation time [s]
Definition: mbs_realtime_struct.h:127
double real_simu_speed_factor
real speed factor
Definition: mbs_realtime_struct.h:143
int simu_break
1 to make a break, 0 otherwise
Definition: mbs_realtime_struct.h:137
#define MBS_INFO_FAILURE
Definition: mbs_define.h:32
void mbs_msg(const char *msg,...)
Send a message.
Definition: mbs_message.c:87
user real-time option
Definition: mbs_realtime_struct.h:86
Realtime_option * options
user options
Definition: mbs_realtime_struct.h:179
char * mbsz_file
Filepath to the mbsz project to be send at the socket initialization.
Definition: mbs_realtime_struct.h:113
double dt0
simulation time step [s]
Definition: mbs_realtime_struct.h:91
double tf
final simulation time [s]
Definition: mbs_realtime_struct.h:90
#define USEC_TO_SEC
factor from us to s
Definition: realtime.c:24
int get_simu_speed_flag(double simu_speed_factor)
get the 'simu_speed_flag' flag depending on simulation factor
Definition: realtime.c:765
functions used to automatically update the user curves plotted
Realtime_constraint * init_realtime_constraint(int delta_t_usec, int cur_t_usec, double tsim)
initialize one real-time constraint
Definition: realtime.c:386
char * mbs_filename
Path to mbs file including the file with the extension (.mbs)
Definition: mbs_data.h:421
int check_user_realtime_options(Realtime_option *options)
check that the modifications performed by the user on the options are correct
Definition: realtime.c:306
int buffer_size
size of the buffer for 3D and sdl
Definition: mbs_realtime_struct.h:153
void update_realtime_constraint(Realtime_constraint *constraint, int simu_speed_flag)
update one real-time constraint
Definition: realtime.c:680
#define MSG_PRE
Definition: realtime.c:22
Simu_realtime * init_realtime(MbsData *mbs_data, Realtime_option *options, int *err)
initialize the real-time structure
Definition: realtime.c:411
int njoint
Number of joints in the system.
Definition: mbs_data.h:260
int mbs_realtime_init(MbsData *mbs_data, double t0, double tf, double dt0, int init_break)
initialize the real-time structures
Definition: realtime.c:39
int next_t_usec
next gate to wait for real time [us]
Definition: mbs_realtime_struct.h:126
void mbs_realtime_update(Simu_realtime *realtime, double tsim)
update save vectors for past investigations (graphs and Java visualization)
Definition: realtime.c:89
int init_t_sec
initial real time [s], without us
Definition: mbs_realtime_struct.h:156
void time_get(int *t_sec, int *t_usec)
return the absolute time of the computer
Definition: time_functions.c:10
void mbs_warning_msg(const char *msg,...)
Send a warning message.
Definition: mbs_message.c:100
void update_realtime_constraints_break(Simu_realtime *realtime, int delta_break_u_sec)
update the real-time constraints after a break
Definition: realtime.c:793
int last_break
1 to indicate last break, 0 otherwise
Definition: mbs_realtime_struct.h:138
int simu_quit
1 to quit the simulation, 0 otherwise
Definition: mbs_realtime_struct.h:136
void free_realtime_constraint(Realtime_constraint *constraint)
free one real-time constraint
Definition: realtime.c:626
#define _MBS_ERR_INIT
Generic error number Check user options at initialization = -10.
Definition: mbs_errors_names.h:166
double last_real_simu_speed_factor
last real speed factor
Definition: mbs_realtime_struct.h:144
void user_call_realtime_options(MbsData *mbs_data, Realtime_option *options)
Definition: mbs_project_fct_ptr.c:579
int delta_t_usec
delta time between to gates for real time [us]
Definition: mbs_realtime_struct.h:125
Real-time constraints header for external modules.
void mbs_realtime_update(Simu_realtime *realtime, double tsim)
update save vectors for past investigations (graphs and Java visualization)
Definition: realtime.c:89
int check_user_realtime_options(Realtime_option *options)
check that the modifications performed by the user on the options are correct
Definition: realtime.c:306
double t0
initial simulation time [s]
Definition: mbs_realtime_struct.h:150
#define MSG_ERR
Definition: realtime.c:21
Simu_realtime * realtime
Pointer to Simu_realtime structure.
Definition: mbs_data.h:430
int mbs_realtime_finish(Simu_realtime *realtime)
release memory used for the real-time related functions
Definition: realtime.c:213
int mbs_realtime_loop(Simu_realtime *realtime, double tsim)
one loop iteration of the real-time process
Definition: realtime.c:108
void update_realtime_constraint(Realtime_constraint *constraint, int simu_speed_flag)
update one real-time constraint
Definition: realtime.c:680
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:226
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:435
struct Functions::@4 user
void update_realtime_constraints_break(Simu_realtime *realtime, int delta_break_u_sec)
update the real-time constraints after a break
Definition: realtime.c:793
Realtime_visu * init_realtime_visu(void *realtime_options, MbsData *mbs_data, int *err)
initialize 3D real-time variables
Definition: realtime_ext.c:26
void update_websocket(Simu_realtime *realtime)
Definition: visu_websocket.cc:411
AutoPlot * auto_plot
automatic user plot update structure
Definition: mbs_realtime_struct.h:78
Realtime_extern * ext
external variables
Definition: mbs_realtime_struct.h:177
#define NB_REAL_TIME_CONSTRAINTS
number of real-time constraints
Definition: realtime.c:26
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:435
int nb_models
number of models to load
Definition: mbs_realtime_struct.h:108
double tf
final simulation time [s]
Definition: mbs_realtime_struct.h:151
Realtime_constraint ** constraints
structures of multiple real-time constraints
Definition: mbs_realtime_struct.h:175
double fqc_visu
frequence of the 3D visualization refreshment [Hz]
Definition: mbs_realtime_struct.h:117
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:372
#define DEFAULT_DELTA_T_USEC
default time between 2 refresh moments (in us)
Definition: realtime.c:25
void free_realtime_constraint(Realtime_constraint *constraint)
free one real-time constraint
Definition: realtime.c:626
one constraint strcuture
Definition: mbs_realtime_struct.h:123
int flag_plot
1 if SDL plots features activated, 0 otherwise
Definition: mbs_realtime_struct.h:170
Simu_realtime * init_realtime(MbsData *mbs_data, Realtime_option *options, int *err)
initialize the real-time structure
Definition: realtime.c:411
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:24
int no_additional_constraint
1 if additional constraint, 0 otherwise
Definition: mbs_realtime_struct.h:140
user_realtime_options_ptr user_realtime_options
Definition: mbs_data.h:184
Functions fct
Structure to store the pointer to the project-specific functions.
Definition: mbs_data.h:426
int free_realtime_visu(Realtime_visu *visu)
free 3D real-time structure
Definition: realtime_ext.c:285
int free_simu_realtime(Simu_realtime *realtime)
free the structure of all the real-time constraints
Definition: realtime.c:636
void update_simu_realtime(Simu_realtime *realtime)
update the structure of all the constraints
Definition: realtime.c:701
int mbs_realtime_loop(Simu_realtime *realtime, double tsim)
one loop iteration of the real-time process
Definition: realtime.c:108
double tsim
current simulation time [s]
Definition: mbs_realtime_struct.h:148
int final_break
1 to finish with a break, 0 otherwise
Definition: mbs_realtime_struct.h:95
double speed_last_tsim
last simulation time [s], to compute the simulation speed
Definition: mbs_realtime_struct.h:161
double get_simu_speed_factor(int simu_speed_flag)
get simulation factor depending on the 'simu_speed_flag' flag
Definition: realtime.c:744
double next_tsim_gate
next gate to wait for simulation time [s]
Definition: mbs_realtime_struct.h:168
#define REAL_TIME_SPEED_PERIOD_USEC
real time speed factor computation time [s]
Definition: realtime.c:27
int flag_visu
1 if Java visualization features activated, 0 otherwise
Definition: mbs_realtime_struct.h:106
int next_t_usec_gate
next gate to wait for real time [us]
Definition: mbs_realtime_struct.h:167
char ** mbs_file
path and file name for the .mbs file used for Java visualization (for each model)
Definition: mbs_realtime_struct.h:110
int first_break
1 if during the first break, 0 otherwise
Definition: mbs_realtime_struct.h:173
int init_break
1 to start with a break, 0 otherwise
Definition: mbs_realtime_struct.h:94
Realtime_constraint * init_realtime_constraint(int delta_t_usec, int cur_t_usec, double tsim)
initialize one real-time constraint
Definition: realtime.c:386
int buffer_size
size of the buffer for 3D and sdl
Definition: mbs_realtime_struct.h:97
external variables and stuctures
Definition: mbs_realtime_struct.h:73
Definition: mbs_data.h:247
Real-time constraints main header.
real-time structure
Definition: mbs_realtime_struct.h:133
int * nb_q
number of joints in the .mbs used for visualization (for each model)
Definition: mbs_realtime_struct.h:109
int free_simu_realtime(Simu_realtime *realtime)
free the structure of all the real-time constraints
Definition: realtime.c:636
void update_simu_realtime(Simu_realtime *realtime)
update the structure of all the constraints
Definition: realtime.c:701
double t0
initial simulation time [s]
Definition: mbs_realtime_struct.h:89
MbsData * mbs_data
Robotran main structure.
Definition: mbs_realtime_struct.h:80
int max_nb_curves
maximum number of curves plotted
Definition: mbs_realtime_struct.h:103
int speed_last_t_usec
last real time [us], to compute the simulation speed
Definition: mbs_realtime_struct.h:160
int mbs_realtime_finish(Simu_realtime *realtime)
release memory used for the real-time related functions
Definition: realtime.c:213
void free_Realtime_option(Realtime_option *option)
release memory for the options structure
Definition: realtime.c:288
int flag_plot
1 if SDL plots features activated, 0 otherwise
Definition: mbs_realtime_struct.h:102
int simu_speed_flag
used to compute the simulation factor
Definition: mbs_realtime_struct.h:139
double pow_int(double basis, int expo)
compute efficiently pow with an integer exponent
Definition: useful_functions.c:68
double init_speed_factor
initial speed factor
Definition: mbs_realtime_struct.h:99
void free_Realtime_option(Realtime_option *options)
release memory for the options structure
Definition: realtime.c:288
void compute_buffer_size(Realtime_option *option)
automatically compute the buffer size
Definition: realtime.c:372
double get_simu_speed_factor(int simu_speed_flag)
get simulation factor depending on the 'simu_speed_flag' flag
Definition: realtime.c:744
int init_t_usec
initial real time [us], without s (kind of modulo)
Definition: mbs_realtime_struct.h:157
#define DEFAULT_MAX_MODELS
default maximal numbers of models to load
Definition: realtime.c:28
int flag_visu
1 if Java visualization features activated, 0 otherwise
Definition: mbs_realtime_struct.h:171
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:34
int nb_constraints
number of real-time constraints
Definition: mbs_realtime_struct.h:164
int get_simu_speed_flag(double simu_speed_factor)
get the 'simu_speed_flag' flag depending on simulation factor
Definition: realtime.c:765
double last_tsim
last simulation time [s]
Definition: mbs_realtime_struct.h:147
int mbs_realtime_init(MbsData *mbs_data, double t0, double tf, double dt0, int init_break)
initialize the real-time structures
Definition: realtime.c:39
Realtime_visu * visu
Java structure.
Definition: mbs_realtime_struct.h:76
int start_viewpoint
initial visu viewpoint ID
Definition: mbs_realtime_struct.h:115
Realtime_option * init_Realtime_option(MbsData *mbs_data)
generates a real-time options structures with the default values
Definition: realtime.c:226
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:34