From fe4ce92c4bc5bdbc6549d2512514f5bfb7cb72e6 Mon Sep 17 00:00:00 2001 From: Haegu Lee <34788458+benthebear93@users.noreply.github.com> Date: Mon, 21 Jun 2021 22:44:06 +0900 Subject: [PATCH] Fix No module error in GridBasedSweepCPP and ClosedLoopRRTStart (#516) * Fix No module error in GridBasedSweepCPP and ClosedLoopRRTStart * Fix No module error in GridBasedSweepCPP and ClosedLoopRRTStart * Fix No module error in GridBasedSweepCPP and ClosedLoopRRTStart * Fix No module error in GridBasedSweepCPP and ClosedLoopRRTStart * Fix No module error in GridBasedSweepCPP and ClosedLoopRRTStart --- PathPlanning/ClosedLoopRRTStar/__init__.py | 8 -------- .../closed_loop_rrt_star_car.py | 17 +++++++++++++++-- PathPlanning/GridBasedSweepCPP/__init__.py | 7 ------- .../grid_based_sweep_coverage_path_planner.py | 11 ++++++++++- 4 files changed, 25 insertions(+), 18 deletions(-) delete mode 100644 PathPlanning/ClosedLoopRRTStar/__init__.py delete mode 100644 PathPlanning/GridBasedSweepCPP/__init__.py diff --git a/PathPlanning/ClosedLoopRRTStar/__init__.py b/PathPlanning/ClosedLoopRRTStar/__init__.py deleted file mode 100644 index 0e49cd14..00000000 --- a/PathPlanning/ClosedLoopRRTStar/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -import os -import sys - -sys.path.append(os.path.dirname(os.path.abspath(__file__))) -sys.path.append(os.path.dirname( - os.path.abspath(__file__)) + "/../ReedsSheppPath/") -sys.path.append(os.path.dirname( - os.path.abspath(__file__)) + "/../RRTStarReedsShepp/") diff --git a/PathPlanning/ClosedLoopRRTStar/closed_loop_rrt_star_car.py b/PathPlanning/ClosedLoopRRTStar/closed_loop_rrt_star_car.py index 740fc559..c0c8c356 100644 --- a/PathPlanning/ClosedLoopRRTStar/closed_loop_rrt_star_car.py +++ b/PathPlanning/ClosedLoopRRTStar/closed_loop_rrt_star_car.py @@ -5,15 +5,28 @@ Path planning Sample Code with Closed loop RRT for car like robot. author: AtsushiSakai(@Atsushi_twi) """ +import os +import sys import matplotlib.pyplot as plt import numpy as np -import reeds_shepp_path_planning -from rrt_star_reeds_shepp import RRTStarReedsShepp + +sys.path.append(os.path.dirname(os.path.abspath(__file__))) import pure_pursuit import unicycle_model +sys.path.append(os.path.dirname( + os.path.abspath(__file__)) + "/../ReedsSheppPath/") +sys.path.append(os.path.dirname( + os.path.abspath(__file__)) + "/../RRTStarReedsShepp/") + +try: + import reeds_shepp_path_planning + from rrt_star_reeds_shepp import RRTStarReedsShepp +except ImportError: + raise + show_animation = True diff --git a/PathPlanning/GridBasedSweepCPP/__init__.py b/PathPlanning/GridBasedSweepCPP/__init__.py deleted file mode 100644 index f1c41ce4..00000000 --- a/PathPlanning/GridBasedSweepCPP/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -import os -import sys - -GRID_MAP_LIB = os.path.dirname(os.path.abspath(__file__)) + \ - "/../../Mapping/" - -sys.path.append(GRID_MAP_LIB) diff --git a/PathPlanning/GridBasedSweepCPP/grid_based_sweep_coverage_path_planner.py b/PathPlanning/GridBasedSweepCPP/grid_based_sweep_coverage_path_planner.py index 984b0aff..c0c8fc43 100644 --- a/PathPlanning/GridBasedSweepCPP/grid_based_sweep_coverage_path_planner.py +++ b/PathPlanning/GridBasedSweepCPP/grid_based_sweep_coverage_path_planner.py @@ -5,13 +5,22 @@ author: Atsushi Sakai """ import math +import os +import sys from enum import IntEnum import numpy as np from scipy.spatial.transform import Rotation as Rot -from Mapping.grid_map_lib.grid_map_lib import GridMap import matplotlib.pyplot as plt +sys.path.append(os.path.dirname(os.path.abspath(__file__)) + + "/../../Mapping/") + +try: + from grid_map_lib.grid_map_lib import GridMap +except ImportError: + raise + do_animation = True