Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Active-Lane-Keeping-Assistant/agent.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations

import os
import matplotlib.pyplot as plt
import numpy as np
import os

class Agent():
"""Agent that outputs the desired behaviour given
Expand Down Expand Up @@ -128,7 +128,7 @@ def get_actions(self, detection_surface_area:float,
"""
if (self.check_surface_area(detection_surface_area)):
steer = 0
if len(self.errors) > 0:
if self.errors:
self.errors.append(self.errors[-1])
else:
self.errors.append(0)
Expand Down
3 changes: 2 additions & 1 deletion src/Active-Lane-Keeping-Assistant/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ def reset(self) -> tuple[float, float, np.ndarray, bool]:
self.collision_sensor = self.world.spawn_actor(blueprint,
carla.Transform(), attach_to=self.vehicle)
self.collision_detected = False
self.collision_sensor.listen(lambda e: {self._set_collision()})
# Remove redundant set brackets
self.collision_sensor.listen(lambda e: self._set_collision())
self.initialized = True

return 0.0, 0.0, np.zeros((self.image_height, self.image_width, 3)), False
Expand Down
Loading