From 2816ab8b753d4a8edd497c9628dcea83b5274e6b Mon Sep 17 00:00:00 2001 From: vkatari10 Date: Mon, 2 Mar 2026 21:03:19 -0500 Subject: [PATCH 1/2] Fixed Python test script environment calling --- tests/Python/SimpleEchoClient/run_simple_echo_client.bat | 6 +++--- tests/Python/SimpleTrafficLight/config.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Python/SimpleEchoClient/run_simple_echo_client.bat b/tests/Python/SimpleEchoClient/run_simple_echo_client.bat index 04646161..1723dd96 100644 --- a/tests/Python/SimpleEchoClient/run_simple_echo_client.bat +++ b/tests/Python/SimpleEchoClient/run_simple_echo_client.bat @@ -30,11 +30,11 @@ timeout /t 3 /nobreak echo Starting Python Echo Client... REM Initialize conda if not already initialized if exist "%USERPROFILE%\miniconda3\Scripts\activate.bat" ( - call %USERPROFILE%\miniconda3\Scripts\activate.bat realsim_dev + call %USERPROFILE%\miniconda3\Scripts\activate.bat realsim ) else if exist "%USERPROFILE%\anaconda3\Scripts\activate.bat" ( - call %USERPROFILE%\anaconda3\Scripts\activate.bat realsim_dev + call %USERPROFILE%\anaconda3\Scripts\activate.bat realsim ) else ( - call conda activate realsim_dev + call conda activate realsim ) python %TestPath%\simple_echo_client.py diff --git a/tests/Python/SimpleTrafficLight/config.yaml b/tests/Python/SimpleTrafficLight/config.yaml index 963b9855..50359a08 100644 --- a/tests/Python/SimpleTrafficLight/config.yaml +++ b/tests/Python/SimpleTrafficLight/config.yaml @@ -33,7 +33,7 @@ ApplicationSetup: - type: ego attribute: {id: ['egoCm123'], radius: [400]} ip: ["127.0.0.1"] - port: [2444] + port: [2444] # this worked better when i changed this to port 1337 # subscription in XilSetup must be subset of ApplicationSetup XilSetup: From 285723db22ce8e94bd1512110d56a5906c97c5ee Mon Sep 17 00:00:00 2001 From: vkatari10 Date: Mon, 23 Mar 2026 19:46:20 -0400 Subject: [PATCH 2/2] Updated SimpleTrafficLight Test to be consistent with SimpleEchoClient --- environment.yml | 2 +- tests/Python/SimpleTrafficLight/config.yaml | 2 +- tests/Python/SimpleTrafficLight/run_test.bat | 39 ++++++++++++++------ 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/environment.yml b/environment.yml index 15253bc0..39fc8dc0 100644 --- a/environment.yml +++ b/environment.yml @@ -1,4 +1,4 @@ -name: realsim_dev +name: realsim channels: - conda-forge - defaults diff --git a/tests/Python/SimpleTrafficLight/config.yaml b/tests/Python/SimpleTrafficLight/config.yaml index 50359a08..963b9855 100644 --- a/tests/Python/SimpleTrafficLight/config.yaml +++ b/tests/Python/SimpleTrafficLight/config.yaml @@ -33,7 +33,7 @@ ApplicationSetup: - type: ego attribute: {id: ['egoCm123'], radius: [400]} ip: ["127.0.0.1"] - port: [2444] # this worked better when i changed this to port 1337 + port: [2444] # subscription in XilSetup must be subset of ApplicationSetup XilSetup: diff --git a/tests/Python/SimpleTrafficLight/run_test.bat b/tests/Python/SimpleTrafficLight/run_test.bat index e8dec43b..2e5413eb 100644 --- a/tests/Python/SimpleTrafficLight/run_test.bat +++ b/tests/Python/SimpleTrafficLight/run_test.bat @@ -2,38 +2,55 @@ REM Simple Traffic Light Test - TrafficLayer with Python Echo Client REM Uses simple SUMO network with signalized intersections -set TrafficLayerPath=C:\src_git\RS_FIXS\#51\TrafficLayer\x64\Debug +set RealSimPath=..\..\.. +set TestPath=. set configFilename=config.yaml +REM Check if auto-launch is enabled in config +echo Checking config for auto-launch setting... +findstr /C:"EnableAutoLaunch: true" %configFilename% >nul +if %errorlevel%==0 ( + echo [CONFIG] Auto-launch ENABLED - TrafficLayer will start SUMO automatically + echo [CONFIG] Skipping manual SUMO launch + goto :skip_sumo +) + REM Start SUMO with the traffic light test scenario -echo Starting SUMO with traffic light test scenario... -start sumo-gui -c simple_traffic_light.sumocfg --remote-port 1337 --step-length 0.1 --start --num-clients 1 +echo [CONFIG] Auto-launch DISABLED - Starting SUMO manually... +start sumo-gui -c %TestPath%\simple_traffic_light.sumocfg --start --remote-port 1337 --step-length 0.1 --num-clients 1 echo Waiting for SUMO to initialize... timeout /t 2 /nobreak +:skip_sumo REM Start TrafficLayer.exe echo Starting TrafficLayer.exe... -start cmd /c "%TrafficLayerPath%\TrafficLayer.exe" -f %configFilename% +if exist "%RealSimPath%\TrafficLayer\x64\Release\TrafficLayer.exe" ( + start cmd /c "%RealSimPath%\TrafficLayer\x64\Release\TrafficLayer.exe" -f %configFilename% +) else if exist "%RealSimPath%\TrafficLayer\x64\Debug\TrafficLayer.exe" ( + start cmd /c "%RealSimPath%\TrafficLayer\x64\Debug\TrafficLayer.exe" -f %configFilename% +) else ( + echo [ERROR] Could not find TrafficLayer.exe in Release or Debug under %RealSimPath%\TrafficLayer\x64 + goto :end +) echo Waiting for TrafficLayer to initialize... timeout /t 3 /nobreak REM Start Python Echo Client echo Starting Python Echo Client... -REM Initialize conda +REM Initialize conda if not already initialized if exist "%USERPROFILE%\miniconda3\Scripts\activate.bat" ( - call %USERPROFILE%\miniconda3\Scripts\activate.bat - call conda activate realsim + call %USERPROFILE%\miniconda3\Scripts\activate.bat realsim ) else if exist "%USERPROFILE%\anaconda3\Scripts\activate.bat" ( - call %USERPROFILE%\anaconda3\Scripts\activate.bat - call conda activate realsim + call %USERPROFILE%\anaconda3\Scripts\activate.bat realsim ) else ( call conda activate realsim ) -python echo_client.py +python %TestPath%\echo_client.py call conda deactivate -pause \ No newline at end of file +:end +pause