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 1, 2025

✅ CARLA installation

Custom profile loaded.
(arf_py375) PS D:\github\Stanford-AutonomousRiskFramework.jl> cd ..\Stanford-AA228VProjects\            
(arf_py375) PS D:\github\Stanford-AA228VProjects> cd D:\software\CARLA_0.9.13\WindowsNoEditor\PythonAPI
(arf_py375) PS D:\software\CARLA_0.9.13\WindowsNoEditor\PythonAPI> git clone --branch v0.9.13 --depth 1 https://github.com/carla-simulator/scenario_runner.git
Cloning into 'scenario_runner'...
remote: Enumerating objects: 200, done.
remote: Counting objects: 100% (200/200), done.
remote: Compressing objects: 100% (181/181), done.
remote: Total 200 (delta 34), reused 96 (delta 16), pack-reused 0 (from 0)
Receiving objects: 100% (200/200), 10.87 MiB | 12.75 MiB/s, done.
Resolving deltas: 100% (34/34), done.
Note: switching to '85109e7ce130a192d99e78a728ce5e12ea2744ca'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

(arf_py375) PS D:\software\CARLA_0.9.13\WindowsNoEditor\PythonAPI> cd .\scenario_runner\
(arf_py375) PS D:\software\CARLA_0.9.13\WindowsNoEditor\PythonAPI\scenario_runner> pip install -r requirements.txt
Collecting py-trees==0.8.3
  Downloading py_trees-0.8.3-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.9/61.9 kB 413.4 kB/s eta 0:00:00
Collecting networkx==2.2
  Downloading networkx-2.2.zip (1.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.7/1.7 MB 5.2 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting Shapely==1.7.1
  Downloading Shapely-1.7.1-cp37-cp37m-win_amd64.whl (1.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB 21.7 MB/s eta 0:00:00
Collecting psutil
  Downloading psutil-7.0.0-cp37-abi3-win_amd64.whl (244 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 244.9/244.9 kB 15.6 MB/s eta 0:00:00
Collecting xmlschema==1.0.18
  Downloading xmlschema-1.0.18-py2.py3-none-any.whl (358 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 359.0/359.0 kB ? eta 0:00:00
Collecting ephem
  Downloading ephem-4.2-cp37-cp37m-win_amd64.whl (1.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.4/1.4 MB 18.0 MB/s eta 0:00:00
Collecting tabulate
  Using cached tabulate-0.9.0-py3-none-any.whl (35 kB)
Collecting opencv-python==4.2.0.32
  Downloading opencv_python-4.2.0.32-cp37-cp37m-win_amd64.whl (33.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 33.0/33.0 MB 12.1 MB/s eta 0:00:00
Collecting numpy
  Using cached numpy-1.21.6-cp37-cp37m-win_amd64.whl (14.0 MB)
Collecting matplotlib
  Using cached matplotlib-3.5.3-cp37-cp37m-win_amd64.whl (7.2 MB)
Collecting six
  Downloading six-1.17.0-py2.py3-none-any.whl (11 kB)
Collecting simple-watchdog-timer
  Downloading simple_watchdog_timer-0.1.1.tar.gz (3.5 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: setuptools in d:\users\guido\miniconda3\envs\arf_py375\lib\site-packages (from py-trees==0.8.3->-r requirements.txt (line 1)) (65.6.3)
Collecting pydot
  Downloading pydot-2.0.0-py3-none-any.whl (22 kB)
Collecting decorator>=4.3.0
  Using cached decorator-5.1.1-py3-none-any.whl (9.1 kB)
Collecting elementpath~=1.3.0
  Downloading elementpath-1.3.3-py2.py3-none-any.whl (68 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 69.0/69.0 kB ? eta 0:00:00
Collecting fonttools>=4.22.0
  Downloading fonttools-4.38.0-py3-none-any.whl (965 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 965.4/965.4 kB 30.8 MB/s eta 0:00:00
Collecting pyparsing>=2.2.1
  Using cached pyparsing-3.1.4-py3-none-any.whl (104 kB)
Collecting cycler>=0.10
  Using cached cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting packaging>=20.0
  Using cached packaging-24.0-py3-none-any.whl (53 kB)
Collecting python-dateutil>=2.7
  Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Collecting kiwisolver>=1.0.1
  Downloading kiwisolver-1.4.5-cp37-cp37m-win_amd64.whl (55 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 55.8/55.8 kB ? eta 0:00:00
Collecting pillow>=6.2.0
  Downloading Pillow-9.5.0-cp37-cp37m-win_amd64.whl (2.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.5/2.5 MB 32.4 MB/s eta 0:00:00
Collecting typing-extensions
  Using cached typing_extensions-4.7.1-py3-none-any.whl (33 kB)
Building wheels for collected packages: networkx, simple-watchdog-timer
  Building wheel for networkx (setup.py) ... done
  Created wheel for networkx: filename=networkx-2.2-py2.py3-none-any.whl size=1526931 sha256=d98668ba1e155a8b379fd03d21ac316a49d459cab1a36f74e4d562a1a5f49b87
  Stored in directory: c:\users\guido\appdata\local\pip\cache\wheels\6a\79\c9\6f88a0b48d70652d1ea99ca0622616d389f05b0aaaf0086020
  Building wheel for simple-watchdog-timer (setup.py) ... done
  Created wheel for simple-watchdog-timer: filename=simple_watchdog_timer-0.1.1-py3-none-any.whl size=4451 sha256=ddcefbfd93b3961df9e8b9ac93b84f007425b707d3614a7fc6a0f06a03a388f9
  Stored in directory: c:\users\guido\appdata\local\pip\cache\wheels\6f\5f\f4\0f21af035ec96cbaa682a65ee9683e611e760b03bacec067de
Successfully built networkx simple-watchdog-timer
Installing collected packages: simple-watchdog-timer, Shapely, ephem, elementpath, xmlschema, typing-extensions, tabulate, six, pyparsing, psutil, pillow, packaging, numpy, fonttools, decorator, cycler, python-dateutil, pydot, opencv-python, networkx, kiwisolver, py-trees, matplotlib
Successfully installed Shapely-1.7.1 cycler-0.11.0 decorator-5.1.1 elementpath-1.3.3 ephem-4.2 fonttools-4.38.0 kiwisolver-1.4.5 matplotlib-3.5.3 networkx-2.2 numpy-1.21.6 opencv-python-4.2.0.32 packaging-24.0 pillow-9.5.0 psutil-7.0.0 py-trees-0.8.3 pydot-2.0.0 pyparsing-3.1.4 python-dateutil-2.9.0.post0 simple-watchdog-timer-0.1.1 six-1.17.0 tabulate-0.9.0 typing-extensions-4.7.1 xmlschema-1.0.18

@nov05
Copy link
Author

nov05 commented Jun 1, 2025

👉 error messages

Precompiling project...
  ✗ AVExperiments
  ✗ Crux
  ? RiskSimulator
  ? ScenarioSelection
  ? AutonomousRiskFramework
  0 dependencies successfully precompiled in 66 seconds. 615 already precompiled.
  3 dependencies failed but may be precompilable after restarting julia
  3 dependencies had output during precompilation:
┌ RiskSimulator
│  WARNING: Method definition propagate(AutomotiveSimulator.Entity{AdversarialDriving.BlinkerState, D, I}, AdversarialDriving.BlinkerVehicleControl, AutomotiveSimulator.Roadway{T} where T<:Real, Float64) where {D, I} in module AdversarialDriving at D:\Users\guido\.julia\dev\AdversarialDriving\src\driving_models.jl:140 overwritten in module RiskSimulator at D:\github\Stanford-AutonomousRiskFramework.jl\RiskSimulator.jl\src\scenarios\merging_roadway.jl:67. 
│  ERROR: Method overwriting is not permitted during Module precompilation. Use `__precompile__(false)` to opt-out of precompilation.
└
┌ ScenarioSelection
│  WARNING: Method definition propagate(AutomotiveSimulator.Entity{AdversarialDriving.BlinkerState, D, I}, AdversarialDriving.BlinkerVehicleControl, AutomotiveSimulator.Roadway{T} where T<:Real, Float64) where {D, I} in module AdversarialDriving at D:\Users\guido\.julia\dev\AdversarialDriving\src\driving_models.jl:140 overwritten in module RiskSimulator at D:\github\Stanford-AutonomousRiskFramework.jl\RiskSimulator.jl\src\scenarios\merging_roadway.jl:67. 
│  ERROR: Method overwriting is not permitted during Module precompilation. Use `__precompile__(false)` to opt-out of precompilation.
└
┌ AutonomousRiskFramework
│  WARNING: Method definition propagate(AutomotiveSimulator.Entity{AdversarialDriving.BlinkerState, D, I}, AdversarialDriving.BlinkerVehicleControl, AutomotiveSimulator.Roadway{T} where T<:Real, Float64) where {D, I} in module AdversarialDriving at D:\Users\guido\.julia\dev\AdversarialDriving\src\driving_models.jl:140 overwritten in module RiskSimulator at D:\github\Stanford-AutonomousRiskFramework.jl\RiskSimulator.jl\src\scenarios\merging_roadway.jl:67. 
│  ERROR: Method overwriting is not permitted during Module precompilation. Use `__precompile__(false)` to opt-out of precompilation.
└
ulia> err
PkgPrecompileError: The following 2 direct dependencies failed to precompile:

AVExperiments

Failed to precompile AVExperiments [d250a79e-4aa8-4c9f-b98e-26c2a9e55701] to "D:\\Users\\guido\\.julia\\compiled\\v1.11\\AVExperiments\\jl_9899.tmp".    
ERROR: LoadError: PyError (PyImport_ImportModule

The Python package adv_carla could not be imported by pyimport. Usually this means
that you did not install adv_carla in the Python version being used by PyCall.

PyCall is currently configured to use the Julia-specific Python distribution
installed by the Conda.jl package.  To install the adv_carla module, you can
use `pyimport_conda("adv_carla", PKG)`, where PKG is the Anaconda
package that contains the module adv_carla, or alternatively you can use the
Conda package directly (via `using Conda` followed by `Conda.add` etcetera).

Alternatively, if you want to use a different Python distribution on your
system, such as a system-wide Python (as opposed to the Julia-specific Python),
you can re-configure PyCall with that Python.   As explained in the PyCall
documentation, set ENV["PYTHON"] to the path/name of the python executable
you want to use, run Pkg.build("PyCall"), and re-launch Julia.

) <class 'ModuleNotFoundError'>
ModuleNotFoundError("No module named 'adv_carla'")

Stacktrace:
 [1] pyimport(name::String)
   @ PyCall D:\Users\guido\.julia\packages\PyCall\1gn3u\src\PyCall.jl:558
 [2] top-level scope
   @ D:\github\Stanford-AutonomousRiskFramework.jl\AVExperiments.jl\src\mdp_carla.jl:13
 [3] include(mod::Module, _path::String)
   @ Base .\Base.jl:557
 [4] include(x::String)
   @ AVExperiments D:\github\Stanford-AutonomousRiskFramework.jl\AVExperiments.jl\src\AVExperiments.jl:1
 [5] top-level scope
   @ D:\github\Stanford-AutonomousRiskFramework.jl\AVExperiments.jl\src\AVExperiments.jl:31
 [6] include
   @ .\Base.jl:557 [inlined]
 [7] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
   @ Base .\loading.jl:2881
 [8] top-level scope
   @ stdin:6
in expression starting at D:\github\Stanford-AutonomousRiskFramework.jl\AVExperiments.jl\src\mdp_carla.jl:13
in expression starting at D:\github\Stanford-AutonomousRiskFramework.jl\AVExperiments.jl\src\AVExperiments.jl:1
in expression starting at stdin:6
Crux

Failed to precompile Crux [e51cc422-768a-4345-bb8e-2246287ae729] to "D:\\Users\\guido\\.julia\\compiled\\v1.11\\Crux\\jl_989C.tmp".
ERROR: LoadError: InitError: PyError (PyImport_ImportModule

The Python package wandb could not be imported by pyimport. Usually this means
that you did not install wandb in the Python version being used by PyCall.

PyCall is currently configured to use the Julia-specific Python distribution
installed by the Conda.jl package.  To install the wandb module, you can
use `pyimport_conda("wandb", PKG)`, where PKG is the Anaconda
package that contains the module wandb, or alternatively you can use the
Conda package directly (via `using Conda` followed by `Conda.add` etcetera).

Alternatively, if you want to use a different Python distribution on your
system, such as a system-wide Python (as opposed to the Julia-specific Python),
you can re-configure PyCall with that Python.   As explained in the PyCall
documentation, set ENV["PYTHON"] to the path/name of the python executable
you want to use, run Pkg.build("PyCall"), and re-launch Julia.

) <class 'ModuleNotFoundError'>
ModuleNotFoundError("No module named 'wandb'")

Stacktrace:
  [1] pyimport(name::String)
    @ PyCall D:\Users\guido\.julia\packages\PyCall\1gn3u\src\PyCall.jl:558
  [2] __init__()
    @ WeightsAndBiasLogger D:\Users\guido\.julia\packages\WeightsAndBiasLogger\fr2H9\src\WeightsAndBiasLogger.jl:7
  [3] run_module_init(mod::Module, i::Int64)
    @ Base .\loading.jl:1378
  [4] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1366
  [5] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any}, ignore_native::Nothing; register::Bool)
    @ Base .\loading.jl:1254
  [6] _include_from_serialized (repeats 2 times)
    @ .\loading.jl:1210 [inlined]
  [7] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128, stalecheck::Bool; reasons::Dict{String, Int64}, DEPOT_PATH::Vector{String})
    @ Base .\loading.jl:2057
  [8] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:2527
  [9] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:2388
 [10] #invoke_in_world#3
    @ .\essentials.jl:1089 [inlined]
 [11] invoke_in_world
    @ .\essentials.jl:1086 [inlined]
 [12] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:2375
 [13] macro expansion
    @ .\loading.jl:2314 [inlined]
 [14] macro expansion
    @ .\lock.jl:273 [inlined]
 [15] __require(into::Module, mod::Symbol)
    @ Base .\loading.jl:2271
 [16] #invoke_in_world#3
    @ .\essentials.jl:1089 [inlined]
 [17] invoke_in_world
    @ .\essentials.jl:1086 [inlined]
 [18] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:2260
 [19] include
    @ .\Base.jl:557 [inlined]
 [20] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base .\loading.jl:2881
 [21] top-level scope
    @ stdin:6
during initialization of module WeightsAndBiasLogger
in expression starting at D:\Users\guido\.julia\dev\Crux\src\Crux.jl:1
in expression starting at stdin:6

@nov05
Copy link
Author

nov05 commented Jun 1, 2025

✅ No errors, with question marks.

julia> import Pkg

julia> Pkg.precompile()
Precompiling project...
  ? RiskSimulator
  ? ScenarioSelection
  ? AutonomousRiskFramework

julia> Pkg.status()
Status `D:\github\Stanford-AA228VProjects\project_final\Project.toml`
  [d250a79e] AVExperiments v0.1.0 `D:\github\Stanford-AutonomousRiskFramework.jl\AVExperiments.jl`
  [0f7eb3e9] AdversarialDriving v0.1.0 `D:\Users\guido\.julia\dev\AdversarialDriving`
  [f30adb48] AutonomousRiskFramework v0.1.0 `D:\github\Stanford-AutonomousRiskFramework.jl`
  [fbb218c0] BSON v0.3.9
  [e51cc422] Crux v0.1.2 `D:\Users\guido\.julia\dev\Crux`
  [e3df1716] D3Trees v0.3.3
  [31c24e10] Distributions v0.25.120
⌃ [587475ba] Flux v0.14.25
  [0d2f0bec] ImportanceWeightedRiskMetrics v0.1.0 `D:\Users\guido\.julia\dev\ImportanceWeightedRiskMetrics`
  [5903a43b] Infiltrator v1.9.1
  [7d69903b] IntelligentDriving v0.1.0 `D:\github\Stanford-AutonomousRiskFramework.jl\IntelligentDriving.jl`
  [e12ccd36] MCTS v0.5.6
  [36e58220] ObservationModels v0.1.0 `D:\github\Stanford-AutonomousRiskFramework.jl\ObservationModels.jl`
  [bac558e1] OrderedCollections v1.8.1
  [23110f14] POMDPGym v0.1.0 `D:\Users\guido\.julia\dev\POMDPGym`
  [08074719] POMDPModelTools v0.3.13
  [182e52fb] POMDPPolicies v0.4.3
  [e0d0a172] POMDPSimulators v0.3.14
  [6fc570d8] POMDPStressTesting v1.0.2 `D:\Users\guido\.julia\dev\POMDPStressTesting`
⌅ [a93abf59] POMDPs v0.9.6
  [d96e819e] Parameters v0.12.3
  [92933f4c] ProgressMeter v1.10.4
  [438e738f] PyCall v1.96.4
  [d80ce8e1] RiskSimulator v0.1.0 `D:\github\Stanford-AutonomousRiskFramework.jl\RiskSimulator.jl`
  [6ababdf7] STLCG v0.1.0 `D:\github\Stanford-AutonomousRiskFramework.jl\STLCG.jl`
  [3cd2cbe0] ScenarioSelection v0.1.0 `D:\github\Stanford-AutonomousRiskFramework.jl\ScenarioSelection.jl`
  [2746dd70] SpAutoDiff v0.1.0 `D:\Users\guido\.julia\dev\SpAutoDiff`
  [07d9af09] TreeImportanceSampling v0.1.0 `D:\Users\guido\.julia\dev\TreeImportanceSampling`
  [44eeaf0b] Vec v2.0.2 `D:\Users\guido\.julia\dev\Vec`
  [02a925ec] cuDNN v1.4.3
Info Packages marked with ⌃ and ⌅ have new versions available. Those with ⌃ may be upgradable, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use `status --outdated`

@nov05
Copy link
Author

nov05 commented Jun 1, 2025

✅ code change

  • D:\github\Stanford-AutonomousRiskFramework.jl\AVExperiments.jl\src\AVExperiments.jl
    ## Changed by Nov05
    ## https://github.com/shubhg1996/TreeImportanceSampling.jl/commit/b1f6034ec914c60f033445c5ed15c0f272cef247
    function new_planner()
        tree_mdp = TreeMDP(rmdp, 1.0, [], [], disturbance, "sum")
        # c = 0.0 # exploration bonus (NOTE: keep at 0)
        # α = rmdp.α # VaR/CVaR risk parameter
        # return TreeImportanceSampling.mcts_isdpw(tree_mdp; N, c, α)
        params = TreeImportanceSampling.TreeISParams(1.0, 0.1, 0.0, 0.0, typemax(Int), 0.0)
        TreeImportanceSampling.mcts_isdpw(tree_mdp, params; N=10)
    end
  • Git history

shubhg1996/TreeImportanceSampling.jl@b1f6034

@nov05
Copy link
Author

nov05 commented Jun 1, 2025

⚠️ Issue: redefining of function causes precompile errors.

  • D:\github\Stanford-AutonomousRiskFramework.jl\RiskSimulator.jl\src\scenarios\merging_roadway.jl redefine a function
function AutomotiveSimulator.propagate(veh::Entity{BlinkerState, D, I}, action::BlinkerVehicleControl, roadway::Roadway, Δt::Float64) where {D,I}
    starting_lane = laneid(vs)
    # @assert starting_lane == laneid(bs) # TODO: Merge into master.

In the package D:\Users\guido\.julia\dev\AdversarialDriving\src\driving_models.jl

function AutomotiveSimulator.propagate(veh::Entity{BlinkerState, D, I}, action::BlinkerVehicleControl, roadway::Roadway, Δt::Float64) where {D,I}
    starting_lane = laneid(vs)
    @assert starting_lane == laneid(bs)

Find the repo from D:\github\Stanford-AutonomousRiskFramework.jl\install.jl

packages = [
    # [deps] ObservationModel.jl
    PackageSpec(url="https://github.com/sisl/AdversarialDriving.jl"),
    PackageSpec(url="https://github.com/sisl/Vec.jl"),

@nov05
Copy link
Author

nov05 commented Jun 1, 2025

🟢 The change is no longer needed for Project.toml and Manifest.toml have been copied to the installation folder.

✅ code change

function AutomotiveSimulator.propagate(veh::Entity{BlinkerState, D, I}, action::BlinkerVehicleControl, roadway::Roadway, Δt::Float64) where {D,I}
    # starting_lane = laneid(vs)  ## nov05
    # @assert starting_lane == laneid(bs)  ## nov05
  • commented out the redefinition of the function AutomotiveSimulator.propagate().

  • generate UUID for the fork: b0df4e1a-129a-4f30-854a-a9672dfa1df1 in the Project.toml

julia> using Pkg.TOML
julia> Pkg.TOML.parsefile("D:\\github\\Stanford-AdversarialDriving.jl\\Project.toml")
Dict{String, Any} with 5 entries:
  "deps"    => Dict{String, Any}("POMDPModelTools"=>"08074719-1b2a-587c-a292-00f91cc44415", "Distributions"=>"31c24e10-a181-5473-b8eb-79…
  "name"    => "AdversarialDriving"
  "uuid"    => "0f7eb3e9-d51f-47f4-b915-6157e1c8ce29"
  "authors" => ["Anthony Corso <anthonycorso92@gmail.com>"]
  "version" => "0.1.0"
julia> using UUIDs; uuid4()
  • change D:\github\Stanford-AutonomousRiskFramework.jl\install.jl
packages = [
    # [deps] ObservationModel.jl
    # PackageSpec(url="https://github.com/sisl/AdversarialDriving.jl"),  ## removed by nov05
    PackageSpec(url="https://github.com/nov05/Stanford-AdversarialDriving.jl"),  ## added by nov05
...
]
  • rebuild
julia> cd("D:/github/Stanford-AA228VProjects/project_final")
julia> import Pkg; Pkg.activate(@__DIR__)
julia> Pkg.rm("AdversarialDriving")
julia> rm("D:\\Users\\guido\\.julia\\dev\\AdversarialDriving"; force=true, recursive=true)
julia> rm("D:\\Users\\guido\\.julia\\packages\\AdversarialDriving"; force=true, recursive=true)
julia> include("D:/github/Stanford-AutonomousRiskFramework.jl/install.jl")
julia> using AdversarialDriving

@nov05
Copy link
Author

nov05 commented Jun 2, 2025

🟢 Issue no longer exists for Project.toml and Manifest.toml have been copied to the installation folder.

packages = [
    PackageSpec(url="https://github.com/nov05/JuliaPOMDPSimulators.jl.git"),
...
]
  • rebuild
julia> Pkg.rm("POMDPSimulators")
    Updating `D:\github\Stanford-AA228VProjects\project_final\Project.toml`
  [e0d0a172] - POMDPSimulators v0.3.14
  No Changes to `D:\github\Stanford-AA228VProjects\project_final\Manifest.toml`

julia> Pkg.gc()  # garbage collect
      Active manifest files: 22 found
      Active artifact files: 209 found
      Active scratchspaces: 10 found
     Deleted no artifacts, repos, packages or scratchspaces

rm("D:\\Users\\guido\\.julia\\dev\\POMDPSimulators"; force=true, recursive=true)
rm("D:\\Users\\guido\\.julia\\packages\\POMDPSimulators"; force=true, recursive=true)

julia> include("D:/github/Stanford-AutonomousRiskFramework.jl/install.jl")
     Cloning git-repo `https://github.com/JuliaPOMDP/POMDPSimulators.jl.git`
   Resolving package versions...
   Installed BeliefUpdaters ─ v0.2.3
    Updating `D:\github\Stanford-AA228VProjects\project_final\Project.toml`
  [e0d0a172] + POMDPSimulators v0.3.13 `https://github.com/JuliaPOMDP/POMDPSimulators.jl.git#v0.3.13`
    Updating `D:\github\Stanford-AA228VProjects\project_final\Manifest.toml`
  [8bb6e9a1] + BeliefUpdaters v0.2.3
  [e0d0a172] ~ POMDPSimulators v0.3.14  v0.3.13 `https://github.com/JuliaPOMDP/POMDPSimulators.jl.git#v0.3.13`

⚠️🟢 Issue solved: Deprecated package causes errors.

ulia> planner = setup_ast(sut=system, scenario=scenario)
[ Info: Training observation model.
ERROR: UndefVarError: `simulate` not defined in `POMDPSimulators`
Suggestion: check for spelling errors or missing imports.
Hint: a global variable of this name may be made accessible by importing AutomotiveSimulator in the current active module Main
Hint: a global variable of this name may be made accessible by importing POMDPs in the current active module Main
Suggestion: check for spelling errors or missing imports.
Hint: a global variable of this name may be made accessible by importing AutomotiveSimulator in the current active module Main
Hint: a global variable of this name may be made accessible by importing POMDPs in the current active module Main
Stacktrace:
 [1] getproperty
   @ .\Base.jl:42 [inlined]
 [2] training_phase(simx::AutoRiskSim; seed::Int64, epochs::Int64)
   @ RiskSimulator D:\github\Stanford-AutonomousRiskFramework.jl\RiskSimulator.jl\src\training_phase.jl:11
 [3] training_phase
   @ D:\github\Stanford-AutonomousRiskFramework.jl\RiskSimulator.jl\src\training_phase.jl:1 [inlined]
 [4]
   @ RiskSimulator D:\github\Stanford-AutonomousRiskFramework.jl\RiskSimulator.jl\src\ast.jl:268
 [5] top-level scope
   @ REPL[5]:1
Some type information was truncated. Use `show(err)` to see complete types.

@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