D* Lite。能否根据机器人的实际位置来改变起始节点?

问题描述 投票:1回答:1

我正在阅读 这篇Koening和Likhachev关于D*Lite的论文。 并且每次迭代都会通过遍历到图上的连接节点来更新起始节点。我想知道在现实世界的机器人中的使用情况,机器人可能会越过一个连接节点,最终在图上的不同点结束。如果保持算法的其他部分不变,而自己根据机器人的实际位置设置起始节点,D* Lite是否还能用。特别是论文中的这两行伪代码能否

{26’}  s_start = argmin s'∈Succ(s_start)(c(s_start, s') + g(s'));
{27’}  Move to s_start;

成为

       s_start = actual robot location on graph

下面是论文的完整伪代码。

procedure CalculateKey(s)
{01’} return [min(g(s), rhs(s)) + h(sstart, s) + km; min(g(s), rhs(s))];

procedure Initialize()
{02’} U = ∅;
{03’} km = 0;
{04’} for all s ∈ S rhs(s) = g(s) = ∞;
{05’} rhs(sgoal) = 0;
{06’} U.Insert(sgoal, CalculateKey(sgoal));

procedure UpdateVertex(u)
{07’} if (u ≠ sgoal) rhs(u) = min s'∈Succ(u)(c(u, s') + g(s'));
{08’} if (u ∈ U) U.Remove(u);
{09’} if (g(u) ≠ rhs(u)) U.Insert(u, CalculateKey(u));

procedure ComputeShortestPath()
{10’} while (U.TopKey() < CalculateKey(sstart) OR rhs(sstart) ≠ g(sstart))
{11’}   kold = U.TopKey();
{12’}   u = U.Pop();
{13’}   if (kold ˙<CalculateKey(u))
{14’}     U.Insert(u, CalculateKey(u));
{15’}   else if (g(u) > rhs(u))
{16’}     g(u) = rhs(u);
{17’}     for all s ∈ Pred(u) UpdateVertex(s);
{18’}   else
{19’}     g(u) = ∞;
{20’}     for all s ∈ Pred(u) ∪ {u} UpdateVertex(s);

procedure Main()
{21’} slast = sstart;
{22’} Initialize();
{23’} ComputeShortestPath();
{24’} while (sstart ≠ sgoal)
{25’}   /* if (g(sstart) = ∞) then there is no known path */
{26’}   sstart = argmin s'∈Succ(sstart)(c(sstart, s') + g(s'));
{27’}   Move to sstart;
{28’}   Scan graph for changed edge costs;
{29’}   if any edge costs changed
{30’}     km = km + h(slast, sstart);
{31’}     slast = sstart;
{32’}     for all directed edges (u, v) with changed edge costs
{33’}       Update the edge cost c(u, v);
{34’}       UpdateVertex(u);
{35’}     ComputeShortestPath();
algorithm path-finding d-star
1个回答
0
投票

是的,你可以这样做。每当你把机器人从一个顶点网格单元移动到另一个单元时,你就调用程序Main()(只有在你第一次运行程序Main时调用初始化)。设置sstart=机器人位置,然后slast=sstart。现在算法将计算从机器人当前位置到目标顶点的最短路径。每次机器人在新网格单元的接受圈内时,你都必须调用过程Main()。我自己实现了这样的代码。以下是我的堆栈溢出 疑问 与我实现算法有关。

© www.soinside.com 2019 - 2024. All rights reserved.