Files
ASER-NAV/App/nav/corridor_ctrl.h

53 lines
1.9 KiB
C
Raw Normal View History

#ifndef CORRIDOR_CTRL_H
#define CORRIDOR_CTRL_H
#include "preproc/corridor_msgs.h"
/**
* @brief
* @note "从小往大调"
*/
typedef struct {
float kp_theta; // 航向偏差比例增益 (rad/s per rad)
float kd_theta; // 航向偏差微分增益 (rad/s per rad/s) [阻尼项]
float kp_y; // 横向偏差比例增益 (rad/s per m)
float v_cruise; // 走廊内巡航线速度 (m/s)
float w_max; // 角速度输出硬限幅 (rad/s),超过此值一律削峰
float v_max; // 线速度输出硬限幅 (m/s)
float speed_reduction_k; // 弯道减速系数 (0~1),公式: v = v_cruise*(1-k*|w/w_max|)
float exit_front_dist; // 出沟检测距离 (m),前激光小于此值时禁用左右激光控制
float wall_escape_dist; // 近墙脱离阈值 (m),小于此值触发直接远离墙面
float wall_escape_kp; // 近墙脱离增益 (rad/s per m)
float wall_escape_w_max; // 近墙脱离角速度限幅 (rad/s)
} CorridorCtrlConfig_t;
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief
* @param config
*/
void CorridorCtrl_Init(const CorridorCtrlConfig_t *config);
/**
* @brief
* @param state (e_y, e_th, conf)
* @param obs ( d_front )
* @param imu_wz IMU Z轴角速度 (rad/s)
* @param out_cmd (v, w)
*/
void CorridorCtrl_Compute(const CorridorState_t *state,
const CorridorObs_t *obs,
float imu_wz,
RawCmd_t *out_cmd);
#ifdef __cplusplus
}
#endif
#endif // CORRIDOR_CTRL_H