2020-02-26 18:51:46 +01:00
|
|
|
#include "PID_v2.h"
|
2020-02-29 22:10:53 +01:00
|
|
|
|
|
|
|
#include "position/systems.h"
|
2020-02-21 13:37:32 +01:00
|
|
|
|
2020-03-02 20:45:48 +01:00
|
|
|
#define CAMERA_CENTER_X 10
|
|
|
|
#define CAMERA_CENTER_Y -13
|
2020-02-27 17:30:10 +01:00
|
|
|
#define CAMERA_CENTER_Y_ABS_SUM 72
|
2020-02-28 16:45:28 +01:00
|
|
|
//Actually it's ± MAX_VAL
|
|
|
|
#define MAX_X 25
|
|
|
|
#define MAX_Y (CAMERA_CENTER_Y_ABS_SUM/2)
|
|
|
|
#define DIST_MULT 1.65
|
2020-02-26 18:51:46 +01:00
|
|
|
|
|
|
|
#define Kpx 1
|
|
|
|
#define Kix 0
|
|
|
|
#define Kdx 0
|
|
|
|
#define Kpy 1
|
|
|
|
#define Kiy 0
|
|
|
|
#define Kdy 0
|
2020-02-21 13:37:32 +01:00
|
|
|
|
|
|
|
class PositionSysCamera : public PositionSystem{
|
|
|
|
|
|
|
|
public:
|
|
|
|
PositionSysCamera();
|
|
|
|
void goCenter();
|
|
|
|
void update() override;
|
|
|
|
void test() override;
|
2020-02-26 18:51:46 +01:00
|
|
|
void setCameraPID();
|
|
|
|
void CameraPID();
|
2020-02-27 17:30:10 +01:00
|
|
|
int calcOtherGoalY(int goalY);
|
2020-02-26 18:51:46 +01:00
|
|
|
|
|
|
|
double Inputx, Outputx, Setpointx, Inputy, Outputy, Setpointy;
|
2020-02-28 16:45:28 +01:00
|
|
|
int MAX_DIST;
|
2020-02-26 18:51:46 +01:00
|
|
|
PID* X;
|
|
|
|
PID* Y;
|
2020-02-21 13:37:32 +01:00
|
|
|
|
|
|
|
};
|