mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-01-14 22:48:08 -05:00
* it works and is WAY faster than a* * some bug fixes from testing different scenarios * add some docs & address todos * add sipp test * spiff up comments revert changes in speed-up * explain what the removal is doing * linting * fix docs build * docs formatting * revert change to file (maybe linter did it?) * point at gifs in gifs repo * use raw githubusercontent gif links * change formatting on planner results * format output differently * proper formatting final * missing underline * revert unintended change * grammar + add descriptions for gifs * missing :: * add title to gifs section * dont use sections for sub-sections * constent a* spelling * Update PathPlanning/TimeBasedPathPlanning/GridWithDynamicObstacles.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tests/test_safe_interval_path_planner.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update docs/modules/5_path_planning/time_based_grid_search/time_based_grid_search_main.rst Co-authored-by: Atsushi Sakai <asakai.amsl+github@gmail.com> * Update PathPlanning/TimeBasedPathPlanning/SafeInterval.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * addressing comments * revert np.full change --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Atsushi Sakai <asakai.amsl+github@gmail.com>
34 lines
796 B
Python
34 lines
796 B
Python
from PathPlanning.TimeBasedPathPlanning.GridWithDynamicObstacles import (
|
|
Grid,
|
|
ObstacleArrangement,
|
|
Position,
|
|
)
|
|
from PathPlanning.TimeBasedPathPlanning import SafeInterval as m
|
|
import numpy as np
|
|
import conftest
|
|
|
|
|
|
def test_1():
|
|
start = Position(1, 11)
|
|
goal = Position(19, 19)
|
|
grid_side_length = 21
|
|
grid = Grid(
|
|
np.array([grid_side_length, grid_side_length]),
|
|
obstacle_arrangement=ObstacleArrangement.ARRANGEMENT1,
|
|
)
|
|
|
|
m.show_animation = False
|
|
planner = m.SafeIntervalPathPlanner(grid, start, goal)
|
|
|
|
path = planner.plan(False)
|
|
|
|
# path should have 31 entries
|
|
assert len(path.path) == 31
|
|
|
|
# path should end at the goal
|
|
assert path.path[-1].position == goal
|
|
|
|
|
|
if __name__ == "__main__":
|
|
conftest.run_this_test(__file__)
|