59 lines
1.1 KiB
C++
59 lines
1.1 KiB
C++
#ifndef GIMBAL_HPP
|
|
#define GIMBAL_HPP
|
|
|
|
#include "GO_M8010_6_Driver.h"
|
|
#include "djiMotor.h"
|
|
#include "pid.h"
|
|
#include "nuc.h"
|
|
|
|
#define GM6020ING 1
|
|
class Gimbal
|
|
{
|
|
public:
|
|
Gimbal();
|
|
void gimbalFlow(void);//云台随遥控器转动
|
|
void gimbalZero(void);//云台零阻尼模式
|
|
void gimbalInit(void);//go初始化
|
|
void gimbalVision(const NUC_t &nuc); // 接收 NUC_t 数据
|
|
|
|
int16_t result;
|
|
//暂存要发送的扭矩
|
|
//float result[GO_NUM];
|
|
// float Kp;
|
|
// float Kd;
|
|
private:
|
|
|
|
#if GM6020ING == 1
|
|
//GM6020电机数据
|
|
motor_measure_t *GM6020_Motor;
|
|
|
|
static const float Gimbal_speed_PID[3];
|
|
static const float Gimbal_angle_PID[3];
|
|
|
|
//电机速度pid结构体
|
|
pid_type_def speed_pid;
|
|
//位置环pid
|
|
pid_type_def angle_pid;
|
|
|
|
float angleSet;
|
|
|
|
#else
|
|
motor_measure_t *motorData[GO_NUM];
|
|
//视觉发送的要调的角度
|
|
float self_angleSet;
|
|
GO_Motorfield* goData[GO_NUM];
|
|
//暂存目标位置
|
|
float angleSet[GO_NUM];
|
|
float offestAngle[GO_NUM];//go数据
|
|
float Kp;
|
|
float Kd;
|
|
float allowRange;
|
|
|
|
#endif
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|