Skip to content

Instantly share code, notes, and snippets.

@aadimator
Created October 23, 2021 06:00
Show Gist options
  • Save aadimator/6734501bfe3a7629395fc5165a40cff7 to your computer and use it in GitHub Desktop.
Save aadimator/6734501bfe3a7629395fc5165a40cff7 to your computer and use it in GitHub Desktop.
Carla Simulator Scripts for EmoCaps
@REM start ../CarlaUE4.exe
@echo OFF
rem How to run a Python script in a given conda environment from a batch file.
rem It doesn't require:
rem - conda to be in the PATH
rem - cmd.exe to be initialized with conda init
rem Define here the path to your conda installation
set CONDAPATH=C:\Users\aadim\miniconda3
rem Define here the name of the environment
set ENVNAME=emocaps
rem The following command activates the base environment.
rem call C:\ProgramData\Miniconda3\Scripts\activate.bat C:\ProgramData\Miniconda3
if %ENVNAME%==base (set ENVPATH=%CONDAPATH%) else (set ENVPATH=%CONDAPATH%\envs\%ENVNAME%)
rem Activate the conda environment
rem Using call is required here, see: https://stackoverflow.com/questions/24678144/conda-environments-and-bat-files
call %CONDAPATH%\Scripts\activate.bat %ENVPATH%
rem Run a python script in that environment
start python ./dynamic_weather.py
start /b python ./spawn_npc.py -n 30 -w 50
start python ./manual_control.py
@REM start python ./manual_control_steeringwheel.py
rem Deactivate the environment
call conda deactivate
@REM call conda activate emocaps
@REM python examples/manual_control.py
@REM call conda deactivate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment