43 lines
1.4 KiB
C
43 lines
1.4 KiB
C
|
|
#ifndef CORRIDOR_PREPROC_H
|
|||
|
|
#define CORRIDOR_PREPROC_H
|
|||
|
|
|
|||
|
|
#include <stdint.h>
|
|||
|
|
#include <stdbool.h>
|
|||
|
|
#include "Contract/robot_blackboard.h"
|
|||
|
|
#include "corridor_msgs.h"
|
|||
|
|
|
|||
|
|
/* 传感器有效性掩码定义 (对应 CorridorObs_t.valid_mask) */
|
|||
|
|
#define CORRIDOR_OBS_MASK_LF (1U << 0) // 左前有效
|
|||
|
|
#define CORRIDOR_OBS_MASK_LR (1U << 1) // 左后有效
|
|||
|
|
#define CORRIDOR_OBS_MASK_RF (1U << 2) // 右前有效
|
|||
|
|
#define CORRIDOR_OBS_MASK_RR (1U << 3) // 右后有效
|
|||
|
|
#define CORRIDOR_OBS_MASK_FRONT (1U << 4) // 前方互补测距有效
|
|||
|
|
#define CORRIDOR_OBS_MASK_BACK (1U << 5) // 后方互补测距有效
|
|||
|
|
|
|||
|
|
/* VL53L0X 侧向雷达的物理有效探测区间 (m) */
|
|||
|
|
#define PREPROC_MAX_SIDE_RANGE_M 2.0f
|
|||
|
|
#define PREPROC_MIN_SIDE_RANGE_M 0.02f
|
|||
|
|
|
|||
|
|
/* 前后向雷达近战盲区阈值 (m) (STP 7cm盲区 + 1cm工程裕量) */
|
|||
|
|
#define PREPROC_BLIND_ZONE_M 0.08f
|
|||
|
|
|
|||
|
|
/* 前后激光传感器内缩补偿 (从 robot_params.h 引入) */
|
|||
|
|
#include "robot_params.h"
|
|||
|
|
|
|||
|
|
#ifdef __cplusplus
|
|||
|
|
extern "C" {
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* @brief 从黑板快照中提取、仲裁并清洗走廊观测数据
|
|||
|
|
* @param board 输入的黑板数据快照
|
|||
|
|
* @param now_ms 当前的系统时间戳
|
|||
|
|
* @param out_obs 输出的清洗后观测值 (仅保留合法数据,单位统一为 m)
|
|||
|
|
*/
|
|||
|
|
void CorridorPreproc_ExtractObs(const RobotBlackboard_t *board, uint32_t now_ms, CorridorObs_t *out_obs);
|
|||
|
|
|
|||
|
|
#ifdef __cplusplus
|
|||
|
|
}
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
#endif // CORRIDOR_PREPROC_H
|