Add openpilot tools

This commit is contained in:
FrogAi
2024-01-12 22:39:30 -07:00
parent d1bee2c971
commit 0174873f46
154 changed files with 16477 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
from openpilot.tools.sim.bridge.common import SimulatorBridge
from openpilot.tools.sim.bridge.carla.carla_world import CarlaWorld
class CarlaBridge(SimulatorBridge):
TICKS_PER_FRAME = 5
def __init__(self, arguments):
super().__init__(arguments)
self.host = arguments.host
self.port = arguments.port
self.town = arguments.town
self.num_selected_spawn_point = arguments.num_selected_spawn_point
def spawn_world(self):
import carla
client = carla.Client(self.host, self.port)
client.set_timeout(5)
return CarlaWorld(client, high_quality=self.high_quality, dual_camera=self.dual_camera,
num_selected_spawn_point=self.num_selected_spawn_point, town=self.town)