Code Monkey home page Code Monkey logo

carla-simulator-python's Introduction

carla-simulator-python

My modifications to the examples from CARLA 0.9.13 PythonAPI.

Launch the simulator:

You can change --gpus 0 to --gpus all or ---gpus <some_number> if you have more than one GPU.

docker run --rm -it --name carla-container -u carla -p 2000-2002:2000-2002 --gpus 0 ricardodeazambuja/carlasim:0.9.13_headless ./launch_headless.sh

Press ENTER to kill the simulator (it takes some seconds until it dies...).

Using the PythonAPI

docker cp carla-container:/home/carla/PythonAPI .

Create a new conda environment (Python 3.7):

conda create --name carla-simulator python=3.7
conda activate carla-simulator
pip install --upgrade pip
cd PythonAPI/examples/
pip install -r requirements.txt 

Install the carla python package (so we don't need to add the egg to the sys.path)

cd ../carla/dist/  #it's inside PythonAPI/carla/dist
pip install carla-0.9.13-cp37-cp37m-manylinux_2_27_x86_64.whl

If pip complains and you are sure the Python version is correct, one possible cause is that you forgot to upgrade pip

The simulation is empty, so let's put something there!

python generate_traffic.py 

It should print spawned 30 vehicles and 10 walkers, press Ctrl+C to exit.

It's headless, so we need a way to see what's happening there

Open a new terminal (don't forget to run conda activate carla-simulator) the and type:

python synchronous_mode.py

It should open a pygame display with a random vehicle moving through the town (with the focus on the pygame display, press ESC to exit).

carla-simulator-python's People

Contributors

ricardodeazambuja avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.