From 2efc1e837530c825f4dade6d6c04c8bad9d0f8a4 Mon Sep 17 00:00:00 2001 From: JasonChen <2805998671@qq.com> Date: Wed, 17 Jul 2024 21:30:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B0=8F=E8=BD=A6=E5=B7=A1=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- User/Inc/path_plan.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 User/Inc/path_plan.h diff --git a/User/Inc/path_plan.h b/User/Inc/path_plan.h new file mode 100644 index 0000000..3cb03cd --- /dev/null +++ b/User/Inc/path_plan.h @@ -0,0 +1,29 @@ +#ifndef __PATH_PLAN_H +#define __PATH_PLAN_H + +// 定义方向枚举 +typedef enum +{ + STRAIGHT, + LEFT, + RIGHT, + STOP +} Direction; + +// 定义路径规划器结构 +typedef struct +{ + int currentStep; + Direction* path; + int pathLength; +} PathPlanner; + +// 全局路径规划器 +extern PathPlanner pathPlanner; + +void PathPlanner_Init(); +Direction GetCurrentDirection(); +Direction GetNextDirection(); +void AddPathStep(Direction step); + +#endif