Robotran C Documentation
Functions
user_realtime_visu.c File Reference

Java visualization configuration. More...

#include "mbs_data.h"

Functions

void user_realtime_visu (MbsData *mbs_data, int nb_models, int *nb_q, double **q_vec)
 Java visualization user configuration. More...
 

Detailed Description

Java visualization configuration.

Author
Nicolas Van der Noot

In order to use C++ features, you just need to change the extension of this file (.c) to .cc (or .cpp).

Function Documentation

◆ user_realtime_visu()

void user_realtime_visu ( MbsData mbs_data,
int  nb_models,
int *  nb_q,
double **  q_vec 
)

Java visualization user configuration.

Parameters
[in]mbs_dataRobotran main structure
[in]nb_modelsnumber of models (.mbs files) loaded for visualization
[in]nb_qnumber of joints in the .mbs file (for each model)
[out]q_vecvector to fill with the positions (for each model)

Fill q_vec[i][j] with the corresponding values for the joints ([rad] for rotational joints, [m] for translational joints). j-1 is the index of the joint j indicated in the corresponding .mbs file used for the visualization (pay attention to the -1 !). If you want to know the number of joints to fill for model 'i', print 'nb_q[i]'. Do not use indexes below '0' or above 'nb_q[i]-1'.

This file is initially configured to work with the .mbs file located in dataR. Modifying this file is only useful if you want to display something else than the model used to compute the dynamics with Robotran (or if you want to combine different models). For instance, it can be used to display extra bodies (like moving arrows) on top of the ones used by Robotran dynamics. In this case, create one (or more) new .mbs file (on top of the one in dataR) only used for visualization. Place it somewhere in your project and indicate its path in 'user_realtime_options.c' as 'options->mbs_file[i] = NEW_PATH_WITH_MBS_FILE;'. You must also adapt 'options->nb_q[i]'. Finally, modify the 'user_realtime_visu' function accordingly.