GithubHelp home page GithubHelp logo

stanford-carla-toolbox's Introduction

stanford-carla-toolbox

A toolbox for the Carla Simulator.

This toolbox is a collection of useful C++, Python and Julia wrappers for working with the Carla Simulator and other autonomous driving libraries and packages.

Prerequisites

These are the required prerequisites necessary for using the toolbox. A list of general requirements and well as extras for the desired coding language.

  • Carla Simulator (0.9.7)
  • Python (3.5) - Carla only provides API binaries for Python 3.5.
  • Julia (1.2+)

Carla

The code has been verified to work with version 0.9.7 of the Carla simulator. For more information on using the Carla simulator, please visit the Carla documentation, forum, Discord server and GitHub page.

Python

The toolbox extensively utilizes the Carla PythonAPI for interacting with the Carla simulator.

Julia

The Julia codebase for this toolbox has only been tested directly for version 1.3 of Julia. Since Carla doesn't provide direct Julia support, this wrapper currently uses their provided Python API. Please make sure your environment is setup to load the Carla provided .egg file.

  • AutomotiveSimulator.jl
  • PyCall.jl

Using the Toolbox

In order to use the toolbox, you must first have the above prerequisites installed on your system and follow the instructions provided in "Setting Up Your Environment".

Before running any code that uses the toolbox, we must have a instance of the Carla server running. Open a terminal with the appropriate environment and run:

~/Simulators/Carla-0.9.7/./CarlaUE4.sh

Next, open another terminal (or tab) with the appropriate environment and run your code using the toolbox. Below is a simple Julia program that will connect to a running Carla server and spawn a vehicle in the simulator.

julia --project=~/Development/VirtualEnvironments/Julia/sct-testing \
~/Development/stanford-carla-toolbox/examples/spawn-vehicle.jl

This example only provides a brief look at the functionality of the toolbox. For further examples, look under the examples directory.

The same idea can be applied to the Python examples.

python ~/Development/stanford-carla-toolbox/python/examples/spawn_vehicle.py

stanford-carla-toolbox's People

Contributors

exoticdft avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

stanford-carla-toolbox's Issues

Create a visualize helper function

Create a "visualize" helper function that passes the scenes to visualize, a timestep in which the scenes were generated and any mapping from Entity.id to Carla id if necessary. Something like

visualize(scenes:` List, timestep: double, entity_map: Dict{Any, Int})
    for i = 1 : length(scenes)
        start_time = Now()
        scene = scenes[i]
        update_world(carla_world, scene, entity_map, handiness)
        sleep(start_time + timestep - Now())
   end

Convert OpenDrive to ADM roadways

In order for Carla to work with the simulation functionality of the AutomotiveDrivingModels repository we'll need to convert the OpenDrive format into the ADM roadways format. This will require parsing an XML file, or string of all the XML info, using the OpenDrive 1.5 specification.

OpenDrive: http://www.opendrive.org/docs/OpenDRIVEFormatSpecRev1.5M.pdf
Carla: https://carla.readthedocs.io/en/latest/python_api/#carlamap-class
ADM: https://github.com/sisl/AutomotiveDrivingModels.jl/tree/master/src/roadways

Add Python related wrapper functions to the codebase

There are several functions floating around in various scripts made to help with previous research projects. It would be ideal to add these functions into the codebase to start the Python related functionality of the toolbox.

Add able to use AutomotiveSimulator.Scene objects in Carla.

The AutomotiveSimulator.Scene object stores all the information of the vehicles in AutomotiveSimulator (AS) at a given point in time. It would be great to be able to use this object and convert it directly into a Carla.World object. This would be useful for quick visualization of already run simulations and potentially a quick way to move vehicles manually in the Carla environment after each AS tick, instead of using the Carla Control commands.

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.