We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd6d046 commit 874ebffCopy full SHA for 874ebff
PathPlanning/RRTStar/rrt_star.py
@@ -163,9 +163,13 @@ def search_best_goal_node(self):
163
if not safe_goal_inds:
164
return None
165
166
- min_cost = min([self.node_list[i].cost for i in safe_goal_inds])
167
- for i in safe_goal_inds:
168
- if self.node_list[i].cost == min_cost:
+ safe_goal_costs = [self.node_list[i].cost +
+ self.calc_dist_to_goal(self.node_list[i].x, self.node_list[i].y)
+ for i in safe_goal_inds]
169
+
170
+ min_cost = min(safe_goal_costs)
171
+ for i, cost in zip(safe_goal_inds, safe_goal_costs):
172
+ if cost == min_cost:
173
return i
174
175
0 commit comments