Skip to content

Commit 33499cd

Browse files
refator
1 parent 07dd543 commit 33499cd

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/HL/Car.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ def main(self):
195195
angle= -color*MAX_ANGLE
196196
self.set_direction_degre(angle)
197197
self.recule()
198+
self.driver.reset()
198199

199200

200201

src/HL/Driver.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
class Driver:
1616
def __init__(self, context_size=0, horizontal_size=0):
17+
self.context_size = context_size
18+
self.horizontal_size = horizontal_size
1719
self.ai_session = ort.InferenceSession(MODEL_PATH)
1820
self.context = np.zeros([2, context_size, horizontal_size], dtype=np.float32)
1921

@@ -47,7 +49,8 @@ def __init__(self, context_size=0, horizontal_size=0):
4749
)
4850
self.ax[3].set_title('Camera Image')
4951

50-
52+
def reset(self):
53+
self.context = np.zeros([2, self.context_size, self.horizontal_size], dtype=np.float32)
5154

5255
def omniscent(self, lidar_data, camera_data):
5356
pass

0 commit comments

Comments
 (0)