Add openpilot tools

This commit is contained in:
FrogAi
2024-02-27 16:34:47 -07:00
parent b39097a12d
commit a083b93479
156 changed files with 16482 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)