| name | navigation |
| description | 轮式车辆导航系统 - 全局路径规划、局部路径规划、轨迹跟踪、动态避障 |
| argument-hint | 车辆导航 OR 路径规划 OR 轨迹跟踪 OR 动态避障 |
| user-invocable | true |
轮式车辆导航技能
用于开发轮式车辆的导航和路径规划系统
何时使用
当需要以下帮助时使用此技能:
- 全局路径规划
- 局部轨迹规划
- 轨迹跟踪控制
- 动态障碍物避障
快速参考
导航配置
wheeled_vehicle_navigation:
global_planner:
type: A* / Dijkstra / Hybrid_A*
local_planner:
type: DWA / MPC / EM
controller:
type: PurePursuit / Stanley / MPC
speed:
max: 30
cruise: 20
min: 5
全局规划
Hybrid A* 路径规划
class HybridAStar:
def __init__(self):
self.grid_resolution = 0.5
self.angle_resolution = 15
def plan(self, start, goal, vehicle_params):
"""Hybrid A* 路径规划"""
state_lattice = StateLattice(self.grid_resolution,
self.angle_resolution)
path = self.search(state_lattice, start, goal)
smoothed = self.smooth(path)
return smoothed
轨迹跟踪
Pure Pursuit 跟踪
class PurePursuitController:
def __init__(self, lookahead_dist=5.0):
self.lookahead = lookahead_dist
self.wheelbase = 2.5
def compute_steering(self, pose, trajectory):
"""计算转向角"""
lookahead_point = self.find_lookahead_point(pose, trajectory)
dx = lookahead_point.x - pose.x
dy = lookahead_point.y - pose.y
alpha = atan2(dy, dx) - pose.theta
steering = atan2(2 * self.wheelbase * sin(alpha),
self.lookahead)
return steering
动态避障
MPC 避障
class MPCObstacleAvoidance:
def __init__(self):
self.horizon = 20
self.dt = 0.1
def compute_control(self, state, obstacles, reference_path):
"""MPC 避障控制"""
J = 0
constraints = []
for t in range(self.horizon):
J += self跟踪代价(state, reference_path, t)
J += self障碍物代价(state, obstacles, t)
constraints.append(self.vehicle_model(state, t))
solution = solve_qp(J, constraints)
return solution.u[0]
相关文档
./wheeled_vehicle/perception/SKILL.md - 感知系统
./wheeled_vehicle/localization/SKILL.md - 定位系统
./wheeled_vehicle/action/SKILL.md - 运动控制