-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.h
67 lines (53 loc) · 1.31 KB
/
main.h
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
/*
* main.h
*
* Created on: 2018. 7. 19.
* Author: Administrator
*/
#ifndef MAIN_H_
#define MAIN_H_
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <errno.h>
#include <termios.h>
#include <sys/mman.h>
#include <native/task.h>
#include <native/timer.h>
#include <native/queue.h>
#include <rtdk.h>
#include "NRMKsercan_tp.h"
#include "NRMKhw_tp.h"
#include "can_define.h"
#include "control/Kinematics.h"
#include "control/Controller.h"
#include "Network/KeyboardHandler.h"
#include "Network/TCPClientHandler.h"
#define PRINT_COUNT 100
#define JOINT_SET_POINT 400000
#define CONTROL_MODE_TORQUE 0
#define HOMMING_ON 1
#define RadTODeg 180/M_PI
#define DegTORad M_PI/180
typedef struct StateInfo{
float dq[NUM_CLIENT];
float aq[NUM_CLIENT];
float atoq[NUM_CLIENT];
float dt, control_dt, worst_dt;
int enc_pos[NUM_CLIENT];
int enc_pos_offset[NUM_CLIENT];
int enc_vel[NUM_CLIENT];
int toq[NUM_CLIENT];
int status[NUM_CLIENT];
StatusInfo StatusWord[NUM_CLIENT];
RTIME point1, point2, point3;
double systime;
int systime_min;
short int16_val[NUM_CLIENT];
int int32_val[NUM_CLIENT];
}StateInfo;
typedef struct MotorInfo{
float rate_torque[NUM_CLIENT];
float gear_ratio[NUM_CLIENT];
}MotorInfo;
#endif /* MAIN_H_ */