Skip to content

Commit

Permalink
Merge branch 'master' of https://lovettchris:91452d1c2fad412ebbd59e3c…
Browse files Browse the repository at this point in the history
[email protected]/Microsoft/AirSim.git
  • Loading branch information
lovettchris committed Mar 23, 2018
2 parents 6ff1fd5 + b484227 commit 27a92c7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
11 changes: 11 additions & 0 deletions PythonClient/AirSimClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,17 @@ class CarControls(MsgpackMixin):
manual_gear = 0
gear_immediate = True

def __init__(self, throttle = 0, steering = 0, brake = 0,
handbrake = False, is_manual_gear = False, manual_gear = 0, gear_immediate = True):
self.throttle = throttle
self.steering = steering
self.brake = brake
self.handbrake = handbrake
self.is_manual_gear = is_manual_gear
self.manual_gear = manual_gear
self.gear_immediate = gear_immediate


def set_throttle(self, throttle_val, forward):
if (forward):
is_manual_gear = False
Expand Down
4 changes: 2 additions & 2 deletions Unreal/Plugins/AirSim/Source/Car/CarPawn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,10 @@ void ACarPawn::setupInputBindings()
UAirBlueprintLib::BindAxisToKey(FInputAxisKeyMapping("MoveForward", EKeys::Down, -1), this,
this, &ACarPawn::MoveForward);

UAirBlueprintLib::BindAxisToKey(FInputAxisKeyMapping("MoveRight", EKeys::Right, 0.1), this,
UAirBlueprintLib::BindAxisToKey(FInputAxisKeyMapping("MoveRight", EKeys::Right, 0.5), this,
this, &ACarPawn::MoveRight);

UAirBlueprintLib::BindAxisToKey(FInputAxisKeyMapping("MoveRight", EKeys::Left, -0.1), this,
UAirBlueprintLib::BindAxisToKey(FInputAxisKeyMapping("MoveRight", EKeys::Left, -0.5), this,
this, &ACarPawn::MoveRight);

UAirBlueprintLib::BindActionToKey("Handbrake", EKeys::End, this, &ACarPawn::OnHandbrakePressed, true);
Expand Down
8 changes: 4 additions & 4 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ robocopy /MIR external\rpclib\rpclib-2.2.1\build\Release %RPCLIB_TARGET_LIB%\Rel

REM //---------- get High PolyCount SUV Car Model ------------
IF NOT EXIST Unreal\Plugins\AirSim\Content\VehicleAdv mkdir Unreal\Plugins\AirSim\Content\VehicleAdv
IF NOT EXIST Unreal\Plugins\AirSim\Content\VehicleAdv\SUV\v1.1.7 (
IF NOT EXIST Unreal\Plugins\AirSim\Content\VehicleAdv\SUV\v1.1.9 (
IF NOT DEFINED noFullPolyCar (
REM //leave some blank lines because powershell shows download banner at top of console
ECHO(
Expand All @@ -89,9 +89,9 @@ IF NOT EXIST Unreal\Plugins\AirSim\Content\VehicleAdv\SUV\v1.1.7 (
IF EXIST suv_download_tmp rmdir suv_download_tmp /q /s
mkdir suv_download_tmp
@echo on
REM powershell -command "& { Start-BitsTransfer -Source https://github.com/Microsoft/AirSim/releases/download/v1.1.7/car_assets.zip -Destination suv_download_tmp\car_assets.zip }"
REM powershell -command "& { (New-Object System.Net.WebClient).DownloadFile('https://github.com/Microsoft/AirSim/releases/download/v1.1.7/car_assets.zip', 'suv_download_tmp\car_assets.zip') }"
powershell -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iwr https://github.com/Microsoft/AirSim/releases/download/v1.1.7/car_assets.zip -OutFile suv_download_tmp\car_assets.zip }"
REM powershell -command "& { Start-BitsTransfer -Source https://github.com/Microsoft/AirSim/releases/download/v1.1.9/car_assets.zip -Destination suv_download_tmp\car_assets.zip }"
REM powershell -command "& { (New-Object System.Net.WebClient).DownloadFile('https://github.com/Microsoft/AirSim/releases/download/v1.1.9/car_assets.zip', 'suv_download_tmp\car_assets.zip') }"
powershell -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iwr https://github.com/Microsoft/AirSim/releases/download/v1.1.9/car_assets.zip -OutFile suv_download_tmp\car_assets.zip }"
@echo off
rmdir /S /Q Unreal\Plugins\AirSim\Content\VehicleAdv\SUV
powershell -command "& { Expand-Archive -Path suv_download_tmp\car_assets.zip -DestinationPath Unreal\Plugins\AirSim\Content\VehicleAdv }"
Expand Down
7 changes: 5 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ fi
if [ ! -d "Unreal/Plugins/AirSim/Content/VehicleAdv" ]; then
mkdir -p "Unreal/Plugins/AirSim/Content/VehicleAdv"
fi
if [ ! -d "Unreal/Plugins/AirSim/Content/VehicleAdv/SUV/v1.1.7" ]; then
if [ ! -d "Unreal/Plugins/AirSim/Content/VehicleAdv/SUV/v1.1.9" ]; then
if $downloadHighPolySuv; then
echo "*********************************************************************************************"
echo "Downloading high-poly car assets.... The download is ~37MB and can take some time."
Expand All @@ -98,7 +98,10 @@ if [ ! -d "Unreal/Plugins/AirSim/Content/VehicleAdv/SUV/v1.1.7" ]; then
fi
mkdir -p "suv_download_tmp"
cd suv_download_tmp
wget https://github.com/Microsoft/AirSim/releases/download/v1.1.7/car_assets.zip
wget https://github.com/Microsoft/AirSim/releases/download/v1.1.9/car_assets.zip
if [ -d "../Unreal/Plugins/AirSim/Content/VehicleAdv/SUV" ]; then
rm -rf "../Unreal/Plugins/AirSim/Content/VehicleAdv/SUV"
fi
unzip car_assets.zip -d ../Unreal/Plugins/AirSim/Content/VehicleAdv
cd ..
rm -rf "suv_download_tmp"
Expand Down

0 comments on commit 27a92c7

Please sign in to comment.