forked from cvra/nastya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
control.h
58 lines (53 loc) · 1.39 KB
/
control.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
#ifndef CONTROL_H
#define CONTROL_H
#include <stdint.h>
#include <stdbool.h>
#include <control_system_manager/control_system_manager.h>
#include <pid/pid.h>
#include <param/param.h>
struct holonomic_base_speed_cs {
param_t vxy_pid_P;
param_t vxy_pid_I;
param_t vxy_pid_D;
param_t vxy_pid_D_filt;
param_t vxy_pid_I_bound;
param_t vx_pid_P;
param_t vx_pid_I;
param_t vx_pid_D;
param_t vx_pid_D_filt;
param_t vx_pid_I_bound;
param_t vy_pid_P;
param_t vy_pid_I;
param_t vy_pid_D;
param_t vy_pid_D_filt;
param_t vy_pid_I_bound;
param_t omega_pid_P;
param_t omega_pid_I;
param_t omega_pid_D;
param_t omega_pid_D_filt;
param_t omega_pid_I_bound;
bool vx_control_enable;
bool vy_control_enable;
bool omega_control_enable;
struct cs vx_cs;
struct cs vy_cs;
struct cs omega_cs;
struct pid_filter vx_pid;
struct pid_filter vy_pid;
struct pid_filter omega_pid;
float vx;
float vy;
float omega;
int32_t out_x;
int32_t out_y;
int32_t out_rotation;
};
extern struct holonomic_base_speed_cs nastya_cs;
void control_update_setpoint_vx(float x);
void control_update_setpoint_vy(float y);
void control_update_setpoint_omega(float r);
float control_get_setpoint_vx(void);
float control_get_setpoint_vy(void);
float control_get_setpoint_omega(void);
void control_init(void);
#endif // CONTROL_H