## AlgamesDriving.jl

A set of tools to quickly generate and visualize autonomous driving scenarios for Algames.jl.
Author simon-lc
Popularity
16 Stars
Updated Last
12 Months Ago
Started In
January 2021

## Purpose

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

## Installation

``````Pkg.add("AlgamesDriving")
``````

## 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

# 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
x0=VehicleState(0.0, 0.1, 0.0, 0.3),
xf=VehicleState(4.0, 0.1, 0.0, 0.3))
x0=VehicleState(0.0,-0.1, 0.0, 0.3),
xf=VehicleState(4.0,-0.1, 0.0, 0.3))
x0=VehicleState(0.2,-0.1, 0.0, 0.3),
xf=VehicleState(4.0, 0.1, 0.0, 0.3))

# Create Scenario
``````

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)

``````

### Required Packages

View all packages

### Used By Packages

No packages found.