D star lite 算法的论文网址:http://idm-lab.org/bib/abstracts/papers/aaai02b.pdf
根本思想是从后往前计算,每当客观环境发生变化时就可以节省未变环境的计算量:
Github复现代码:https://github.com/avgaydashenko/d_star
clone这份代码后,运行main.py:
from d_star import DStar
# 设置起点(0,1)与终点(3,1)
pf = DStar(x_start=0, y_start=1, x_goal=3, y_goal=1)
# (2,1)不允许通行
pf.update_cell(2, 1, -1)
# (2,1)准许通行
# pf.update_cell(2, 1, 0)
# 重新规划路径
pf.replan()
# 得到路径规划的结果
path = pf.get_path()