Skip to content
Merged
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
37 changes: 22 additions & 15 deletions carla launch manager/CARLA_manager.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
import subprocess
import time

class CARLAManager(object):
container_id = None
run_command = """
docker run -d --rm \
--gpus all \
-e NVIDIA_DRIVER_CAPABILITIES=all \
-e NVIDIA_VISIBLE_DEVICES=all \
-e SQL_LVDELDRIVER=x11 \
-e DISPLAY=:1 \
-e XDG_RUNTIME_DIR=/tmp \
-e NVIDIA_REQUIRE_CUDA="cuda>=10.1 brand=tesla,driver>=384 driver>=384 brand=tesla,driver>=396 driver>=396 brand=tesla,driver>=410 driver>=410" \
--network host \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
carlasim/carla:0.9.15 \
/bin/bash -c "/home/carla/CarlaUE4.sh"
"""
run_command = (
"docker run -d --rm"
"--gpus all"
"-e NVIDIA_VISIBLE_DEVICES=all"
"-e DISPLAY=:0"
"-v /tmp/.X11-unix:/tmp/.X11-unix:rw"
"-e XDG_RUNTIME_DIR=/tmp"
"--network host"
"carlasim/carla:0.9.15"
"/bin/bash -c '/home/carla/CarlaUE4.sh'"
)

@staticmethod
def start_carla():
Expand All @@ -39,4 +37,13 @@ def stop_carla():
@staticmethod
def restart_carla():
CARLAManager.stop_carla()
CARLAManager.start_carla()
CARLAManager.start_carla()


def main():
CARLAManager.start_carla()
time.sleep(15)
CARLAManager.stop_carla()

if __name__ == "__main__":
main()
Loading