user_realtime_visu.c 1.74 KB
Newer Older
1
2
3
4
/*!
 * \author Nicolas Van der Noot
 * \file user_realtime_visu.c
 * \brief Java visualization configuration
5
6
7
8
9
10
11
12
13
14
15
 * 
 * \attention xxx
 * \pre xxx
 * \param[in/out/in,out] name xxx
 * \return xxx
 *
 * In order to use C++ features, you just need to change the extension of this file (.c) to .cc (or .cpp).
 */

#ifdef JAVA

Nicolas Van der Noot's avatar
Nicolas Van der Noot committed
16
#include "user_realtime.h"
17
18
19

/*! \brief Java visualization user configuration
 * 
Nicolas Van der Noot's avatar
Nicolas Van der Noot committed
20
 * \param[in] mbs_data Robotran main structure
21
22
23
24
25
26
27
 * \param[in] nb_q number of joints in the .mbs file
 * \param[out] q_vec vector to fill with the positions
 *
 * Fill q_vec[i] with the corresponding values for the joints ([rad] for rotational joints,
 *      [m] for translational joints). i-1 is the index of the joint indicated in the .mbs file
 *      used for the visualization (pay attention to the -1 !). If you want to know the number
 *      of joints to fill, print 'nb_q'. Do not use indexes below '0' or above 'nb_q-1'.
Nicolas Van der Noot's avatar
Nicolas Van der Noot committed
28
29
30
31
32
 *
 * 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.
 * For instance, it can be used to display extra bodies (like moving arrows)
33
 * on top of the ones used by Robotran dynamics.
Nicolas Van der Noot's avatar
Nicolas Van der Noot committed
34
35
36
37
 * In this case, create a 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 = NEW_PATH_WITH_MBS_FILE;'. You must also adapt 'options->nb_q'.
 * Finally, modify the 'user_realtime_visu' function accordingly.
38
 */
Nicolas Van der Noot's avatar
Nicolas Van der Noot committed
39
void user_realtime_visu(MbsData* mbs_data, int nb_q, double *q_vec)
40
{
41
	int i;
42

43
44
45
46
	for(i=1; i<=nb_q; i++)
	{
		q_vec[i-1] = mbs_data->q[i];
	}
47
48
49
}

#endif