|
|
|
@ -47,12 +47,11 @@ class SimulatorBridge(ABC): |
|
|
|
|
self.dual_camera = dual_camera |
|
|
|
|
self.high_quality = high_quality |
|
|
|
|
|
|
|
|
|
self._exit_event = threading.Event() |
|
|
|
|
self._exit_event: threading.Event | None = None |
|
|
|
|
self._threads = [] |
|
|
|
|
self._keep_alive = True |
|
|
|
|
self.started = Value('i', False) |
|
|
|
|
signal.signal(signal.SIGTERM, self._on_shutdown) |
|
|
|
|
self._exit = threading.Event() |
|
|
|
|
self.simulator_state = SimulatorState() |
|
|
|
|
|
|
|
|
|
self.world: World | None = None |
|
|
|
@ -76,6 +75,8 @@ class SimulatorBridge(ABC): |
|
|
|
|
|
|
|
|
|
def close(self, reason): |
|
|
|
|
self.started.value = False |
|
|
|
|
|
|
|
|
|
if self._exit_event is not None: |
|
|
|
|
self._exit_event.set() |
|
|
|
|
|
|
|
|
|
if self.world is not None: |
|
|
|
@ -103,6 +104,8 @@ Ignition: {self.simulator_state.ignition} Engaged: {self.simulator_state.is_enga |
|
|
|
|
self.simulated_car = SimulatedCar() |
|
|
|
|
self.simulated_sensors = SimulatedSensors(self.dual_camera) |
|
|
|
|
|
|
|
|
|
self._exit_event = threading.Event() |
|
|
|
|
|
|
|
|
|
self.simulated_car_thread = threading.Thread(target=rk_loop, args=(functools.partial(self.simulated_car.update, self.simulator_state), |
|
|
|
|
100, self._exit_event)) |
|
|
|
|
self.simulated_car_thread.start() |
|
|
|
|