Tools: APM source is not required to be in Cygwin dir

This commit is contained in:
Stephen Dade 2017-06-12 12:58:45 +10:00 committed by Francisco Ferreira
parent b42fb31d7d
commit b6816285e5
9 changed files with 127 additions and 48 deletions

View File

@ -1,4 +1,4 @@
#Powershell script to donwload and configure the APM SITL environment
#Powershell script to download and configure the APM SITL environment
Import-Module BitsTransfer
@ -11,14 +11,14 @@ Write-Output "Downloading Cygwin x64 (2/6)"
Start-BitsTransfer -Source "https://cygwin.com/setup-x86_64.exe" -Destination "$PSScriptRoot\setup-x86_64.exe"
Write-Output "Installing Cygwin x64 (3/6)"
& $PSScriptRoot\setup-x86_64.exe --root="C:\cygwin" --no-startmenu --local-package-dir=$env:USERPROFILE\Downloads --site="http://cygwin.mirror.constant.com" --packages autoconf,automake,ccache,gcc-g++,git,libtool,make,gawk,libexpat-devel, libxml2-devel,python-libxml2,libxslt-devel,python-devel,procps-ng --quiet-mode | Out-Null
#& $PSScriptRoot\setup-x86_64.exe --root="C:\cygwin" --no-startmenu --local-package-dir=$env:USERPROFILE\Downloads --site="http://cygwin.mirror.constant.com" --packages autoconf,automake,ccache,gcc-g++,git,libtool,make,gawk,libexpat-devel, libxml2-devel,python-libxml2,libxslt-devel,python-devel,procps-ng --quiet-mode | Out-Null
Start-Process -wait -FilePath $PSScriptRoot\setup-x86_64.exe -ArgumentList "--root=C:\cygwin --no-startmenu --local-package-dir=$env:USERPROFILE\Downloads --site=http://cygwin.mirror.constant.com --packages autoconf,automake,ccache,gcc-g++,git,libtool,make,gawk,libexpat-devel, libxml2-devel,python-libxml2,libxslt-devel,python-devel,procps-ng --quiet-mode"
Write-Output "Configuring Cygwin (4/6)"
Copy-Item apm_install.sh C:\cygwin\home
Write-Output "Copying JSBSim install script Cygwin (4/6)"
Copy-Item jsbsim_install.sh C:\cygwin\home
Write-Output "Downloading APM Source Code Cygwin (5/6)"
Start-Process -wait -FilePath "C:\cygwin\bin\bash" -ArgumentList "--login -i -c ../apm_install.sh"
Write-Output "Downloading JSBSim Cygwin (5/6)"
Start-Process -wait -FilePath "C:\cygwin\bin\bash" -ArgumentList "--login -i -c ../jsbsim_install.sh"
Write-Output "Installing MAVProxy (6/6)"
& $PSScriptRoot\MAVProxySetup-latest.exe /SILENT | Out-Null

View File

@ -0,0 +1,27 @@
#Powershell script to download and configure the APM SITL environment
Import-Module BitsTransfer
Write-Output "Starting Downloads"
Write-Output "Downloading MAVProxy (1/6)"
Start-BitsTransfer -Source "http://firmware.ardupilot.org/Tools/MAVProxy/MAVProxySetup-latest.exe" -Destination "$PSScriptRoot\MAVProxySetup-latest.exe"
Write-Output "Downloading Cygwin x64 (2/6)"
Start-BitsTransfer -Source "https://cygwin.com/setup-x86_64.exe" -Destination "$PSScriptRoot\setup-x86_64.exe"
Write-Output "Installing Cygwin x64 (3/6)"
#& $PSScriptRoot\setup-x86_64.exe --root="C:\cygwin" --no-startmenu --local-package-dir=$env:USERPROFILE\Downloads --site="http://cygwin.mirror.constant.com" --packages autoconf,automake,ccache,gcc-g++,git,libtool,make,gawk,libexpat-devel, libxml2-devel,python-libxml2,libxslt-devel,python-devel,procps-ng --quiet-mode | Out-Null
Start-Process -wait -FilePath $PSScriptRoot\setup-x86_64.exe -ArgumentList "--root=C:\cygwin --no-startmenu --local-package-dir=$env:USERPROFILE\Downloads --site=http://cygwin.mirror.constant.com --packages autoconf,automake,ccache,gcc-g++,git,libtool,make,gawk,libexpat-devel, libxml2-devel,python-libxml2,libxslt-devel,python-devel,procps-ng --quiet-mode"
Write-Output "Copying JSBSim APM install script Cygwin (4/6)"
Copy-Item jsbsimAPM_install.sh C:\cygwin\home
Write-Output "Downloading JSBSim and APM (5/6)"
Start-Process -wait -FilePath "C:\cygwin\bin\bash" -ArgumentList "--login -i -c ../jsbsimAPM_install.sh"
Write-Output "Installing MAVProxy (6/6)"
& $PSScriptRoot\MAVProxySetup-latest.exe /SILENT | Out-Null
Write-Host "Finished. Press any key to continue ..."
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")

View File

@ -1,4 +1,14 @@
rem File run APM:Copter SITL
SETLOCAL enableextensions
@echo off
rem Assumes a Cgywin install at C:\cygwin
chdir C:\cygwin\bin
bash --login -i -c "cd ./ardupilot/ArduCopter && ../Tools/autotest/sim_vehicle.py"
if "%CYGWIN_LOCATION%" == "" (set "CYGWIN_LOCATION=C:\cygwin")
rem get current dir for Cygwin
set pth=%CD:~2,99%
set pth=%pth:\=/%
set drv=%CD:~0,1%
set "fullpath=/cygdrive/%drv%%pth%"
%CYGWIN_LOCATION%\bin\bash.exe --login -i -c "cd ""%fullpath%"" && cd ../../../ArduCopter && ../Tools/autotest/sim_vehicle.py"

View File

@ -1,4 +1,14 @@
rem File run APM:Plane SITL
SETLOCAL enableextensions
@echo off
rem Assumes a Cgywin install at C:\cygwin
chdir C:\cygwin\bin
bash --login -i -c "cd ./ardupilot/ArduPlane && ../Tools/autotest/sim_vehicle.py"
if "%CYGWIN_LOCATION%" == "" (set "CYGWIN_LOCATION=C:\cygwin")
rem get current dir for Cygwin
set pth=%CD:~2,99%
set pth=%pth:\=/%
set drv=%CD:~0,1%
set "fullpath=/cygdrive/%drv%%pth%"
%CYGWIN_LOCATION%\bin\bash.exe --login -i -c "cd ""%fullpath%"" && cd ../../../ArduPlane && ../Tools/autotest/sim_vehicle.py"

View File

@ -1,4 +1,14 @@
rem File run APM:Rover SITL
SETLOCAL enableextensions
@echo off
rem Assumes a Cgywin install at C:\cygwin
chdir C:\cygwin\bin
bash --login -i -c "cd ./ardupilot/APMrover2 && ../Tools/autotest/sim_vehicle.py"
if "%CYGWIN_LOCATION%" == "" (set "CYGWIN_LOCATION=C:\cygwin")
rem get current dir for Cygwin
set pth=%CD:~2,99%
set pth=%pth:\=/%
set drv=%CD:~0,1%
set "fullpath=/cygdrive/%drv%%pth%"
%CYGWIN_LOCATION%\bin\bash.exe --login -i -c "cd ""%fullpath%"" && cd ../../../APMrover2 && ../Tools/autotest/sim_vehicle.py"

View File

@ -1,5 +1,17 @@
rem File to update the APM source
rem Assumes a Cgywin install at C:\cygwin
chdir C:\cygwin\bin
bash --login -i -c "cd ./ardupilot && git pull && git submodule update --init --recursive"
@echo off
rem get current dir for Cygwin
set pth=%CD:~2,99%
set pth=%pth:\=/%
set drv=%CD:~0,1%
set "fullpath=/cygdrive/%drv%%pth%"
rem update the source
C:\cygwin\bin\bash.exe --login -i -c "cd ""%fullpath%"" && cd ../../../ && git pull && git submodule update --init --recursive"
rem re-configure build config
C:\cygwin\bin\bash.exe --login -i -c "cd ""%fullpath%"" && cd ../../../ && ./modules/waf/waf-light configure --board=sitl"
pause

View File

@ -0,0 +1,11 @@
#!/bin/bash
#A simple script to install the APM SITL environment into cygwin
python -m ensurepip --user
python -m pip install --user future
git clone git://github.com/tridge/jsbsim.git
cd jsbsim
./autogen.sh
make
cp src/JSBSim.exe /usr/local/bin

View File

@ -1,6 +1,6 @@
SITL for Windows Automatic Installation Scripts
This is a collection of batch files to automatically install and run APM SITL (http://ardupilot.org/dev/docs/sitl-simulator-software-in-the-loop.html) on a Windows-based PC/laptop.
This is a collection of batch files to automatically install and run APM SITL required libraries (http://ardupilot.org/dev/docs/sitl-simulator-software-in-the-loop.html) on a Windows-based PC/laptop.
The scripts are based on the SITL setup instructions here: http://ardupilot.org/dev/docs/sitl-native-on-windows.html
Prerequisites:
@ -8,16 +8,21 @@ Prerequisites:
None! The scripts will take care of everything.
You will need an Internet connection and an hour of time (will be less with a fast Internet connection) for the scripts to download and install everything.
Assumptions:
1) Assumptions:
The scripts will install Cygwin, MAVProxy and the APM source to C:\cygwin. So access to the C:\ drive is required.
The scripts will install Cygwin (to C:\cygwin) and MAVProxy. So access to the C:\ drive is required.
Installing:
There are 2 options for installation: Just the development environment (2A) , or the development environment plus APM source code (2B). The first option is for users that already have the APM source code on their computer (or wish to have it in a particular folder). The second option will download and configure the APM source code too, which is easier for new users.
Download these scripts and unzip
Run the script "InstallCygwinAPM.ps1" (right click -> Run in Powershell). This will install Cygwin to C:\cygwin and MAVProxy to C:\Program Files (x86)\MAVProxy
2A) Installing just the Development Environment:
Running SITL:
Run the script "InstallDevEnvironment.ps1" (right click -> Run in Powershell). This will install Cygwin to C:\cygwin and MAVProxy to C:\Program Files (x86)\MAVProxy
2B) Installing the Development Environment and APM source code:
Run the script "InstallDevEnvironmentAndAPMSource.ps1" (right click -> Run in Powershell). This will install Cygwin to C:\cygwin and MAVProxy to C:\Program Files (x86)\MAVProxy. The APM source code will be in C:\cygwin\home\<username>\ardupilot
3) Running SITL:
There are several options for running SITL. In all cases, SITL will output a mavlink stream on 127.0.0.1:14550 (UDP) for connection to any GCS software (Such as Mission Planner).
@ -29,13 +34,7 @@ To continue with the current EEPROM, run:
RunPlane.bat for running APM:Plane
RunRover.bat for running APM:Rover
To delete the old EEPROM and start with all default settings, run:
ResetRunCopter.bat for a quadcopter running APM:Copter
ResetRunPlane.bat for running APM:Plane
ResetRunRover.bat for running APM:Rover
Updating the APM source code
4) Updating the APM source code
To update the APM code with the latest of Github, run UpdateAPMSource.bat. Note this is bleeding-edge source code and some bugs may be present.
Deleting the SITL environment