-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up dockerfile and docker compose
- Loading branch information
Showing
4 changed files
with
180 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
src/simulation/carla_notebooks/.ipynb_checkpoints/sample_notebook-checkpoint.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"attachments": {}, | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Setup Code\n", | ||
"**DO NOT CHANGE THIS!!**\n", | ||
"**RUN THE CELL BELOW FIRST!!**" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import carla\n", | ||
"import os\n", | ||
"\n", | ||
"client_name = os.environ.get(\"CLIENT_NAME\", \"DOES NOT EXIST\")\n", | ||
"if client_name == \"DOES NOT EXIST\":\n", | ||
" raise Exception(\"The environment variable for the container name of the carla server has not been set\")\n", | ||
"\n", | ||
"# Connect to the client and retrieve the world object\n", | ||
"client = carla.Client(client_name, 2000)\n", | ||
"world = client.get_world()" | ||
] | ||
}, | ||
{ | ||
"attachments": {}, | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Start Adding Code or Markdown Cells Below\n", | ||
"Some helpful code cells are provided below that you may choose to use" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"#### SPAWN VEHICLES ####\n", | ||
"\"\"\"\n", | ||
"# Get the blueprint library and filter for the vehicle blueprints\n", | ||
"vehicle_blueprints = world.get_blueprint_library().filter('*vehicle*')\n", | ||
"# Get the map's spawn points\n", | ||
"spawn_points = world.get_map().get_spawn_points()\n", | ||
"\n", | ||
"# Spawn 50 vehicles randomly distributed throughout the map \n", | ||
"# for each spawn point, we choose a random vehicle from the blueprint library\n", | ||
"for i in range(0,50):\n", | ||
" world.try_spawn_actor(random.choice(vehicle_blueprints), random.choice(spawn_points)))\n", | ||
"\"\"\"\n", | ||
"#### SET ALL VEHICLES TO AUTOPILOT\n", | ||
"\"\"\"\n", | ||
"for vehicle in world.get_actors().filter('*vehicle*'):\n", | ||
" vehicle.set_autopilot(True)\n", | ||
"\"\"\"" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"language_info": { | ||
"name": "python" | ||
}, | ||
"orig_nbformat": 4 | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters