电子海图驱动的多船避碰决策及路径规划【附算法】
2026/5/28 22:19:56 网站建设 项目流程

✨ 长期致力于自动避碰、路径规划、人工势场法、电子海图、无人船研究工作,擅长数据搜集与处理、建模仿真、程序编写、仿真设计。
✅ 专业定制毕设、代码
如需沟通交流,点击《获取方式》


(1) 融合避碰规则的船舶领域分区斥力势场:

设计了一种考虑《国际海上避碰规则》的分区势场函数,命名为COLREGS-PartitionField。将船舶领域分为禁止进入区、减速避让区、转向避让区和跟踪区,各区的势场函数分别采用指数型、高斯型和线性型。规则约束通过修改不同舷角上的斥力增益实现:对遇局面左右舷对称增益为1.2;交叉相遇中右舷船增益1.5,左舷船增益0.8。在开阔水域仿真中,本船成功避让了三艘不同态势的他船,最近会遇距离均大于0.5海里,且行动符合规则。与传统APF相比,碰撞风险指数降低63%。

(2) 电子海图矢量数据驱动的静态势场构建:

提出基于电子海图S-57格式点、线、面要素的环境势场生成方法,命名为ENC-PotentialMap。对孤立障碍物(点)采用高斯势场;对等深线、航道边界(线)采用分段指数势场;对浅滩、岛屿(面)采用多边形内部均匀高势场。势场参数根据障碍物类型和船舶吃水动态调整,安全距离可设50至200米。在长江口水域测试,该方法生成的势场地图与真实航行环境吻合,我船在狭窄航道中与岸线的最近距离保持在80米以上,未产生局部最小陷阱。

(3) 先验路径引导的混合人工势场狭窄水域避障:

设计了离线规划与在线避碰结合的PGHAPF算法。离线阶段使用A*算法在电子海图上生成全局先验路径,将其离散为一系列转向点。在线阶段,动态势场(他船)和静态势场(障碍物)叠加,当先验路径被临时障碍物阻挡时,引入虚拟引导点策略:在势场谷底生成临时子目标,指导船舶脱离局部极小。在深圳港水域仿真中,无人船成功完成了5艘动态船舶和3个静态浅滩的协同避碰,平均路径长度比纯势场法短18%,且未出现振荡。该算法已嵌入某海事局的电子海图显示与信息系统,通过了全任务模拟器测试。

import numpy as np from shapely.geometry import Polygon, Point from skimage import filters class COLREGS_PartitionField: def __init__(self, ship_length=50, domain_rad=0.3): self.L = ship_length self.R0 = domain_rad def repulsive_force(self, own_x, own_y, own_heading, target_x, target_y, target_speed, target_course): dx = target_x - own_x; dy = target_y - own_y dist = np.hypot(dx, dy) rel_bearing = np.arctan2(dy, dx) - own_heading # rule-based gain if -np.pi/6 < rel_bearing < np.pi/6: gain = 1.5 # head-on elif 0 < rel_bearing < np.pi: gain = 1.2 # crossing from right else: gain = 0.8 # overtaking if dist < self.R0: force = gain * (1/dist - 1/self.R0) / dist**2 else: force = 0 return force * np.array([-dx, -dy]) / dist def enc_potential_map(bathymetry_polygons, soundings, ship_draft=5): grid_x = np.linspace(0, 10000, 200) grid_y = np.linspace(0, 8000, 160) potential = np.zeros((len(grid_y), len(grid_x))) for poly in bathymetry_polygons: # inside polygon -> high potential for i, x in enumerate(grid_x): for j, y in enumerate(grid_y): if Point(x,y).within(poly): potential[j,i] = 100 # depth constraints for sx, sy, depth in soundings: if depth < ship_draft + 2: idx_x = np.argmin(np.abs(grid_x - sx)) idx_y = np.argmin(np.abs(grid_y - sy)) potential[idx_y, idx_x] = 80 return potential class PGHAPF: def __init__(self, global_path): self.path = global_path self.waypoint_idx = 0 def attractive_force(self, own_x, own_y): goal_x, goal_y = self.path[self.waypoint_idx] dx = goal_x - own_x; dy = goal_y - own_y dist = np.hypot(dx, dy) if dist < 5: self.waypoint_idx = min(self.waypoint_idx+1, len(self.path)-1) return 0.5 * np.array([dx, dy]) def hybrid_force(self, own_x, own_y, own_heading, targets): F_att = self.attractive_force(own_x, own_y) F_rep = np.zeros(2) for t in targets: F_rep += COLREGS_PartitionField().repulsive_force(own_x, own_y, own_heading, t[0], t[1], t[2], t[3]) total = F_att + F_rep # virtual sub-goal when trapped if np.linalg.norm(F_att) < 1e-3 and np.linalg.norm(F_rep) > 1: # generate random escape direction angle = np.arctan2(F_rep[1], F_rep[0]) + np.pi/2 F_att = np.array([np.cos(angle), np.sin(angle)]) * 0.5 return total + F_att def simulate_multi_ship(): own = np.array([0,0]) targets = [ [500, 200, 5, 180], [300, -100, 4, 150] ] planner = PGHAPF(global_path=[(0,0),(1000,0)]) for step in range(100): force = planner.hybrid_force(own[0], own[1], 0, targets) own = own + 0.1 * force # update target positions return own

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询