GithubHelp home page GithubHelp logo

tmacattank / algamesdriving.jl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from simon-lc/algamesdriving.jl

0.0 0.0 0.0 8.65 MB

A set of tools to quickly generate and visualize autonomous driving scenarios for Algames.jl.

License: MIT License

Julia 100.00%

algamesdriving.jl's Introduction

CI codecov

Purpose

A set of tools to quickly generate and visualize autonomous driving scenarios for Algames.jl.

Installation

Pkg.add("AlgamesDriving")

Related Paper

RSS 2020

Autonomous Robots paper submission:

The experiments are available here.

Quick Start

To run a simple example of a autonomous driving see script in /examples/intro_example.jl.

  • Install AlgamesDriving: add AlgamesDriving#v0.1.4
  • Install Algames: add Algames#v0.1.6
  • Install Plots: add Plots
  • Add other dependencies: add LinearAlgebra Meshcat StaticArrays
  • run the script!

Starter Code

Generate Autonomous Driving Scenario

# Create Roadway
roadway_opts = MergingRoadwayOptions()
roadway = build_roadway(roadway_opts)

# Create Dynamics Model
p = 3
model = UnicycleGame(p=p)

# Create Players
players = Vector{Player}(undef, p)
# For each player specify the start and goal state
players[1] = Player(model, roadway.lane[1],
    x0=VehicleState(0.0, 0.1, 0.0, 0.3),
    xf=VehicleState(4.0, 0.1, 0.0, 0.3))
players[2] = Player(model, roadway.lane[2],
    x0=VehicleState(0.0,-0.1, 0.0, 0.3),
    xf=VehicleState(4.0,-0.1, 0.0, 0.3))
players[3] = Player(model, roadway.lane[3],
    x0=VehicleState(0.2,-0.1, 0.0, 0.3),
    xf=VehicleState(4.0, 0.1, 0.0, 0.3))

# Create Scenario
sce = Scenario(model, roadway, players)

Generate and Solve the Dynamic Game Problem

N = 20 # number of time steps
dt = 0.1 # time step
solver_opts = Options() # solver options
prob = GameProblem(N, dt, sce, solver_opts) # atonomous driving problem
@time newton_solve!(prob) # solve the problem

# Plotting vehicles' trajectories and the solver's progress
plot!(model, prob.pdtraj.pr)
plot!(prob.stats)

Visualize the Results

# Visualize Scenario
vis = Visualizer()
open(vis)
# Build environment
set_scenario!(vis, sce)
# Set camera
set_camera_birdseye!(vis, height=7)
set_env!(vis, VehicleState(2.,0.,0.,0.))
# Animate the vehicles
set_traj!(vis, model, sce, prob.pdtraj.pr)

alt text

algamesdriving.jl's People

Contributors

madan96 avatar simon-lc 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.