r1upper/User/module/motor.hpp
2025-04-12 15:18:06 +08:00

38 lines
655 B
C++

#ifndef MOTOR_HPP
#define MOTOR_HPP
#include "djiMotor.h"
#include "pid.h"
typedef enum
{
ZER0 = 0,
// POINT_TOP = 360,
}Trigger_state;//存放位置宏定义
class Trigger
{
public:
Trigger();//构造函数声明
void triggerZero();
void triggerFlow(float angle);
//暂存要发送的电流
int16_t result;
//电机状态
private:
motor_measure_t* T_Motor;
//扳机3508pid
static const float Trigger_speed_PID[3];
static const float Trigger_angle_PID[3];
//电机速度pid结构体
pid_type_def speed_pid;
//位置环pid
pid_type_def angle_pid;
float angleSet;
};
#endif