diff --git a/tools/win/template/hakoniwa-px4-win/hakoniwa/bin/run-FlightControl.bat b/tools/win/template/hakoniwa-px4-win/hakoniwa/bin/run-FlightControl.bat index ab6a183f..36e7257a 100644 --- a/tools/win/template/hakoniwa-px4-win/hakoniwa/bin/run-FlightControl.bat +++ b/tools/win/template/hakoniwa-px4-win/hakoniwa/bin/run-FlightControl.bat @@ -1,30 +1,30 @@ -@echo off -setlocal - -set "HAKO_CUSTOM_JSON_PATH=..\DroneAppWin\custom.json" -set "DRONE_CONFIG_PATH=..\config_fc" -set "HAKO_CONTROLLER_PARAM_FILE=..\drone_control\config\param-api-mixer.txt" - -if not exist "%HAKO_CUSTOM_JSON_PATH%" ( - echo ERROR: can not find "%HAKO_CUSTOM_JSON_PATH%" - exit /b 1 -) - -if not exist "%DRONE_CONFIG_PATH%\" ( - echo ERROR: can not find "%DRONE_CONFIG_PATH%" - exit /b 1 -) - -if not exist "%HAKO_CONTROLLER_PARAM_FILE%" ( - echo ERROR: can not find "%HAKO_CONTROLLER_PARAM_FILE%" - exit /b 1 -) - -REM create_mmap.bat を呼び出す -call create_mmap.bat - -..\..\out\build\x64-Release\hakoniwa\src\hako-px4sim.exe 127.0.0.1 4560 ext - -popd - -endlocal +@echo off +setlocal + +set "HAKO_CUSTOM_JSON_PATH=..\DroneAppWin\custom.json" +set "DRONE_CONFIG_PATH=..\config_fc" +set "HAKO_CONTROLLER_PARAM_FILE=..\drone_control\config\param-api-mixer.txt" + +if not exist "%HAKO_CUSTOM_JSON_PATH%" ( + echo ERROR: can not find "%HAKO_CUSTOM_JSON_PATH%" + exit /b 1 +) + +if not exist "%DRONE_CONFIG_PATH%\" ( + echo ERROR: can not find "%DRONE_CONFIG_PATH%" + exit /b 1 +) + +if not exist "%HAKO_CONTROLLER_PARAM_FILE%" ( + echo ERROR: can not find "%HAKO_CONTROLLER_PARAM_FILE%" + exit /b 1 +) + +REM create_mmap.bat を呼び出す +call create_mmap.bat + +..\..\out\build\x64-Release\hakoniwa\src\hako-px4sim.exe 127.0.0.1 4560 ext + +popd + +endlocal diff --git a/tools/win/template/hakoniwa-px4-win/hakoniwa/bin/run-PX4Control.bat b/tools/win/template/hakoniwa-px4-win/hakoniwa/bin/run-PX4Control.bat index 92aefe88..7fd81951 100644 --- a/tools/win/template/hakoniwa-px4-win/hakoniwa/bin/run-PX4Control.bat +++ b/tools/win/template/hakoniwa-px4-win/hakoniwa/bin/run-PX4Control.bat @@ -1,34 +1,34 @@ -@echo off -setlocal - -set "HAKO_CUSTOM_JSON_PATH=..\DroneAppWin\custom.json" -set "DRONE_CONFIG_PATH=..\config_px4" - -if not exist "%HAKO_CUSTOM_JSON_PATH%" ( - echo ERROR: can not find "%HAKO_CUSTOM_JSON_PATH%" - exit /b 1 -) - -if not exist "%DRONE_CONFIG_PATH%\" ( - echo ERROR: can not find "%DRONE_CONFIG_PATH%" - exit /b 1 -) - -REM create_mmap.bat を呼び出す -call create_mmap.bat - -for /f "tokens=3" %%a in ('netsh interface ip show address "vEthernet (WSL)" ^| findstr "IP Address"') do set "WSL_IP=%%a" - -if not defined WSL_IP ( - echo WSL IP address could not be found. - exit /b 1 -) - -echo WSL IP Address: %WSL_IP% - - -..\..\out\build\x64-Release\hakoniwa\src\hako-px4sim.exe %WSL_IP% 4560 sim - -popd - -endlocal +@echo off +setlocal + +set "HAKO_CUSTOM_JSON_PATH=..\DroneAppWin\custom.json" +set "DRONE_CONFIG_PATH=..\config_px4" + +if not exist "%HAKO_CUSTOM_JSON_PATH%" ( + echo ERROR: can not find "%HAKO_CUSTOM_JSON_PATH%" + exit /b 1 +) + +if not exist "%DRONE_CONFIG_PATH%\" ( + echo ERROR: can not find "%DRONE_CONFIG_PATH%" + exit /b 1 +) + +REM create_mmap.bat を呼び出す +call create_mmap.bat + +for /f "tokens=3" %%a in ('netsh interface ip show address "vEthernet (WSL)" ^| findstr "IP Address"') do set "WSL_IP=%%a" + +if not defined WSL_IP ( + echo WSL IP address could not be found. + exit /b 1 +) + +echo WSL IP Address: %WSL_IP% + + +..\..\out\build\x64-Release\hakoniwa\src\hako-px4sim.exe %WSL_IP% 4560 sim + +popd + +endlocal diff --git a/tools/win/template/hakoniwa-px4-win/hakoniwa/bin/run-RadioControl.bat b/tools/win/template/hakoniwa-px4-win/hakoniwa/bin/run-RadioControl.bat index 61b1f8dd..8cb44c29 100644 --- a/tools/win/template/hakoniwa-px4-win/hakoniwa/bin/run-RadioControl.bat +++ b/tools/win/template/hakoniwa-px4-win/hakoniwa/bin/run-RadioControl.bat @@ -1,30 +1,30 @@ -@echo off -setlocal - -set "HAKO_CUSTOM_JSON_PATH=..\DroneAppWin\custom.json" -set "DRONE_CONFIG_PATH=..\config_rc" -set "HAKO_CONTROLLER_PARAM_FILE=..\drone_control\config\param-api-mixer.txt" - -if not exist "%HAKO_CUSTOM_JSON_PATH%" ( - echo ERROR: can not find "%HAKO_CUSTOM_JSON_PATH%" - exit /b 1 -) - -if not exist "%DRONE_CONFIG_PATH%\" ( - echo ERROR: can not find "%DRONE_CONFIG_PATH%" - exit /b 1 -) - -if not exist "%HAKO_CONTROLLER_PARAM_FILE%" ( - echo ERROR: can not find "%HAKO_CONTROLLER_PARAM_FILE%" - exit /b 1 -) - -REM create_mmap.bat を呼び出す -call create_mmap.bat - -..\..\out\build\x64-Release\hakoniwa\src\hako-px4sim.exe 127.0.0.1 4560 ext - -popd - -endlocal +@echo off +setlocal + +set "HAKO_CUSTOM_JSON_PATH=..\DroneAppWin\custom.json" +set "DRONE_CONFIG_PATH=..\config_rc" +set "HAKO_CONTROLLER_PARAM_FILE=..\drone_control\config\param-api-mixer.txt" + +if not exist "%HAKO_CUSTOM_JSON_PATH%" ( + echo ERROR: can not find "%HAKO_CUSTOM_JSON_PATH%" + exit /b 1 +) + +if not exist "%DRONE_CONFIG_PATH%\" ( + echo ERROR: can not find "%DRONE_CONFIG_PATH%" + exit /b 1 +) + +if not exist "%HAKO_CONTROLLER_PARAM_FILE%" ( + echo ERROR: can not find "%HAKO_CONTROLLER_PARAM_FILE%" + exit /b 1 +) + +REM create_mmap.bat を呼び出す +call create_mmap.bat + +..\..\out\build\x64-Release\hakoniwa\src\hako-px4sim.exe 127.0.0.1 4560 ext + +popd + +endlocal diff --git a/tools/win/template/hakoniwa-px4-win/hakoniwa/bin/run-replay.bat b/tools/win/template/hakoniwa-px4-win/hakoniwa/bin/run-replay.bat index 93c03f3c..b4a85b06 100644 --- a/tools/win/template/hakoniwa-px4-win/hakoniwa/bin/run-replay.bat +++ b/tools/win/template/hakoniwa-px4-win/hakoniwa/bin/run-replay.bat @@ -1,24 +1,24 @@ -@echo off -setlocal - -set "HAKO_CUSTOM_JSON_PATH=..\DroneAppWin\custom.json" -set "DRONE_CONFIG_PATH=..\config_rc" - -if not exist "%HAKO_CUSTOM_JSON_PATH%" ( - echo ERROR: can not find "%HAKO_CUSTOM_JSON_PATH%" - exit /b 1 -) - -if not exist "%DRONE_CONFIG_PATH%\" ( - echo ERROR: can not find "%DRONE_CONFIG_PATH%" - exit /b 1 -) - -REM create_mmap.bat を呼び出す -call create_mmap.bat - -..\..\out\build\x64-Release\hakoniwa\src\hako-px4sim.exe 127.0.0.1 4560 replay - -popd - -endlocal +@echo off +setlocal + +set "HAKO_CUSTOM_JSON_PATH=..\DroneAppWin\custom.json" +set "DRONE_CONFIG_PATH=..\config_rc" + +if not exist "%HAKO_CUSTOM_JSON_PATH%" ( + echo ERROR: can not find "%HAKO_CUSTOM_JSON_PATH%" + exit /b 1 +) + +if not exist "%DRONE_CONFIG_PATH%\" ( + echo ERROR: can not find "%DRONE_CONFIG_PATH%" + exit /b 1 +) + +REM create_mmap.bat を呼び出す +call create_mmap.bat + +..\..\out\build\x64-Release\hakoniwa\src\hako-px4sim.exe 127.0.0.1 4560 replay + +popd + +endlocal