Robotran C Documentation
realtime_ext.h
Go to the documentation of this file.
1 
7 #ifdef REAL_TIME
8 
9 #ifndef _REAL_TIME_EXT_
10 #define _REAL_TIME_EXT_
11 
12 #include "mbs_data.h"
13 
14 // -- Structures -- //
15 
16 #define SAFETY_TIME 0.001
17 
18 
21 #ifdef SDL
22 typedef struct Realtime_sdl
23 {
24  int mouse_init_x;
25  int mouse_init_y;
26  int mouse_delta_x;
27  int mouse_delta_y;
28  int mouse_cur_x;
29  int mouse_cur_y;
30  int mouse_wheel_flag;
31  int start_mouse_usec;
32  int last_action_break_usec;
33  int next_user_keyboard_event_usec;
34  int next_generic_keyboard_event_usec;
35  int last_mouse_event_usec;
36  int mouse_left_pressed;
37  int mouse_right_pressed;
38 
39  void *screen_sdl;
40 
41 } Realtime_sdl;
42 #endif
43 
46 #ifdef VISU_3D
47 typedef struct Realtime_visu
48 {
49  int nb_models;
50  int buffer_size;
51  int change_viewpoint;
52  int cur_viewpoint;
53  int nb_viewpoint;
54  int visu_past_flag;
55  int flag_t_last_past;
56  double t_visu_past;
57  double t_last_past;
58  int flag_buffer_round;
59  int last_past_q_flag;
60 
61  int *nb_q;
62  char **mbs_file;
63  double *tsim_save;
64  double ***q_save;
65 
66  int min_tsim_index;
67  int max_tsim_index;
68  double min_tsim;
69  double max_tsim;
70 
71  double cur_tsim;
72  double **cur_q;
73  double **past_q;
74  double **anim_q;
75 
76  void *visu_class;
77 
78 } Realtime_visu;
79 #endif
80 
81 // -- Functions prototypes -- //
82 
83 #ifdef SDL
84 Realtime_sdl* init_realtime_sdl(void *screen_sdl);
85 void free_realtime_sdl(Realtime_sdl *sdl);
86 #endif
87 
88 #ifdef VISU_3D
89 Realtime_visu* init_realtime_visu(void *realtime_options, MbsData* mbs_data, int *err);
90 int free_realtime_visu(Realtime_visu *visu);
91 #endif
92 
93 #endif
94 #endif
Simu_realtime::simu_break
int simu_break
1 to make a break, 0 otherwise
Definition: realtime.h:103
Realtime_option
user real-time option
Definition: realtime.h:42
mbs_data.h
Simu_realtime::init_t_sec
int init_t_sec
initial real time [s], without us
Definition: realtime.h:122
java_functions.h
Java functions used for the visualization.
Simu_realtime::last_break
int last_break
1 to indicate last break, 0 otherwise
Definition: realtime.h:104
realtime_ext.h
Real-time constraints header for external modules.
SAFETY_TIME
#define SAFETY_TIME
safety time: difference between min and max time in case of problems [s]
Definition: realtime_ext.h:16
mbs_msg
void mbs_msg(char *msg,...)
Send a message.
Definition: mbs_message.c:76
plot_sdl.h
main SDL functions (plot curves and handles keyboard, joystick... inputs)
Realtime_option::nb_models
int nb_models
number of models to load
Definition: realtime.h:77
time_functions.h
functions used to get the time expressed in us (micro seconds)
t_usec
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
open_gl_c_int.h
interface to call C++ functions from C code
mbs_message.h
Realtime_option::mbs_file
char ** mbs_file
path and file name fot the .mbs file used for Java visualization (for each model)
Definition: realtime.h:79
Realtime_option::buffer_size
int buffer_size
size of the buffer for 3D and sdl
Definition: realtime.h:53
MbsData
Definition: mbs_data.h:149
realtime.h
Real-time constraints main header.
Simu_realtime
real-time structure
Definition: realtime.h:99
Realtime_option::nb_q
int * nb_q
number of joints in the .mbs used for visualization (for each model)
Definition: realtime.h:78
Realtime_option::t0
double t0
initial simulation time [s]
Definition: realtime.h:45
events_sdl.h
Simu_realtime::init_t_usec
int init_t_usec
initial real time [us], without s (kind of modulo)
Definition: realtime.h:123
user_realtime.h
Realtime_option::start_viewpoint
int start_viewpoint
initial visu viewpoint ID
Definition: realtime.h:81