Skip to content

Commit 7844ba1

Browse files
Bias percentage corrected
1 parent bca3ef8 commit 7844ba1

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

RRT.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def main():
5454
k = 0
5555
node_value = 0
5656
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
5858

5959
while run and k < MAX_NODES:
6060
# Make sure the loop runs at 60 FPS
@@ -63,8 +63,6 @@ def main():
6363
if event.type == pygame.QUIT:
6464
run = False
6565

66-
67-
6866
if not is_simulation_finished:
6967
# Sample free space and check x_rand node collision
7068
x_rand = graph_.generate_random_node(obstacles=obstacles) # Random node
@@ -75,7 +73,7 @@ def main():
7573
x_new = graph_.new_state(x_rand, x_near, x_goal) # New node
7674

7775
# Every n iterations bias the RRT
78-
if iteration%10 == 0:
76+
if iteration%bias_percentage == 0:
7977
x_rand = x_goal
8078

8179
iteration += 1

__pycache__/graph.cpython-310.pyc

-27 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)