急Webots 单机器人路径规划,RRT 应用

请问有没有知道怎么在Webots 上实现单个机器人路径规划,用RRT,
求帮忙zuo一个我给你简单地图里面,epuck用RRT到达目的地,然后躲避障碍的模拟
4月31号前要,GitHub上面有类似的code,但是我看不懂,能做到的再来接

4月没31号

搞这个的人太少了吧,还得硬件配合调试

是什么语言的代码,你可以发出来看看

我就凑个热闹,反正也没31号

epuck用rrt能带机器人去4月31号#

so easy

https://cloud.tencent.com/developer/article/1691514

请用RRT带我去到4.31号,我恐怕不行。

可参考

可以采用最佳路径优先搜索算法

"""

Best-First Searching

@author: huiming zhou

"""

import os

import sys

import math

import heapq

sys.path.append(os.path.dirname(os.path.abspath(__file__)) +

"/../../Search_based_Planning/")

from Search_2D import plotting, env

from Search_2D.Astar import AStar

class BestFirst(AStar):

"""BestFirst set the heuristics as the priority

"""

def searching(self):

"""

Breadth-first Searching.

:return: path, visited order

"""

self.PARENT[self.s_start] = self.s_start

self.g[self.s_start] = 0

self.g[self.s_goal] = math.inf

heapq.heappush(self.OPEN,

(self.heuristic(self.s_start), self.s_start))

while self.OPEN:

_, s = heapq.heappop(self.OPEN)

self.CLOSED.append(s)

if s == self.s_goal:

break

for s_n in self.get_neighbor(s):

new_cost = self.g[s] + self.cost(s, s_n)

if s_n not in self.g:

self.g[s_n] = math.inf

if new_cost < self.g[s_n]: # conditions for updating Cost

self.g[s_n] = new_cost

self.PARENT[s_n] = s

# best first set the heuristics as the priority

heapq.heappush(self.OPEN, (self.heuristic(s_n), s_n))

return self.extract_path(self.PARENT), self.CLOSED

def main():

s_start = (5, 5)

s_goal = (45, 25)

BF = BestFirst(s_start, s_goal, 'euclidean')

plot = plotting.Plotting(s_start, s_goal)

path, visited = BF.searching()

plot.animation(path, visited, "Best-first Searching") # animation

if __name__ == '__main__':

main()


机器人导论课程作业|Webots仿真|RRT*算法|Pure Pursuit算法
https://github.com/Lanly109/Webots-Homework/tree/master/RRT_planning
机器人路径规划之RRT算法
https://wenku.baidu.com/view/617a5a22cf1755270722192e453610661ed95afd.html
伪代码

Algorithm BuildRRT
  Input: Initial configuration qinit, number of vertices in RRT K, incremental distance Δq)
 Output: RRT graph G

 G.init(qinit)
 for k = 1 to K do
  qrand ← RAND_CONF()
   qnear ← NEAREST_VERTEX(qrand, G)
 qnew ← NEW_CONF(qnear, qrand, Δq)
  G.add_vertex(qnew)
 G.add_edge(qnear, qnew)
  return G
 "←" denotes assignment. For instance, "largest ← item" means that the value of largest changes to the value of item.
 "return" terminates the algorithm and outputs the following value.


这个源码看起来挺好的,下面这个是视频讲解
https://www.bilibili.com/video/BV1uL4y1s7yv?spm_id_from=333.999.0.0