Skip to content

Instantly share code, notes, and snippets.

@nov05
Last active June 3, 2025 14:49
Show Gist options
  • Save nov05/d8a9ce2e4bd991383381fcf683c6799e to your computer and use it in GitHub Desktop.
Save nov05/d8a9ce2e4bd991383381fcf683c6799e to your computer and use it in GitHub Desktop.

Autonomous Vehicle Risk Assessment Framework, Installation in Windows 11

Repo:
https://github.com/sisl/AutonomousRiskFramework.jl

Environment:
Windows 11, VS Code, Miniconda, Jalia 1.11.5, CARLA 0.9.13, scenario_runner 0.9.13


  • Set up julia command in the PowerShell temporarily or persistently.
Set-Alias julia "D:\software\julia-1.11.5-win64\julia-1.11.5\bin\julia.exe"   

Or run notepad $PROFILE, add the following lines.

Set-Alias julia "D:\software\julia-1.11.5-win64\julia-1.11.5\bin\julia.exe"
Write-Host "Custom profile loaded."
[compat]
# CUDA = "3"
CUDA = "3, 4, 5"  ## Nov05
# Flux = "0.10, 0.11, 0.12, 0.13"
Flux = "0.10, 0.11, 0.12, 0.13, 0.14"  ## Nov05
  • On GitHub, fork the AutonomousRiskFramework.jl repo.
    In Windows PowerShell, git clone the repo to the local machine.
cd D:\\github  
git clone https://github.com/nov05/Stanford-AutonomousRiskFramework.jl.git  
cd Stanford-AutonomousRiskFramework.jl   
  • Add the following lines in the /Stanford-AutonomousRiskFramework.jl/install.jl file.
packages = [
    ## Nov05 2025-05-31
    PackageSpec(url="https://github.com/nov05/Stanford-POMDPStressTesting.jl")
]
...
Pkg.add("cuDNN")
  • Install CARLA
    Download CARLA_0.9.13.zip for Windows 11 from https://github.com/carla-simulator/carla/releases/tag/0.9.13
    Exact to D:\software and add system variable UE4_ROOT = D:\software\CARLA_0.9.13
    Install DirectX 9.29.1974.1
    Verify the installation by run "D:\software\CARLA_0.9.13\WindowsNoEditor\CarlaUE4.exe".
    You are supposed to see the following window.

    Install scenario_runner 0.9.13

    cd D:\software\CARLA_0.9.13\WindowsNoEditor\PythonAPI
    git clone --branch v0.9.13 --depth 1 https://github.com/carla-simulator/scenario_runner.git
    conda create -n arf_py375 python=3.7.5   
    conda activate arf_py375  
    cd scenario_runner
    pip install -r requirements.txt ✅
    cd D:\github\Stanford-AutonomousRiskFramework.jl\CARLAIntegration\adversarial_carla_env
    pip install -r requirements.txt ✅

    Modify the setup.py as the code below.

    from setuptools import setup, find_packages  
    setup(name='adv_carla',
        version='0.0.1',
        packages=find_packages(include=['adv_carla', 'adv_carla.*']),   ## added by nov05
        install_requires=['gym']) # TODO: other reqs.
    pip install -e .  ✅ Install adv-carla-v0 gym environment
    pip install wandb
    

    Add system variables in Windows.

    CARLA_ROOT = D:\software\CARLA_0.9.13
    SCENARIO_RUNNER_ROOT = %CARLA_ROOT%\PythonAPI\scenario_runner
    PYTHONPATH (append) := ;%CARLA_ROOT%\PythonAPI\carla\agents;%CARLA_ROOT%\PythonAPI\carla;%CARLA_ROOT%\PythonAPI
    

    Add the following line to D:\software\julia-1.11.5-win64\julia-1.11.5\etc\julia\startup.jl

    # This file should contain site-specific commands to be executed on Julia startup;
    # Users may store their own personal commands in `~/.julia/config/startup.jl`.
    ENV["PYTHON"] = "D:/Users/guido/miniconda3/envs/arf_py375/python.exe"

    Restart PowerShell terminal

    cd D:\github\Stanford-AA228VProjects\project_final
    conda activate arf_py375
    julia
    julia> import Pkg; Pkg.activate(@__DIR__)  
    julia> Pkg.build("PyCall") ✅
    julia> using PyCall; PyCall.python
        "D:/Users/guido/miniconda3/envs/arf_py375/python.exe"
    julia> pyimport("adv_carla")
        PyObject <module 'adv_carla' from 'd:\\github\\stanford-autonomousriskframework.jl\\carlaintegration\\adversarial_carla_env\\adv_carla\\__init__.py'>
    julia> pyimport("wandb")
        PyObject <module 'wandb' from 'D:\\Users\\guido\\miniconda3\\envs\\arf_py375\\lib\\site-packages\\wandb\\__init__.py'>
    
  • Install the Autonomous Risk Framework package. Check the result.

cd D:\github\Stanford-AutonomousRiskFramework.jl ❌
julia install.jl ❌ This would install all the pacakges in the Julia v1.11 environment.   
cd D:\github\Stanford-AA228VProjects\project_final
julia
julia> Pkg.activate("D:\\github\\Stanford-AutonomousRiskFramework.jl") ❌
julia> cd("D:/github/Stanford-AA228VProjects/project_final")
julia> import Pkg; Pkg.activate(@__DIR__) ✅ This would create Project.toml and Manifest.toml in this dir.  
julia> import Pkg; Pkg.upgrade_manifest()
     Updated Format of manifest file at `D:\github\Stanford-AA228VProjects\project_final\Manifest.toml` updated from v1.0 to v2.0
julia> include("D:/github/Stanford-AutonomousRiskFramework.jl/install.jl")

  • Rebuild
import Pkg
Pkg.instantiate() 
Pkg.precompile()
Pkg.status()
@nov05
Copy link
Author

nov05 commented Jun 3, 2025

⚠️

153 Base.run(queue::AbstractVector) = run(default_process, queue)

┌ AdversarialDriving
│  WARNING: Method definition run(AbstractArray{T, 1} where T) in module Simulators at D:\Users\guido\.julia\packages\POMDPTools\7Rekv\src\Simulators\parallel.jl:153 overwritten in module POMDPSimulators at D:\Users\guido\.julia\packages\POMDPSimulators\zxTz3\src\parallel.jl:153.
│  ERROR: Method overwriting is not permitted during Module precompilation. Use __precompile__(false) to opt-out of precompilation.
└

ChatGPT

using POMDPSimulators  # or POMDPTools, whichever you're keeping

Base.@eval begin
    # Check if not already defined
    if !isdefined(Base, :run) || !hasmethod(Base.run, Tuple{AbstractVector})
        Base.run(queue::AbstractVector) = run(default_process, queue)
    end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment