From 2bcb1903f884c0db0070124212f5f45ba04c1aca Mon Sep 17 00:00:00 2001 From: donghaiwang Date: Thu, 12 Mar 2026 16:23:53 +0800 Subject: [PATCH 1/3] modify |README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b24e68f048..10cf184cad 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 神经网络实现代理 +# 神经网络实现代理 fjeifjeifjoejfaejfaiwoe 利用神经网络/ROS 实现 Carla(车辆、行人的感知、规划、控制)、AirSim、Mujoco 中人和载具的代理。 From 23905c304a259559e4d3b10c4516d6e42ad8bd37 Mon Sep 17 00:00:00 2001 From: donghaiwang Date: Tue, 17 Mar 2026 18:11:16 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0ci/cd=E7=9A=84=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E7=8E=AF=E5=A2=83=E6=AD=A5=E9=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 23 ++++++ setup.bat | 165 +++++++++++++++++++++++++++++++++++++ 2 files changed, 188 insertions(+) create mode 100644 .github/workflows/test.yml create mode 100644 setup.bat diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000000..bb3bafb92a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,23 @@ +name: Windows Tests + +on: + push: + pull_request: + + +jobs: + windows-dev: + name: Windows CI/CD + timeout-minutes: 1440 + runs-on: self-hosted:windows + + steps: + - name: Checkout repository + uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: setup + run: | + call setup.bat + shell: cmd diff --git a/setup.bat b/setup.bat new file mode 100644 index 0000000000..b2d674d057 --- /dev/null +++ b/setup.bat @@ -0,0 +1,165 @@ +@echo off + +REM Enable delayed expansion +setlocal enabledelayedexpansion + +REM Get script directory +set "PROJECT_ROOT=%~dp0" +set "PROJECT_ROOT=%PROJECT_ROOT:~0,-1%" + +REM Set virtual environment and Python paths +set "VENV_PATH=%PROJECT_ROOT%\dependencies\prerequisites\miniconda3\envs\hutb_3.10" +set "PYTHON_EXE=%VENV_PATH%\python.exe" + +REM Set CarlaUE4.exe path +set "CARLA_EXE=%PROJECT_ROOT%\hutb\CarlaUE4.exe" + +REM Set numpy_tutorial.py path +set "MAIN_AI_PY=%PROJECT_ROOT%\src\chap01_warmup\numpy_tutorial.py" + +REM Define port and URL to check +for /f "tokens=16" %%i in ('ipconfig ^|find /i "ipv4"') do set host_ip=%%i +echo IP:%host_ip% +set "PORT=3000" +set "CHECK_URL=http://%host_ip%:%PORT%" + +REM Maximum wait time in seconds for main_ai.py to start +set "MAX_WAIT=60" + +REM Wait time after starting CarlaUE4.exe +set "POST_CARLA_WAIT=3" + +if not exist "%PROJECT_ROOT%\hutb_downloader.exe" ( + curl -L -o "hutb_downloader.exe" "https://gitee.com/OpenHUTB/sw/releases/download/up/hutb_downloader.exe" +) else ( + echo hutb_downloader.exe already exists. +) + +REM 如果 dependencies 目录不存在,则下载 +if not exist "%PROJECT_ROOT%\dependencies" ( + echo dependencies directory not found. Downloading... + start /wait "" "%PROJECT_ROOT%\hutb_downloader.exe" --repository dependencies + echo Download and extraction dependencies completed. +) else ( + echo dependencies repository already exists. +) + +REM 如果之前存在模拟器进程(包括后台进程),则先杀掉 +for /f "tokens=5" %%a in ('netstat -ano ^| findstr :2000') do taskkill /F /PID %%a + +REM 如果 hutb 目录不存在,则下载 +if not exist "%PROJECT_ROOT%\hutb" ( + echo hutb directory not found. Downloading... + + REM 调用 hutb_downloader.exe,等待执行完成 + start /wait "" "%PROJECT_ROOT%\hutb_downloader.exe" + echo Download and extraction completed. +) else ( + echo hutb repository already exists. + REM Check if CarlaUE4.exe exists + if not exist "%CARLA_EXE%" ( + echo Warning: CarlaUE4.exe not found, skipping startup + echo CarlaUE4.exe path: %CARLA_EXE% + ) + start "CarlaUE4" "%CARLA_EXE%" + + REM Wait for specified time after starting CarlaUE4 + timeout /t %POST_CARLA_WAIT% /nobreak >nul +) + +REM 为了解压miniconda3 +if not exist "dependencies\prerequisites\7zip" ( + echo Unzipping 7zip ... + powershell -Command "Expand-Archive -Path 'dependencies\prerequisites\7zip.zip' -DestinationPath 'dependencies\prerequisites\' -Force" || exit /b +) else ( + echo 7zip folder already exists. +) +if not exist "%PROJECT_ROOT%\dependencies\prerequisites\miniconda3\" ( + echo Unzipping miniconda... + echo "%PROJECT_ROOT%\dependencies\prerequisites\7zip\7z.exe" x "%PROJECT_ROOT%\dependencies\prerequisites\miniconda3.zip" -o"%PROJECT_ROOT%\dependencies\prerequisites\" -y >nul + "%PROJECT_ROOT%\dependencies\prerequisites\7zip\7z.exe" x "%PROJECT_ROOT%\dependencies\prerequisites\miniconda3.zip" -o"%PROJECT_ROOT%\dependencies\prerequisites\" -y >nul +) else ( + echo miniconda3 folder already exists. +) + +REM Check if virtual environment exists +if not exist "%VENV_PATH%" ( + echo Error: Virtual environment not found at %VENV_PATH% + pause + exit /b 1 +) + +REM Check if Python interpreter exists +if not exist "%PYTHON_EXE%" ( + echo Error: Python interpreter not found at %PYTHON_EXE% + pause + exit /b 1 +) + +REM Check if numpy_tutorial.py exists +if not exist "%MAIN_AI_PY%" ( + echo Error: numpy_tutorial.py not found at %MAIN_AI_PY% + pause + exit /b 1 +) + +REM Print activation information +echo Activating virtual environment... + +REM Print Python version +echo Virtual environment activated successfully! +echo Python version: +%PYTHON_EXE% --version + +echo Install hutb package: +REM 需要关闭代理,解决安装 whl 时的代理问题: WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None))': /simple/msgpack-rpc-python/ +REM 制作 Python 环境步骤: +REM dependencies/prerequisites/miniconda3/envs/hutb_3.10/python.exe -m pip install hutb\PythonAPI\carla\dist\hutb-2.9.16-cp310-cp310-win_amd64.whl +REM dependencies/prerequisites/miniconda3/envs/hutb_3.10/python.exe -m pip install fastapi uvicorn aiohttp fastmcp loguru + +REM Set environment variables +set "PATH=%VENV_PATH%\Scripts;%VENV_PATH%;%PATH%" +set "VIRTUAL_ENV=%VENV_PATH%" + +REM 1. First, run numpy_tutorial.py +echo Running numpy_tutorial.py... +start "numpy_tutorial" "%PYTHON_EXE%" "%MAIN_AI_PY%" + +REM Wait for 5 seconds initially to give numpy_tutorial.py time to start +timeout /t 5 /nobreak >nul + +REM If port is listening, try to get a successful HTTP response +curl -s -o NUL -w "%%{http_code}" "%CHECK_URL%" | findstr "200" >nul 2>&1 +if %ERRORLEVEL% equ 0 ( + echo numpy_tutorial.py is ready and responding at %CHECK_URL%! + goto :START_CARLA +) + +:CHECK_TIMER +REM Increment wait count +set /a WAIT_COUNT=WAIT_COUNT+1 + +REM Check if maximum wait time exceeded +if !WAIT_COUNT! geq %MAX_WAIT% ( + echo Warning: Maximum wait time exceeded (%MAX_WAIT% seconds) + echo numpy_tutorial.py may not be fully ready, but continuing with CarlaUE4.exe startup... + goto :START_CARLA +) + +REM Wait for 2 seconds before checking again +echo Waiting for %PORT%... (Attempt !WAIT_COUNT! of %MAX_WAIT%) +timeout /t 2 /nobreak >nul +goto :WAIT_LOOP + +:START_CARLA +REM 2. Then, start CarlaUE4.exe asynchronously +if exist "%CARLA_EXE%" ( + echo Existing CarlaUE4.exe... +) + + +REM Set custom prompt +prompt [hutb_3.10] $P$G + +REM Keep terminal open +cmd /k \ No newline at end of file From 4fd40eac37712cd82b0e03eb8bbc3cfc9c2201c7 Mon Sep 17 00:00:00 2001 From: Haidong Wang Date: Wed, 18 Mar 2026 08:05:17 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 10cf184cad..b24e68f048 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 神经网络实现代理 fjeifjeifjoejfaejfaiwoe +# 神经网络实现代理 利用神经网络/ROS 实现 Carla(车辆、行人的感知、规划、控制)、AirSim、Mujoco 中人和载具的代理。