4
4
import traceback
5
5
from queue import Empty
6
6
7
-
8
7
class IGHAStarMP :
9
8
"""
10
9
Multiprocessing wrapper for the IGHA* planner. Runs the planner in a separate process and communicates via queues.
@@ -30,38 +29,9 @@ def _planner_process(self, configs, query_queue, result_queue):
30
29
"""
31
30
import torch
32
31
import numpy as np
33
- import os
34
- import sys
35
- import pathlib
36
-
37
- BASE_DIR = pathlib .Path (__file__ ).resolve ().parent
38
- sys .path .append (str (BASE_DIR / "src" ))
39
- from torch .utils .cpp_extension import load
32
+ from ighastar .scripts .common_utils import create_planner
40
33
41
- env_name = configs ["experiment_info_default" ]["node_info" ]["node_type" ]
42
- env_macro = {
43
- "simple" : "-DUSE_SIMPLE_ENV" ,
44
- "kinematic" : "-DUSE_KINEMATIC_ENV" ,
45
- "kinodynamic" : "-DUSE_KINODYNAMIC_ENV" ,
46
- }[env_name ]
47
- folder_name = os .getcwd ()
48
- for path in sys .path :
49
- folder_path = os .path .join (path , folder_name )
50
- if os .path .exists (folder_path ):
51
- break
52
- cpp_path = f"{ folder_path } /src/ighastar.cpp"
53
- cuda_path = f"{ folder_path } /src/Environments/{ env_name } .cu"
54
- header_path = f"{ folder_path } /src/Environments"
55
-
56
- kernel = load (
57
- name = "ighastar" ,
58
- sources = [cpp_path , cuda_path ],
59
- extra_include_paths = [header_path ],
60
- extra_cflags = ["-std=c++17" , "-O3" , env_macro ],
61
- extra_cuda_cflags = ["-O3" ],
62
- verbose = True ,
63
- )
64
- planner = kernel .IGHAStar (configs , False )
34
+ planner = create_planner (configs ["Planner_config" ])
65
35
print ("[IGHAStarMP] Planner loaded." )
66
36
67
37
map_res = configs ["experiment_info_default" ]["node_info" ]["map_res" ]
0 commit comments