-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Batch file added to simply start a platoon of 3 robots.
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@echo off | ||
|
||
set PATH=%PATH%; | ||
set WEBOTS_CONTROLLER="%WEBOTS_HOME%\msys64\mingw64\bin\webots-controller.exe" | ||
set PROGRAM_NAME=program.exe | ||
set CONVOY_LEADER_PROGRAM_PATH=.pio\build\ConvoyLeaderSim | ||
set CONVOY_FOLLOWER_PROGRAM_PATH=.pio\build\ConvoyFollowerSim | ||
|
||
rem Compile Convoy Leader | ||
%USERPROFILE%\.platformio\penv\Scripts\pio.exe run --environment ConvoyLeaderSim | ||
|
||
rem Compile Convoy Follower | ||
%USERPROFILE%\.platformio\penv\Scripts\pio.exe run --environment ConvoyFollowerSim | ||
|
||
rem Start the convoy leader | ||
echo Start convoy leader. | ||
start "Convoy Leader" ""%WEBOTS_CONTROLLER%"" --robot-name=leader --stdout-redirect %CONVOY_LEADER_PROGRAM_PATH%\%PROGRAM_NAME% -c --serialRxCh=1 --serialTxCh=2 -v" | ||
|
||
rem Start the followers | ||
for /L %%i in (1, 1, 2) do ( | ||
call :start_follower %%i | ||
) | ||
|
||
exit /b | ||
|
||
:start_follower | ||
set INSTANCE=%1 | ||
set ROBOT_NAME=follower_%instance% | ||
set /a SERIAL_RX_CHANNEL=(INSTANCE * 2) + 0 | ||
set /a SERIAL_TX_CHANNEL=(INSTANCE * 2) + 1 | ||
echo Start convoy follower %INSTANCE%. | ||
start "Convoy Follower %INSTANCE%" ""%WEBOTS_CONTROLLER%"" --robot-name=%ROBOT_NAME% --stdout-redirect %CONVOY_FOLLOWER_PROGRAM_PATH%\%PROGRAM_NAME% -c --serialRxCh=%SERIAL_RX_CHANNEL% --serialTxCh=%SERIAL_TX_CHANNEL% -v" | ||
exit /b |