PathPlanning
PathPlanning copied to clipboard
rrt algorith mistake
In line 54 there is a minor mistake.
There is must be
if dist <= self.step_len and not self.utils.is_collision(node_new, self.s_goal):
instead
if dist <= self.step_len:
because otherwise, if there is obstacle in a dist, than the last node will be connected trought it.
Thanks very much! I have updated the code.
Also, in function extract_path()
(line 84) you miss node_end
. Need to be something like:
def extract_path(self, node_end): path = [(self.s_goal.x, self.s_goal.y), (node_end.x, node_end.y)] node_now = node_end while node_now.parent is not None: node_now = node_now.parent path.append((node_now.x, node_now.y)) return path
Also, in function
extract_path()
(line 84) you missnode_end
. Need to be something like:def extract_path(self, node_end): path = [(self.s_goal.x, self.s_goal.y), (node_end.x, node_end.y)] node_now = node_end while node_now.parent is not None: node_now = node_now.parent path.append((node_now.x, node_now.y)) return path
Nb thanks a lot