mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-01-13 03:17:59 -05:00
* Add optional robot radius to RRT/RRTStar path planners. * update __init__ and check_collision to include radius * during animation, if a robot radius is given then it is drawn * Add test for robot radius * Correct import error * Correct missing robot_radius errors * Address "expected 2 blank lines, found 1" error * Address "line too long" errors * Add missing argument description. * Remove collision_check_with_xy and replace with check_collision * Fix "missing whitespace after ','" error * Update PathPlanning/ClosedLoopRRTStar/closed_loop_rrt_star_car.py Co-authored-by: Atsushi Sakai <asakai.amsl+github@gmail.com> Co-authored-by: Atsushi Sakai <asakai.amsl+github@gmail.com>
37 lines
935 B
Python
37 lines
935 B
Python
import conftest # Add root path to sys.path
|
|
from PathPlanning.RRTStar import rrt_star as m
|
|
|
|
|
|
def test1():
|
|
m.show_animation = False
|
|
m.main()
|
|
|
|
|
|
def test_no_obstacle():
|
|
obstacle_list = []
|
|
|
|
# Set Initial parameters
|
|
rrt_star = m.RRTStar(start=[0, 0],
|
|
goal=[6, 10],
|
|
rand_area=[-2, 15],
|
|
obstacle_list=obstacle_list)
|
|
path = rrt_star.planning(animation=False)
|
|
assert path is not None
|
|
|
|
|
|
def test_no_obstacle_and_robot_radius():
|
|
obstacle_list = []
|
|
|
|
# Set Initial parameters
|
|
rrt_star = m.RRTStar(start=[0, 0],
|
|
goal=[6, 10],
|
|
rand_area=[-2, 15],
|
|
obstacle_list=obstacle_list,
|
|
robot_radius=0.8)
|
|
path = rrt_star.planning(animation=False)
|
|
assert path is not None
|
|
|
|
|
|
if __name__ == '__main__':
|
|
conftest.run_this_test(__file__)
|