Skip to content

Commit c182b2d

Browse files
committed
Update model paths and refactor Driver class for improved functionality
1 parent 4a53a86 commit c182b2d

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/HL/Autotech_constant.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
CRASH_DIST = 110
88

99
script_dir = os.path.dirname(os.path.abspath(__file__))
10-
MODEL_PATH = os.path.join(script_dir, "model.onnx") # Allows the model to be loaded from the same directory as the script regardless of the current working directory (aka where the script is run from)
10+
MODEL_PATH = os.path.join(script_dir, "model_CNN1D.onnx") # Allows the model to be loaded from the same directory as the script regardless of the current working directory (aka where the script is run from)
1111

1212
PWM_PROP = {
1313
"direction_prop": 1,

src/HL/Driver.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99

1010

1111
class Driver:
12-
def __init__(self, context_size, horizontal_size):
12+
def __init__(self, context_size=0, horizontal_size=0):
1313
self.ai_session = ort.InferenceSession(MODEL_PATH)
1414
self.context = np.zeros([2, context_size, horizontal_size], dtype=np.float32)
1515

1616
def omniscent(self, lidar_data, camera_data):
17-
pass
17+
return self.ai_update_lidar_camera(lidar_data, camera_data)
1818

1919
def ai(self, lidar_data, camera_data):
20-
return self.ai_update_lidar_camera(lidar_data, camera_data)
20+
return self.ai_update_lidar(lidar_data, camera_data)
2121

2222
def simple_minded(self, lidar_data):
2323
return self.farthest_distants(lidar_data)

0 commit comments

Comments
 (0)