-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser_dirdyn.c
67 lines (62 loc) · 1.94 KB
/
user_dirdyn.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/** ---------------------------
* Robotran - MBsysC
*
* Template file for direct dynamics module
*
* This files enable the user to call custom at
* specific places in the time simulation. It is a template
* file that can be edited by the user.
*
* (c) Universite catholique de Louvain
*
*/
#include "math.h"
#include "MBSdef.h"
#include "mbs_data.h"
#include "mbs_dirdyn.h"
#include "user_realtime.h"
#include "cpp_interface_gestion.h"
#include "robot_id.h"
#include "user_all_id.h"
#include "set_output.h"
#include <math.h>
#define DEG_TO_RAD (M_PI/180.0)
#define RAD_TO_DEG (180.0/M_PI)
/*! \brief user own initialization functions
*
* \param[in,out] mbs_data data structure of the model
* \param[in,out] mbs_dd general structure of the direct dynamic module (for advance users)
*
* For beginners, it is advised to only use the MbsData structure.
* The field MbsDirdyn is provided for more advance users.
*/
void user_dirdyn_init(MbsData *mbs_data, MbsDirdyn *mbs_dd)
{
simu_init(mbs_data);
}
/*! \brief user own loop functions
*
* \param[in,out] mbs_data data structure of the model
* \param[in,out] mbs_dd general structure of the direct dynamic module (for advance users)
*
* For beginners, it is advised to only use the MbsData structure.
* The field MbsDirdyn is provided for more advance users.
*/
void user_dirdyn_loop(MbsData *mbs_data, MbsDirdyn *mbs_dd)
{
simu_loop(mbs_data);
set_plot(mbs_data->qd[Right_wheel_joint_B_id], "R wheel [rad/s]");
set_plot(mbs_data->qd[Left_wheel_joint_B_id], "L wheel [rad/s]");
}
/*! \brief user own finishing functions
*
* \param[in,out] mbs_data data structure of the model
* \param[in,out] mbs_dd general structure of the direct dynamic module (for advance users)
*
* For beginners, it is advised to only use the MbsData structure.
* The field MbsDirdyn is provided for more advance users.
*/
void user_dirdyn_finish(MbsData *mbs_data, MbsDirdyn *mbs_dd)
{
simu_finish(mbs_data);
}