Robotran C Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Functions
visu_websocket.h File Reference
#include "user_realtime.h"
#include "time_functions.h"
#include "realtime_functions.h"
#include "realtime_ext.h"
#include "realtime.h"
#include "json.h"

Go to the source code of this file.

Macros

#define KEYS_LEN   256
 
#define PORT   9002
 
#define START_VIEWPOINT   0
 default initial viewpoint More...
 
#define FRAMERATE   18.0
 

Functions

int init_websocket (Realtime_visu *visu, MbsData *mbs_data, int nb_models, int *nb_q, double **q_vec, char **mbs_file, char *mbsz_file, int start_viewpoint, int init_break)
 Initialize the communication with the webserver. More...
 
void joints_update (Simu_realtime *realtime, int nb_models, int *nb_q, double **q_vec)
 update the joint values for visualization More...
 
void process_msg (Simu_realtime *realtime)
 
void update_websocket (Simu_realtime *realtime)
 
void free_websocket (void *visu_class)
 close the socket connection More...
 
void update_plot (Simu_realtime *realtime, double tsim)
 

Macro Definition Documentation

◆ FRAMERATE

#define FRAMERATE   18.0

◆ KEYS_LEN

#define KEYS_LEN   256

◆ PORT

#define PORT   9002

◆ START_VIEWPOINT

#define START_VIEWPOINT   0

default initial viewpoint

Function Documentation

◆ free_websocket()

void free_websocket ( void *  visu_class)

close the socket connection

Parameters
[in]visudata

◆ init_websocket()

int init_websocket ( Realtime_visu visu,
MbsData mbs_data,
int  nb_models,
int *  nb_q,
double **  q_vec,
char **  mbs_file,
char *  mbsz_file,
int  start_viewpoint,
int  init_break 
)

Initialize the communication with the webserver.

The simulation starts in pause or runing according to the option in MbsData::realtime::options::init_break.

Parameters
[in]visuThe visualization structure, describing the project.
[in]mbs_dataThe multibody system, used to retrieve realtime options.
[in]nb_modelsThe number of multibody system in the simulation.
[in]nb_qThe number of joint in each multibody system.
[in]q_vecThe initial joints value for each multibody system.
[in]mbs_fileThe multibody files to be loaded.
[in]mbsz_pathThe multibody project file at mbsz project.
[in]start_viewpointThe initia viewpoint index.
[in]init_breakInitialize the simulation paused (!0) or running (1).
Returns
MBS_INFO_SUCCESS, MBS_INFO_WARNING (no mbsz file provided) or MBS_INFO_FAILURE (macro in "mbs_define.h").

◆ joints_update()

void joints_update ( Simu_realtime realtime,
int  nb_models,
int *  nb_q,
double **  q_vec 
)

update the joint values for visualization

◆ process_msg()

void process_msg ( Simu_realtime realtime)

◆ update_plot()

void update_plot ( Simu_realtime realtime,
double  tsim 
)

◆ update_websocket()

void update_websocket ( Simu_realtime realtime)