File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ def main():
54
54
k = 0
55
55
node_value = 0
56
56
iteration = 0
57
- bias_percentage = 11 - args .bias_percentage // 10
57
+ bias_percentage = 10 - args .bias_percentage // 10 if args . bias_percentage != 100 else 1
58
58
59
59
while run and k < MAX_NODES :
60
60
# Make sure the loop runs at 60 FPS
@@ -63,8 +63,6 @@ def main():
63
63
if event .type == pygame .QUIT :
64
64
run = False
65
65
66
-
67
-
68
66
if not is_simulation_finished :
69
67
# Sample free space and check x_rand node collision
70
68
x_rand = graph_ .generate_random_node (obstacles = obstacles ) # Random node
@@ -75,7 +73,7 @@ def main():
75
73
x_new = graph_ .new_state (x_rand , x_near , x_goal ) # New node
76
74
77
75
# Every n iterations bias the RRT
78
- if iteration % 10 == 0 :
76
+ if iteration % bias_percentage == 0 :
79
77
x_rand = x_goal
80
78
81
79
iteration += 1
You can’t perform that action at this time.
0 commit comments