Skip to content

Commit

Permalink
Added a random wait time for generated plans #17
Browse files Browse the repository at this point in the history
  • Loading branch information
MJafarMashhadi committed Jul 29, 2020
1 parent c4c1ccd commit 2190fd7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pprz_tester/gen_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import argparse
import logging
import random
from pathlib import Path
from typing import Union, Iterable

Expand Down Expand Up @@ -131,6 +132,7 @@ def _inner_gen(_lines):
for block in blocks:
block_jumps.append(f"flight_plan.JumpToBlock('{flight_plan_blocks[block]}')")
block_jumps.append(f"flight_plan.WaitForState('{flight_plan_blocks[block]}')")
block_jumps.append(f"flight_plan.WaitForSeconds({random.uniform(50, 70)})")

scenarios.append("lambda: [\n" +
',\n'.join(indent(block_jumps, n=4)) + ", \n" +
Expand Down

0 comments on commit 2190fd7

Please # to comment.