Files
1CAR/app/app_request.h

90 lines
1.6 KiB
C

#ifndef APP_REQUEST_H
#define APP_REQUEST_H
#ifdef __cplusplus
extern "C"
{
#endif
#include "app_config.h"
#include "app_differential_drive.h"
#define SWAP_ENDIAN_16(x) ((((x) & 0xFF) << 8) | (((x) >> 8) & 0xFF))
#define SWAP_ENDIAN_32(x) (((x) << 24) | (((x) & 0xFF00) << 8) | (((x) >> 8) & 0xFF00) | ((x) >> 24))
//typedef enum
//{
// MODE_MANUAL, // 手动模式
// MODE_AUTO // 自动模式
//} ControlMode;
//
typedef struct RequestData
{
float desired_speed; // 期望速度
float desired_curvature; // 期望曲率
float left_motor_speed; // 当前左电机速度
float right_motor_speed; // 当前右电机速度
float speed; // 当前车速
float curvature; // 当前曲率
float yaw_rate; // 当前角速度
float desired_yaw_rate; // 期望角速度
float acceleration; // 当前加速度
float deceleration; // 当前减速度
float max_speed; // 最大速度
float desired_acceleration; // 期望加速度
float desired_deceleration; // 期望减速度
float out_left_motor_speed; // 输出左电机速度
float out_right_motor_speed; // 输出右电机速度
} RequestData;
// 声明外部变量
extern DiffData diff_data;
void requestAppInit(void);
#ifdef __cplusplus
}
#endif
#endif // APP_DIFFERENTIAL_DRIVE_H