diff --git a/.gitignore b/.gitignore index adacf36bf3..5c28b02103 100644 --- a/.gitignore +++ b/.gitignore @@ -359,13 +359,17 @@ xcuserdata/ /*.gcno # Unity -/Unity/UnityDemo/Library /Unity/UnityDemo/Assembly-CSharp.csproj /Unity/UnityDemo/UnityDemo.sln -/Unity/UnityDemo/Logs/ -/Unity/UnityDemo/Assets/Plugins/AirsimWrapper.dll -/Unity/UnityDemo/Assets/Plugins/libAirsimWrapper.so -/Unity/linux-build/ +/Unity/linux-build +/Unity/UnityDemo/Assets/Plugins/ +/Unity/UnityDemo/[Ll]ibrary/ +/Unity/UnityDemo/[Tt]emp/ +/Unity/UnityDemo/[Oo]bj/ +/Unity/UnityDemo/[Bb]uild/ +/Unity/UnityDemo/[Bb]uilds/ +/Unity/UnityDemo/[Ll]ogs/ +/Unity/UnityDemo/[Uu]ser[Ss]ettings/ # ROS ros/.catkin_tools/ diff --git a/Unity/AirLibWrapper/AirsimWrapper/CMakeLists.txt b/Unity/AirLibWrapper/AirsimWrapper/CMakeLists.txt index 140772d5f7..47089e6138 100644 --- a/Unity/AirLibWrapper/AirsimWrapper/CMakeLists.txt +++ b/Unity/AirLibWrapper/AirsimWrapper/CMakeLists.txt @@ -22,12 +22,22 @@ IncludeEigen() project(AirsimWrapper VERSION 0) +find_package(Boost REQUIRED COMPONENTS filesystem) +if(Boost_FOUND) + MESSAGE("Boost information:") + MESSAGE(" Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}") + MESSAGE(" Boost_LIBRARIES: ${Boost_LIBRARIES}") + MESSAGE(" Boost_LIBRARY_DIRS: ${Boost_LIBRARY_DIRS}") +endif() + +include_directories(${Boost_INCLUDE_DIRS}) + # RPC includes & source files BuildRpc() # MavLink source files BuildMavLink() #AirLib source files -BuildAirlib() +BuildAirLib() #AirsimWrapper source files BuildAirsimWrapper() @@ -53,7 +63,7 @@ else () ) endif () -target_link_libraries(${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT} -lstdc++ -lpthread -lboost_filesystem) +target_link_libraries(${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT} -lstdc++ -lpthread ${Boost_LIBRARIES}) diff --git a/Unity/AirLibWrapper/AirsimWrapper/cmake/airlib-setup.cmake b/Unity/AirLibWrapper/AirsimWrapper/cmake/airlib-setup.cmake index d6a11bb963..0ca56b1717 100644 --- a/Unity/AirLibWrapper/AirsimWrapper/cmake/airlib-setup.cmake +++ b/Unity/AirLibWrapper/AirsimWrapper/cmake/airlib-setup.cmake @@ -10,8 +10,7 @@ file(GLOB_RECURSE AIRLIB_LIBRARY_SOURCE_FILES ${AIRSIM_ROOT}/AirLib/src/api/*.cpp ${AIRSIM_ROOT}/AirLib/src/common/common_utils/*.cpp ${AIRSIM_ROOT}/AirLib/src/safety/*.cpp - ${AIRSIM_ROOT}/AirLib/src/vehicles/car/api/*.cpp - ${AIRSIM_ROOT}/AirLib/src/vehicles/multirotor/api/*.cpp + ${AIRSIM_ROOT}/AirLib/src/vehicles/car/*.cpp ${AIRSIM_ROOT}/AirLib/src/vehicles/multirotor/*.cpp ) diff --git a/Unity/AirLibWrapper/AirsimWrapper/cmake/rpc-setup.cmake b/Unity/AirLibWrapper/AirsimWrapper/cmake/rpc-setup.cmake index 82b7daf19f..5a5723be44 100644 --- a/Unity/AirLibWrapper/AirsimWrapper/cmake/rpc-setup.cmake +++ b/Unity/AirLibWrapper/AirsimWrapper/cmake/rpc-setup.cmake @@ -275,7 +275,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") set(UNUSED_LAMBDA_CAPTURE_WARN_SUPPORTED) check_warning_flag("unused-lambda-capture" UNUSED_LAMBDA_CAPTURE_WARN_SUPPORTED) if(${UNUSED_LAMBDA_CAPTURE_WARN_SUPPORTED}) - list(APPEND RPCLIB_BUILD_FLAGS -Wno-no-unused-lambda-capture) + list(APPEND RPCLIB_BUILD_FLAGS -Wno-unused-lambda-capture) endif() check_warning_flag("zero-as-null-pointer-constant" ZERO_AS_NULL_POINTER_CONSTANT_WARN_SUPPORTED) diff --git a/Unity/UnityDemo/Assets/AirSimAssets/Scripts/Utilities/DataCaptureScript.cs b/Unity/UnityDemo/Assets/AirSimAssets/Scripts/Utilities/DataCaptureScript.cs index ceab004ad0..41121e65cd 100644 --- a/Unity/UnityDemo/Assets/AirSimAssets/Scripts/Utilities/DataCaptureScript.cs +++ b/Unity/UnityDemo/Assets/AirSimAssets/Scripts/Utilities/DataCaptureScript.cs @@ -94,6 +94,10 @@ public void SetOrientation(AirSimQuaternion orientation) { isPoseOverride = true; } + public void SetFoV(float fov_degrees) { + fov = fov_degrees; + } + public void ToggleRecording() { isCapturing = !isCapturing; if (isCapturing) { @@ -213,4 +217,4 @@ private void SetUpRenderTextureForCapture(ImageType type) { captureRect = new Rect(0, 0, captureSettings.Width, captureSettings.Height); } } -} \ No newline at end of file +} diff --git a/Unity/UnityDemo/Assets/AirSimAssets/Scripts/Utilities/PInvokeWrapper.cs b/Unity/UnityDemo/Assets/AirSimAssets/Scripts/Utilities/PInvokeWrapper.cs index 5e11cba0bc..ac1ec3deb8 100644 --- a/Unity/UnityDemo/Assets/AirSimAssets/Scripts/Utilities/PInvokeWrapper.cs +++ b/Unity/UnityDemo/Assets/AirSimAssets/Scripts/Utilities/PInvokeWrapper.cs @@ -13,7 +13,7 @@ public static class PInvokeWrapper { [DllImport(DLL_NAME)] public static extern void InitVehicleManager(IntPtr SetPose, IntPtr GetPose, IntPtr GetCollisionInfo, IntPtr GetRCData, IntPtr GetSimImages, IntPtr SetRotorSpeed, IntPtr SetEnableApi, IntPtr SetCarApiControls, IntPtr GetCarState, - IntPtr GetCameraInfo, IntPtr SetCameraOrientation, IntPtr SetSegmentationObjectid, IntPtr GetSegmentationObjectId, + IntPtr GetCameraInfo, IntPtr SetCameraOrientation, IntPtr SetCameraFoV, IntPtr SetSegmentationObjectid, IntPtr GetSegmentationObjectId, IntPtr PrintLogMessage, IntPtr GetTransformFromUnity, IntPtr Reset, IntPtr GetVelocity, IntPtr GetRayCastHit, IntPtr Pause); [DllImport(DLL_NAME)] @@ -37,4 +37,4 @@ public static extern void InitVehicleManager(IntPtr SetPose, IntPtr GetPose, Int [DllImport(DLL_NAME)] public static extern void InvokeCollisionDetection(CollisionInfo collisionInfo); } -} \ No newline at end of file +} diff --git a/Unity/UnityDemo/Assets/AirSimAssets/Scripts/Vehicles/IVehicleInterface.cs b/Unity/UnityDemo/Assets/AirSimAssets/Scripts/Vehicles/IVehicleInterface.cs index 39caf7ffdf..7a865ddee4 100644 --- a/Unity/UnityDemo/Assets/AirSimAssets/Scripts/Vehicles/IVehicleInterface.cs +++ b/Unity/UnityDemo/Assets/AirSimAssets/Scripts/Vehicles/IVehicleInterface.cs @@ -35,6 +35,8 @@ public interface IVehicleInterface { bool SetCameraOrientation(string cameraName, AirSimQuaternion orientation); + bool SetCameraFoV(string cameraName, float fov_degrees); + bool PrintLogMessage(string message, string messageParams, string vehicleName, int severity); void ResetVehicle(); @@ -45,4 +47,4 @@ public interface IVehicleInterface { bool Pause(float timeScale); } -} \ No newline at end of file +} diff --git a/Unity/UnityDemo/Assets/AirSimAssets/Scripts/Vehicles/Vehicle.cs b/Unity/UnityDemo/Assets/AirSimAssets/Scripts/Vehicles/Vehicle.cs index 3fee1cc294..488b80fdc3 100644 --- a/Unity/UnityDemo/Assets/AirSimAssets/Scripts/Vehicles/Vehicle.cs +++ b/Unity/UnityDemo/Assets/AirSimAssets/Scripts/Vehicles/Vehicle.cs @@ -187,7 +187,7 @@ public AirSimPose GetPose() { public UnityTransform GetTransform() { - return new UnityTransform(new AirSimQuaternion(currentPose.orientation.x, currentPose.orientation.y, currentPose.orientation.z, currentPose.orientation.w), + return new UnityTransform(new AirSimQuaternion(currentPose.orientation.x, currentPose.orientation.y, currentPose.orientation.z, currentPose.orientation.w), new AirSimVector(currentPose.position.x, currentPose.position.y, currentPose.position.z), new AirSimVector(scale3D.x, scale3D.y, scale3D.z)); } @@ -274,6 +274,16 @@ public bool SetCameraOrientation(string cameraName, AirSimQuaternion orientation return false; } + public bool SetCameraFoV(string cameraName, float fov_degrees) { + foreach(DataCaptureScript capture in captureCameras) { + if (capture.GetCameraName() == cameraName) { + capture.SetFoV(fov_degrees); + return true;; + } + } + return false; + } + public bool PrintLogMessage(string message, string messageParams, string vehicleName, int severity) { if (!print_log_messages_) @@ -318,7 +328,7 @@ private void InitializeVehicle() { //Setting the initial get pose(HomePoint in AirLib) values to that of vehicle's location in the scene for initial setup in AirLib DataManager.SetToAirSim(transform.position, ref currentPose.position); DataManager.SetToAirSim(transform.rotation, ref currentPose.orientation); - + collisionInfo.SetDefaultValues(); SetUpCameras(); captureResetEvent = new AutoResetEvent(false); @@ -352,4 +362,4 @@ private void UpdateSegmentationView() { } } } -} \ No newline at end of file +} diff --git a/Unity/UnityDemo/Assets/AirSimAssets/Scripts/Vehicles/VehicleCompanion.cs b/Unity/UnityDemo/Assets/AirSimAssets/Scripts/Vehicles/VehicleCompanion.cs index 2e88f51ba0..20015e93ff 100644 --- a/Unity/UnityDemo/Assets/AirSimAssets/Scripts/Vehicles/VehicleCompanion.cs +++ b/Unity/UnityDemo/Assets/AirSimAssets/Scripts/Vehicles/VehicleCompanion.cs @@ -94,6 +94,7 @@ private static void InitDelegators() { Marshal.GetFunctionPointerForDelegate(new Func(GetCarState)), Marshal.GetFunctionPointerForDelegate(new Func(GetCameraInfo)), Marshal.GetFunctionPointerForDelegate(new Func(SetCameraOrientation)), + Marshal.GetFunctionPointerForDelegate(new Func(SetCameraFoV)), Marshal.GetFunctionPointerForDelegate(new Func(SetSegmentationObjectId)), Marshal.GetFunctionPointerForDelegate(new Func(GetSegmentationObjectId)), Marshal.GetFunctionPointerForDelegate(new Func(PrintLogMessage)), @@ -188,6 +189,11 @@ private static bool SetCameraOrientation(string cameraName, AirSimQuaternion ori return vehicle.VehicleInterface.SetCameraOrientation(cameraName, orientation); } + private static bool SetCameraFoV(string cameraName, float fov_degrees, string vehicleName) { + var vehicle = Vehicles.Find(element => element.vehicleName == vehicleName); + return vehicle.VehicleInterface.SetCameraFoV(cameraName, fov_degrees); + } + private static bool PrintLogMessage(string message, string messageParams, string vehicleName, int severity) { var vehicle = Vehicles.Find(element => element.vehicleName == vehicleName); return vehicle.VehicleInterface.PrintLogMessage(message, messageParams, vehicleName, severity); @@ -207,4 +213,4 @@ private static bool Pause(string vehicleName, float timeScale) return vehicle.VehicleInterface.Pause(timeScale); } } -} \ No newline at end of file +} diff --git a/Unity/UnityDemo/Assets/Plugins/AirsimWrapper.dll.meta b/Unity/UnityDemo/Assets/Plugins/AirsimWrapper.dll.meta deleted file mode 100644 index 7ea7266f98..0000000000 --- a/Unity/UnityDemo/Assets/Plugins/AirsimWrapper.dll.meta +++ /dev/null @@ -1,24 +0,0 @@ -fileFormatVersion: 2 -guid: 989e56d442859a04eb455dc6046f3394 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Unity/UnityDemo/Packages/manifest.json b/Unity/UnityDemo/Packages/manifest.json new file mode 100644 index 0000000000..02b99bbd1f --- /dev/null +++ b/Unity/UnityDemo/Packages/manifest.json @@ -0,0 +1,46 @@ +{ + "dependencies": { + "com.unity.2d.sprite": "1.0.0", + "com.unity.2d.tilemap": "1.0.0", + "com.unity.collab-proxy": "1.2.16", + "com.unity.ext.nunit": "1.0.0", + "com.unity.ide.rider": "1.1.4", + "com.unity.ide.vscode": "1.2.0", + "com.unity.multiplayer-hlapi": "1.0.4", + "com.unity.test-framework": "1.1.13", + "com.unity.textmeshpro": "2.0.1", + "com.unity.ugui": "1.0.0", + "com.unity.xr.legacyinputhelpers": "2.1.3", + "com.unity.modules.ai": "1.0.0", + "com.unity.modules.androidjni": "1.0.0", + "com.unity.modules.animation": "1.0.0", + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.cloth": "1.0.0", + "com.unity.modules.director": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.particlesystem": "1.0.0", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.physics2d": "1.0.0", + "com.unity.modules.screencapture": "1.0.0", + "com.unity.modules.terrain": "1.0.0", + "com.unity.modules.terrainphysics": "1.0.0", + "com.unity.modules.tilemap": "1.0.0", + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.uielements": "1.0.0", + "com.unity.modules.umbra": "1.0.0", + "com.unity.modules.unityanalytics": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.unitywebrequestassetbundle": "1.0.0", + "com.unity.modules.unitywebrequestaudio": "1.0.0", + "com.unity.modules.unitywebrequesttexture": "1.0.0", + "com.unity.modules.unitywebrequestwww": "1.0.0", + "com.unity.modules.vehicles": "1.0.0", + "com.unity.modules.video": "1.0.0", + "com.unity.modules.vr": "1.0.0", + "com.unity.modules.wind": "1.0.0", + "com.unity.modules.xr": "1.0.0" + } +} diff --git a/Unity/UnityDemo/ProjectSettings/EditorSettings.asset b/Unity/UnityDemo/ProjectSettings/EditorSettings.asset index 29dea5296c..5162e19ff9 100644 --- a/Unity/UnityDemo/ProjectSettings/EditorSettings.asset +++ b/Unity/UnityDemo/ProjectSettings/EditorSettings.asset @@ -3,19 +3,33 @@ --- !u!159 &1 EditorSettings: m_ObjectHideFlags: 0 - serializedVersion: 7 + serializedVersion: 9 m_ExternalVersionControlSupport: Visible Meta Files m_SerializationMode: 2 m_LineEndingsForNewScripts: 2 m_DefaultBehaviorMode: 0 + m_PrefabRegularEnvironment: {fileID: 0} + m_PrefabUIEnvironment: {fileID: 0} m_SpritePackerMode: 0 m_SpritePackerPaddingPower: 1 m_EtcTextureCompressorBehavior: 1 m_EtcTextureFastCompressor: 1 m_EtcTextureNormalCompressor: 2 m_EtcTextureBestCompressor: 4 - m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd + m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmref m_ProjectGenerationRootNamespace: - m_UserGeneratedProjectSuffix: m_CollabEditorSettings: inProgressEnabled: 1 + m_EnableTextureStreamingInEditMode: 1 + m_EnableTextureStreamingInPlayMode: 1 + m_AsyncShaderCompilation: 1 + m_EnterPlayModeOptionsEnabled: 0 + m_EnterPlayModeOptions: 3 + m_ShowLightmapResolutionOverlay: 1 + m_UseLegacyProbeSampleCount: 1 + m_AssetPipelineMode: 1 + m_CacheServerMode: 0 + m_CacheServerEndpoint: + m_CacheServerNamespacePrefix: default + m_CacheServerEnableDownload: 1 + m_CacheServerEnableUpload: 1 diff --git a/Unity/UnityDemo/ProjectSettings/ProjectVersion.txt b/Unity/UnityDemo/ProjectSettings/ProjectVersion.txt index f1fda1a83e..99a0e87f49 100644 --- a/Unity/UnityDemo/ProjectSettings/ProjectVersion.txt +++ b/Unity/UnityDemo/ProjectSettings/ProjectVersion.txt @@ -1 +1,2 @@ -m_EditorVersion: 2018.2.14f1 +m_EditorVersion: 2019.3.12f1 +m_EditorVersionWithRevision: 2019.3.12f1 (84b23722532d) diff --git a/Unity/UnityDemo/ProjectSettings/VFXManager.asset b/Unity/UnityDemo/ProjectSettings/VFXManager.asset new file mode 100644 index 0000000000..6e0eaca40d --- /dev/null +++ b/Unity/UnityDemo/ProjectSettings/VFXManager.asset @@ -0,0 +1,11 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!937362698 &1 +VFXManager: + m_ObjectHideFlags: 0 + m_IndirectShader: {fileID: 0} + m_CopyBufferShader: {fileID: 0} + m_SortShader: {fileID: 0} + m_RenderPipeSettingsPath: + m_FixedTimeStep: 0.016666668 + m_MaxDeltaTime: 0.05 diff --git a/Unity/UnityDemo/ProjectSettings/XRSettings.asset b/Unity/UnityDemo/ProjectSettings/XRSettings.asset new file mode 100644 index 0000000000..482590c196 --- /dev/null +++ b/Unity/UnityDemo/ProjectSettings/XRSettings.asset @@ -0,0 +1,10 @@ +{ + "m_SettingKeys": [ + "VR Device Disabled", + "VR Device User Alert" + ], + "m_SettingValues": [ + "False", + "False" + ] +} \ No newline at end of file diff --git a/Unity/build.cmd b/Unity/build.cmd index 262a831dac..e2a5b2d511 100644 --- a/Unity/build.cmd +++ b/Unity/build.cmd @@ -1,6 +1,7 @@ REM //---------- copy binaries and include for MavLinkCom in deps ---------- msbuild AirLibWrapper\AirsimWrapper.sln /target:Clean /target:Build /property:Configuration=Release /property:Platform=x64 if ERRORLEVEL 1 goto :buildfailed +if NOT EXIST UnityDemo\Assets\Plugins mkdir UnityDemo\Assets\Plugins copy /Y AirLibWrapper\x64\Release\AirsimWrapper.dll UnityDemo\Assets\Plugins REM //---------- done building ---------- diff --git a/Unity/build.sh b/Unity/build.sh index 37215c3594..d6a945d714 100755 --- a/Unity/build.sh +++ b/Unity/build.sh @@ -1,41 +1,53 @@ +#! /bin/bash + +set -x +# set -e + +# check for rpclib if [ ! -f ../external/rpclib/rpclib-2.2.1/rpclib.pc.in ]; then - >&2 echo "error, rpc.pc.in not found" + >&2 echo "error, rpc.pc.in not found, please run setup.sh first and then run build.sh again" fi + cp ../external/rpclib/rpclib-2.2.1/rpclib.pc.in AirLibWrapper/AirsimWrapper/rpclib.pc.in if [ ! -d "linux-build" ]; then - mkdir linux-build; + mkdir linux-build fi -cd linux-build; -if [[ -n $CIINSTALL ]]; then # use downloaded binaries on Travis - export CC=${LLVM_DIR}/bin/clang - export CXX=${LLVM_DIR}/bin/clang++ +cd linux-build +if [ "$(uname)" == "Darwin" ]; then + export CC=/usr/local/opt/llvm@8/bin/clang + export CXX=/usr/local/opt/llvm@8/bin/clang++ else - export CC="clang-5.0" - export CXX="clang++-5.0" + export CC="clang-8" + export CXX="clang++-8" fi -if [ "$(uname)" == "Darwin" ]; then - CMAKE="$(greadlink -f ../../cmake_build/bin/cmake)" +# check for local cmake build created by setup.sh +if [ -d "../../cmake_build" ]; then + if [ "$(uname)" = "Darwin" ]; then + CMAKE="$(greadlink -f ../../cmake_build/bin/cmake)" + else + CMAKE="$(readlink -f ../../cmake_build/bin/cmake)" + fi else - CMAKE="$(readlink -f ../../cmake_build/bin/cmake)" + CMAKE=$(which cmake) fi -"$CMAKE" ../../cmake ../AirLibWrapper/AirsimWrapper; -make -j`nproc`; +"$CMAKE" ../../cmake ../AirLibWrapper/AirsimWrapper +make -j`nproc` if [ ! -d "../UnityDemo/Assets/Plugins" ]; then - mkdir ../ UnityDemo/Assets/Plugins; + mkdir ../UnityDemo/Assets/Plugins fi if [ "$(uname)" == "Darwin" ]; then - cp -r AirsimWrapper.bundle ../UnityDemo/Assets/Plugins; + cp -r AirsimWrapper.bundle ../UnityDemo/Assets/Plugins else - cp libAirsimWrapper.so ../UnityDemo/Assets/Plugins; + cp libAirsimWrapper.so ../UnityDemo/Assets/Plugins fi cd .. if [ -f AirLibWrapper/AirsimWrapper/rpclib.pc.in ]; then - rm AirLibWrapper/AirsimWrapper/rpclib.pc.in + rm AirLibWrapper/AirsimWrapper/rpclib.pc.in fi diff --git a/Unity/clean.sh b/Unity/clean.sh new file mode 100755 index 0000000000..fd2ea4785c --- /dev/null +++ b/Unity/clean.sh @@ -0,0 +1,12 @@ +#! /bin/bash + +# get path of current script: https://stackoverflow.com/a/39340259/207661 +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +pushd "$SCRIPT_DIR" >/dev/null + +set -e +set +x + +rm -rf linux-build + +popd >/dev/null diff --git a/docs/Unity.md b/docs/Unity.md index 3b16cc301d..05854de661 100644 --- a/docs/Unity.md +++ b/docs/Unity.md @@ -11,7 +11,7 @@ This project is still in early development, expect some rough edges. We are work ### Building from source #### Install Unity * Download **Unity Hub** from [this page](https://unity3d.com/get-unity/download). -* Install **Unity 2018.2.15f1** using the Unity Hub. [Detailed instructions here](https://docs.unity3d.com/Manual/GettingStartedInstallingHub.html). +* Install **Unity 2019.3.12** using the Unity Hub from [here](https://unity3d.com/get-unity/update?_ga=2.150316848.720992218.1588269226-65412882.1588269226). [Detailed instructions here](https://docs.unity3d.com/Manual/GettingStartedInstallingHub.html). * Note: If you are using Unity for the first time, check out [the Getting started guide](https://docs.unity3d.com/Manual/GettingStarted.html). The [Unity User Manual](https://docs.unity3d.com/Manual/UnityManual.html) has additional tips, resources, and FAQs. #### Build Airsim @@ -35,17 +35,10 @@ sudo apt-get install libboost-all-dev #### Download and Install Unity for Linux Warning: Unity Editor for Linux is still in Beta. Expect some rough edges. -* **Download** Unity editor version `2019.1.0f2` - ```shell - wget https://beta.unity3d.com/download/292b93d75a2c/UnitySetup-2019.1.0f2 - ``` - Note: While the latest version of linux build of Unity can be found on the last post of [this thread](https://forum.unity.com/threads/unity-on-linux-release-notes-and-known-issues.350256/page-2#post-4458286), we recommend `2019.1.0f2`. - -* **Install** the editor - ```shell - chmod +x UnitySetup-2019.1.0f2 - ./UnitySetup-2019.1.0f2 - ``` +#### Install Unity +* Download **Unity Hub** from [this page](https://unity3d.com/get-unity/download). +* [Install **Unity 2019.3.12** using the Unity Hub](https://docs.unity3d.com/Manual/GettingStartedInstallingHub.html). +* Note: If you are using Unity for the first time, check out [the Getting started guide](https://docs.unity3d.com/Manual/GettingStarted.html). The [Unity User Manual](https://docs.unity3d.com/Manual/UnityManual.html) has additional tips, resources, and FAQs. #### Build Airsim ``` @@ -64,9 +57,10 @@ cd AirSim/Unity This will generate the necessary shared library and copy it to the UnityDemo Plugins folder. ## Usage -* Start Unity and click `Open project`. -* Select the folder `AirSim\Unity\UnityDemo`, and then hit the button `Select Folder`. -* In the bottom pane, Click on `Projects`->`Assets`->`Scenes`. Then, **Double-click** on `SimModeSelector`. This will load the SimModeSelector scene into the scene hierarchy pane. *DO NOT* add CarDemo or DroneDemo scene into the scene hierarchy pane. +* Start Unity Hub, click on `Projects` on left pane, and then click on the `Add` button +* Select the folder `AirSim\Unity\UnityDemo`, and then hit the `OK` button. +* Click on the new project which showed up in the Unity Hub menu to open it in Unity. +* In the bottom pane, click on `Projects`->`Assets`->`Scenes`. Then, **Double-click** on `SimModeSelector`. This will load the SimModeSelector scene into the scene hierarchy pane. *DO NOT* add CarDemo or DroneDemo scene into the scene hierarchy pane. * Hit the play button to start the simulation (and hit play again to stop the simulation. . * Alternatively, you can change the SimMode in your `Settings.json` file. (You can read more about [`Settings.json` here](https://github.com/Microsoft/AirSim/blob/master/docs/settings.md)) * Controlling the car: