diff --git a/AirLib/AirLib.vcxproj b/AirLib/AirLib.vcxproj index fc94131a9..1a525ff24 100644 --- a/AirLib/AirLib.vcxproj +++ b/AirLib/AirLib.vcxproj @@ -196,26 +196,26 @@ StaticLibrary true - v141 + v142 Unicode StaticLibrary false - v141 + v142 true Unicode StaticLibrary true - v141 + v142 Unicode StaticLibrary false - v141 + v142 true Unicode diff --git a/AirLib/include/vehicles/multirotor/RotorParams.hpp b/AirLib/include/vehicles/multirotor/RotorParams.hpp index d2bf8bafd..aed25caae 100644 --- a/AirLib/include/vehicles/multirotor/RotorParams.hpp +++ b/AirLib/include/vehicles/multirotor/RotorParams.hpp @@ -53,8 +53,8 @@ namespace msr { max_speed_square = pow(max_speed, 2.0f); real_T nsquared = revolutions_per_second * revolutions_per_second; - max_thrust = C_T * air_density * nsquared * pow(propeller_diameter, 4); - max_torque = C_P * air_density * nsquared * pow(propeller_diameter, 5) / (2 * M_PIf); + max_thrust = C_T * air_density * nsquared * static_cast(pow(propeller_diameter, 4)); + max_torque = C_P * air_density * nsquared * static_cast(pow(propeller_diameter, 5)) / (2 * M_PIf); } }; diff --git a/AirLib/include/vehicles/multirotor/firmwares/mavlink/MavLinkMultirotorApi.hpp b/AirLib/include/vehicles/multirotor/firmwares/mavlink/MavLinkMultirotorApi.hpp index 79006a010..bd04cea2f 100644 --- a/AirLib/include/vehicles/multirotor/firmwares/mavlink/MavLinkMultirotorApi.hpp +++ b/AirLib/include/vehicles/multirotor/firmwares/mavlink/MavLinkMultirotorApi.hpp @@ -849,21 +849,20 @@ class MavLinkMultirotorApi : public MultirotorApiBase static std::string findPX4() { auto result = mavlinkcom::MavLinkConnection::findSerialPorts(0, 0); - for (auto iter = result.begin(); iter != result.end(); iter++) - { + for (auto iter = result.begin(); iter != result.end(); iter++) { mavlinkcom::SerialPortInfo info = *iter; - if ( - ( - (info.vid == pixhawkVendorId) && - (info.pid == pixhawkFMUV4ProductId || info.pid == pixhawkFMUV2ProductId || info.pid == pixhawkFMUV2OldBootloaderProductId) - ) || - ( - (info.displayName.find(L"PX4_") != std::string::npos) - ) - ) - { + if (( + (info.vid == pixhawkVendorId) && + (info.pid == pixhawkFMUV4ProductId || info.pid == pixhawkFMUV2ProductId || info.pid == pixhawkFMUV2OldBootloaderProductId)) || + ((info.displayName.find(L"PX4_") != std::string::npos))) { // printf("Auto Selecting COM port: %S\n", info.displayName.c_str()); - return std::string(info.portName.begin(), info.portName.end()); + + std::string portName_str; + + for (wchar_t ch : info.portName) { + portName_str.push_back(static_cast(ch)); + } + return portName_str; } } return ""; diff --git a/AirLibUnitTests/AirLibUnitTests.vcxproj b/AirLibUnitTests/AirLibUnitTests.vcxproj index 8ee90fce9..f6197fe05 100644 --- a/AirLibUnitTests/AirLibUnitTests.vcxproj +++ b/AirLibUnitTests/AirLibUnitTests.vcxproj @@ -31,26 +31,26 @@ Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode @@ -138,7 +138,7 @@ true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) $(ProjectDir)..\AirLib\deps\eigen3;$(ProjectDir)..\AirLib\include;$(ProjectDir)..\MavLinkCom\include - true + false /w34263 /w34266 %(AdditionalOptions) @@ -160,7 +160,7 @@ true NDEBUG;_CONSOLE;%(PreprocessorDefinitions) $(ProjectDir)..\AirLib\deps\eigen3;$(ProjectDir)..\AirLib\include;$(ProjectDir)..\MavLinkCom\include - true + false /w34263 /w34266 %(AdditionalOptions) diff --git a/AirLibUnitTests/TestBase.hpp b/AirLibUnitTests/TestBase.hpp index 13342dd2c..d1916fb96 100644 --- a/AirLibUnitTests/TestBase.hpp +++ b/AirLibUnitTests/TestBase.hpp @@ -9,6 +9,7 @@ namespace msr { namespace airlib { class TestBase { public: + virtual ~TestBase() = default; virtual void run() = 0; void testAssert(double lhs, double rhs, const std::string& message) { diff --git a/DroneServer/DroneServer.vcxproj b/DroneServer/DroneServer.vcxproj index 8254af722..60d3f6c02 100644 --- a/DroneServer/DroneServer.vcxproj +++ b/DroneServer/DroneServer.vcxproj @@ -39,26 +39,26 @@ Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode diff --git a/DroneShell/DroneShell.vcxproj b/DroneShell/DroneShell.vcxproj index b15f08669..82b7c9d53 100644 --- a/DroneShell/DroneShell.vcxproj +++ b/DroneShell/DroneShell.vcxproj @@ -31,26 +31,26 @@ Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode diff --git a/Examples/Examples.vcxproj b/Examples/Examples.vcxproj index 5a609d933..9abf2ee0d 100644 --- a/Examples/Examples.vcxproj +++ b/Examples/Examples.vcxproj @@ -45,26 +45,26 @@ Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode diff --git a/HelloCar/HelloCar.vcxproj b/HelloCar/HelloCar.vcxproj index c24e862b8..89977f0df 100644 --- a/HelloCar/HelloCar.vcxproj +++ b/HelloCar/HelloCar.vcxproj @@ -42,26 +42,26 @@ Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode diff --git a/HelloDrone/HelloDrone.vcxproj b/HelloDrone/HelloDrone.vcxproj index cd59ed34c..89681b335 100644 --- a/HelloDrone/HelloDrone.vcxproj +++ b/HelloDrone/HelloDrone.vcxproj @@ -42,26 +42,26 @@ Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode diff --git a/MavLinkCom/MavLinkCom.vcxproj b/MavLinkCom/MavLinkCom.vcxproj index b17f341e6..0f9db1d48 100644 --- a/MavLinkCom/MavLinkCom.vcxproj +++ b/MavLinkCom/MavLinkCom.vcxproj @@ -3,7 +3,7 @@ true - v141 + v142 @@ -136,6 +136,7 @@ common_utils;include true true + stdcpp17 Console @@ -205,6 +206,7 @@ common_utils;include true true + stdcpp17 Console @@ -242,6 +244,7 @@ MultiThreadedDLL common_utils;include true + stdcpp17 Console @@ -312,6 +315,7 @@ common_utils;include true true + stdcpp17 Console diff --git a/MavLinkCom/MavLinkTest/Commands.cpp b/MavLinkCom/MavLinkTest/Commands.cpp index 90a630480..d10c57211 100644 --- a/MavLinkCom/MavLinkTest/Commands.cpp +++ b/MavLinkCom/MavLinkTest/Commands.cpp @@ -10,9 +10,8 @@ #include #include "FileSystem.hpp" #include "Utils.hpp" - -#if defined(_WIN32) || ((defined __cplusplus) && (__cplusplus >= 201700L)) #include +#if defined(_WIN32) || ((defined __cplusplus) && (__cplusplus >= 201700L)) #define USE_CPP_FILESYSTEM #else #undef USE_CPP_FILESYSTEM @@ -466,14 +465,7 @@ void DumpLogCommandsCommand::processLogCommands(MavLinkFileLog& log, const std:: void DumpLogCommandsCommand::Execute(std::shared_ptr com) { unused(com); -//TODO: make below future proof (i.e. usable by C++17 compiler) - also change same in main.cpp -#if defined(USE_CPP_FILESYSTEM) -//can't use experimental stuff on Linux because of potential ABI issues -#if defined(_WIN32) || ((defined __cplusplus) && (__cplusplus < 201700L)) - using namespace std::experimental::filesystem; -#else using namespace std::filesystem; -#endif path dirPath(log_folder_); @@ -491,9 +483,6 @@ void DumpLogCommandsCommand::Execute(std::shared_ptr com) } printf("dumplogcommands is done\n"); -#else - printf("dumplogcommands is available only with C++17 features\n"); -#endif } diff --git a/MavLinkCom/MavLinkTest/MavLinkTest.vcxproj b/MavLinkCom/MavLinkTest/MavLinkTest.vcxproj index f36a5cae3..263a20274 100644 --- a/MavLinkCom/MavLinkTest/MavLinkTest.vcxproj +++ b/MavLinkCom/MavLinkTest/MavLinkTest.vcxproj @@ -28,7 +28,7 @@ - v141 + v142 {25EB67BE-468A-4AA5-910F-07EFD58C5516} @@ -134,6 +134,7 @@ MultiThreadedDebugDLL true true + stdcpp17 Console @@ -183,6 +184,7 @@ MultiThreadedDebugDLL true true + stdcpp17 Console @@ -208,6 +210,7 @@ ../include;../common_utils; MultiThreadedDLL true + stdcpp17 Console @@ -256,6 +259,7 @@ MultiThreadedDLL true true + stdcpp17 Console diff --git a/MavLinkCom/MavLinkTest/main.cpp b/MavLinkCom/MavLinkTest/main.cpp index 29a8fac31..108fb2695 100644 --- a/MavLinkCom/MavLinkTest/main.cpp +++ b/MavLinkCom/MavLinkTest/main.cpp @@ -22,7 +22,7 @@ STRICT_MODE_OFF STRICT_MODE_ON #include "UnitTests.h" -#if defined(_WIN32) || ((defined __cplusplus) && (__cplusplus >= 201700L)) +#if defined(_WIN32) #include #define USE_CPP_FILESYSTEM #else @@ -155,11 +155,6 @@ std::shared_ptr mavLinkVehicle; #if defined(USE_CPP_FILESYSTEM) - -//can't use experimental stuff on Linux because of potential ABI issues -#if defined(_WIN32) || ((defined __cplusplus) && (__cplusplus < 201700L)) -using namespace std::experimental::filesystem; -#else using namespace std::filesystem; #endif @@ -394,9 +389,6 @@ void ConvertLogFilesToCsv(std::string directory) } } - -#endif - void OpenLogFiles() { if (logDirectory.size() > 0) { @@ -1034,7 +1026,13 @@ std::string findPixhawk() { if (info.pid == pixhawkFMUV4ProductId || info.pid == pixhawkFMUV2ProductId || info.pid == pixhawkFMUV2OldBootloaderProductId) { printf("Auto Selecting COM port: %S\n", info.displayName.c_str()); - return std::string(info.portName.begin(), info.portName.end()); + std::string portName_str; + + for (wchar_t ch : info.portName) + { + portName_str.push_back(static_cast(ch)); + } + return portName_str; } } } diff --git a/MavLinkCom/common_utils/ThreadUtils.hpp b/MavLinkCom/common_utils/ThreadUtils.hpp index 9e43e545b..112f2808c 100644 --- a/MavLinkCom/common_utils/ThreadUtils.hpp +++ b/MavLinkCom/common_utils/ThreadUtils.hpp @@ -2,6 +2,7 @@ #define MavLinkCom_HighPriorityThread_hpp #include +#include namespace mavlink_utils { diff --git a/PythonClient/imitation_learning/README.md b/PythonClient/imitation_learning/README.md index 9b5beeed3..9f2fd7ab7 100644 --- a/PythonClient/imitation_learning/README.md +++ b/PythonClient/imitation_learning/README.md @@ -6,7 +6,7 @@ The code in this section is based on the [Autonomous Driving Cookbook](https://g ## Prerequisites * Operating system: Windows 10 * GPU: Nvidia GTX 1080 or higher (recommended) -* Software: Unreal Engine 4.22 and Visual Studio 2017 (see [upgrade instructions](../../docs/unreal_upgrade.md)) +* Software: Unreal Engine 4.24.4 (Cosys-lab fork) and Visual Studio 2019 * Development: CUDA 9.0 and python 3.5. * Python libraries: Keras 2.1.2, TensorFlow 1.6.0. * Note: Newer versions of keras or tensorflow are recommended but can cause syntax errors. diff --git a/SGM/src/sgmstereo/sgmstereo_vc15.vcxproj b/SGM/src/sgmstereo/sgmstereo_vc15.vcxproj index 1ea99c8b6..ae7daa03e 100644 --- a/SGM/src/sgmstereo/sgmstereo_vc15.vcxproj +++ b/SGM/src/sgmstereo/sgmstereo_vc15.vcxproj @@ -41,23 +41,23 @@ StaticLibrary Unicode true - v141 + v142 StaticLibrary Unicode true - v141 + v142 StaticLibrary Unicode - v141 + v142 StaticLibrary Unicode - v141 + v142 @@ -137,7 +137,7 @@ ProgramDatabase NOMINMAX;_UNICODE;UNICODE;%(PreprocessorDefinitions) true - true + false diff --git a/SGM/src/stereoPipeline/StateStereo.cpp b/SGM/src/stereoPipeline/StateStereo.cpp index 59b4596ee..b35c6a0bb 100644 --- a/SGM/src/stereoPipeline/StateStereo.cpp +++ b/SGM/src/stereoPipeline/StateStereo.cpp @@ -124,7 +124,7 @@ float CStateStereo::GetLeftDisparity(float x, float y) unsigned char c = confMap[off]; if (fabs(d) < ndisps && c >= confThreshold) { - return 1.0f - (fabs(d)/float(ndisps)); + return 1.0f - (float)(fabs(d) / ndisps); } else return -1.0f; diff --git a/SGM/src/stereoPipeline/stereoPipeline_vc15.vcxproj b/SGM/src/stereoPipeline/stereoPipeline_vc15.vcxproj index be1589fd2..b07ab6265 100644 --- a/SGM/src/stereoPipeline/stereoPipeline_vc15.vcxproj +++ b/SGM/src/stereoPipeline/stereoPipeline_vc15.vcxproj @@ -37,27 +37,27 @@ StaticLibrary true Unicode - v141 + v142 StaticLibrary true Unicode - v141 + v142 StaticLibrary false true Unicode - v141 + v142 StaticLibrary false true Unicode - v141 + v142 diff --git a/build.cmd b/build.cmd index 85593a2e5..57461cd9d 100644 --- a/build.cmd +++ b/build.cmd @@ -8,19 +8,20 @@ set "noFullPolyCar=" set "buildMode=" REM //check VS version -if "%VisualStudioVersion%"=="" ( +if "%VisualStudioVersion%" == "" ( echo( - echo oh oh... You need to run this command from x64 Native Tools Command Prompt for VS 2017. + echo oh oh... You need to run this command from x64 Native Tools Command Prompt for VS 2019. goto :buildfailed_nomsg ) -if "%VisualStudioVersion%"=="14.0" ( +if "%VisualStudioVersion%" lss "16.0" ( echo( - echo Hello there! We just upgraded AirSim to Unreal Engine 4.22 and Visual Studio 2017. + echo Hello there! We just upgraded AirSim to Unreal Engine 4.24 and Visual Studio 2019. echo Here are few easy steps for upgrade so everything is new and shiny: - echo https://cosysgit.uantwerpen.be/sensorsimulation/airsim/-/blob/master/docs/unreal_upgrade.md + echo https://github.com/Microsoft/AirSim/blob/master/docs/unreal_upgrade.md goto :buildfailed_nomsg ) + if "%1"=="" goto noargs if "%1"=="--no-full-poly-car" set "noFullPolyCar=y" if "%1"=="--Debug" set "buildMode=--Debug" @@ -78,7 +79,7 @@ ECHO Starting cmake to build rpclib... IF NOT EXIST external\rpclib\rpclib-2.2.1\build mkdir external\rpclib\rpclib-2.2.1\build cd external\rpclib\rpclib-2.2.1\build REM cmake -G"Visual Studio 14 2015 Win64" .. -cmake -G"Visual Studio 15 2017 Win64" .. +cmake -G"Visual Studio 16 2019" .. if "%buildMode%" == "--Debug" ( cmake --build . --config Debug @@ -143,7 +144,7 @@ IF NOT EXIST Unreal\Plugins\AirSim\Content\VehicleAdv\SUV\v1.2.0 ( REM //---------- get Eigen library ---------- IF NOT EXIST AirLib\deps mkdir AirLib\deps IF NOT EXIST AirLib\deps\eigen3 ( - powershell -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iwr https://gitlab.com/libeigen/eigen/-/archive/3.3.2/eigen-3.3.2.zip -OutFile eigen3.zip }" + powershell -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iwr https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.zip -OutFile eigen3.zip }" powershell -command "& { Expand-Archive -Path eigen3.zip -DestinationPath AirLib\deps }" powershell -command "& { Move-Item -Path AirLib\deps\eigen* -Destination AirLib\deps\del_eigen }" REM move AirLib\deps\eigen* AirLib\deps\del_eigen diff --git a/docs/apis.md b/docs/apis.md index 4a54701ac..3b5643c04 100644 --- a/docs/apis.md +++ b/docs/apis.md @@ -18,7 +18,7 @@ Once you can run AirSim, choose Car as vehicle and then navigate to `PythonClien python hello_car.py ``` -If you are using Visual Studio 2017 then just open AirSim.sln, set PythonClient as startup project and choose `car\hello_car.py` as your startup script. +If you are using Visual Studio then just open AirSim.sln, set PythonClient as startup project and choose `car\hello_car.py` as your startup script. ## Hello Car Here's how to use AirSim APIs using Python to control simulated car (see also [C++ example](apis_cpp.md#hello_car)): diff --git a/docs/build_linux.md b/docs/build_linux.md index 40a94106d..09186b92b 100644 --- a/docs/build_linux.md +++ b/docs/build_linux.md @@ -8,7 +8,7 @@ The current recommended and tested environment is **Ubuntu 18.04 LTS**. Theoreti This branch uses a custom version of the Unreal Engine! - Make sure you are [registered with Epic Games](https://docs.unrealengine.com/latest/INT/Platforms/Linux/BeginnerLinuxDeveloper/SettingUpAnUnrealWorkflow/1/index.html). This is required to get source code access for Unreal Engine. -- Clone Unreal in your favorite folder and build it (this may take a while!). **Note**: We only support Unreal 4.22 at present. +- Clone Unreal in your favorite folder and build it (this may take a while!). **Note**: We only support Unreal 4.24.4 (Cosys-Lab) at present. ```bash # go to the folder where you clone GitHub projects git clone https://github.com/WouterJansen/UnrealEngine.git diff --git a/docs/build_windows.md b/docs/build_windows.md index 0c7deaca4..3fa3ccf4b 100644 --- a/docs/build_windows.md +++ b/docs/build_windows.md @@ -4,13 +4,13 @@ This branch uses a custom version of the Unreal Engine! - Make sure you are [registered with Epic Games](https://docs.unrealengine.com/latest/INT/Platforms/Linux/BeginnerLinuxDeveloper/SettingUpAnUnrealWorkflow/1/index.html). This is required to get source code access for Unreal Engine. -- Clone Unreal in your favorite folder and build it (this may take a while!). **Note**: We only support Unreal 4.22 at present. +- Clone Unreal in your favorite folder and build it (this may take a while!). **Note**: We only support Unreal 4.24.4 (Cosys-Lab fork) at present. ```bash # go to the folder where you clone GitHub projects git clone https://github.com/WouterJansen/UnrealEngine.git cd UnrealEngine ``` - -Visual Studio 2017 is required for building. We recommend getting Visual Studio Community 2017, at the time of writing at version 15.9. + -Visual Studio 2019 is required for building. - To install the correct components for UE4 development, check the "Game Development with C++" workload and the “.net 4.6.2”, "Unreal Engine Installer" and "Nuget Package Manager" optional individual components. - run `Setup.bat` - run `GenerateProjectFiles.bat ` as administrator @@ -21,7 +21,7 @@ This branch uses a custom version of the Unreal Engine! - please run `Engine\Binaries\Win64\UnrealVersionSelector-Win64-Shipping.exe` once so it is detectable by your system. ## Build AirSim -* Start `x64 Native Tools Command Prompt for VS 2017`. +* Start `x64 Native Tools Command Prompt for VS 2019`. * Clone the repo: `git clone https://cosysgit.uantwerpen.be/sensorsimulation/airsim.git`, and go the AirSim directory by `cd AirSim`. * Run `build.cmd` from the command line. This will create ready to use plugin bits in the `Unreal\Plugins` folder that can be dropped into any Unreal project. diff --git a/docs/cosysenv.md b/docs/cosysenv.md index 86bb40060..a7a175981 100644 --- a/docs/cosysenv.md +++ b/docs/cosysenv.md @@ -19,7 +19,7 @@ Here are quick steps to get CoSys-Lab environment up and running: 1. Make sure you have [installed Unreal and built AirSim](build_windows.md). 2. Navigate to folder `AirSim\Unreal\Environments\CoSysLab` and run `update_from_git.bat`. -3. Double click on generated .sln file to open in Visual Studio 2017 or newer. +3. Double click on generated .sln file to open in Visual Studio. 4. Make sure `CoSysLab` project is the startup project, build configuration is set to `DebugGame_Editor` and `Win64`. Hit F5 to run. 5. Press the Play button in Unreal Editor to start. See [how to use AirSim](https://github.com/Microsoft/AirSim/#how-to-use-it). diff --git a/docs/dev_workflow.md b/docs/dev_workflow.md index f10cacc22..3361f7394 100644 --- a/docs/dev_workflow.md +++ b/docs/dev_workflow.md @@ -4,7 +4,7 @@ Below is the guide on how to perform different development activities while work ## Development Environment ### OS -We highly recommend Windows 10 and Visual Studio 2017 as your development environment. The support for other OSes and IDE is unfortunately not as mature on the Unreal Engine side and you may risk severe loss of productivity trying to do workarounds and jumping through the hoops. +We highly recommend Windows 10 and Visual Studio 2019 as your development environment. The support for other OSes and IDE is unfortunately not as mature on the Unreal Engine side and you may risk severe loss of productivity trying to do workarounds and jumping through the hoops. ### Hardware We recommend GPUs such as NVidia 1080 or NVidia Titan series with powerful desktop such as one with 64GB RAM, 6+ cores, SSDs and 2-3 displays (ideally 4K). We have found HP Z840 work quite well for our needs. The development experience on high-end laptops is generally sub-par compared to powerful desktops however they might be useful in a pinch. You generally want laptops with discrete NVidia GPU (at least M2000 or better) with 64GB RAM, SSDs and hopefully 4K display. We have found models such as Lenovo P50 work well for our needs. Laptops with only integrated graphics might not work well. diff --git a/docs/hyslambenchmarkenv.md b/docs/hyslambenchmarkenv.md index 02a713019..d054548dc 100644 --- a/docs/hyslambenchmarkenv.md +++ b/docs/hyslambenchmarkenv.md @@ -178,7 +178,7 @@ Here are quick steps to get HySLAM environment up and running: 1. Make sure you have [installed Unreal and built AirSim](build_windows.md). 2. Navigate to folder `AirSim\Unreal\Environments\HS_BM_1` and run `update_from_git.bat`. -3. Double click on generated .sln file to open in Visual Studio 2017 or newer. +3. Double click on generated .sln file to open in Visual Studio. 4. Make sure `HS_BM_1` project is the startup project, build configuration is set to `DebugGame_Editor` and `Win64`. Hit F5 to run. 5. Press the Play button in Unreal Editor to start. See [how to use AirSim](https://github.com/Microsoft/AirSim/#how-to-use-it). diff --git a/docs/hyslamenv.md b/docs/hyslamenv.md index 3f4cac094..0fd9619e2 100644 --- a/docs/hyslamenv.md +++ b/docs/hyslamenv.md @@ -136,7 +136,7 @@ Here are quick steps to get HySLAM environment up and running: 1. Make sure you have [installed Unreal and built AirSim](build_windows.md). 2. Navigate to folder `AirSim\Unreal\Environments\HySLAM` and run `update_from_git.bat`. -3. Double click on generated .sln file to open in Visual Studio 2017 or newer. +3. Double click on generated .sln file to open in Visual Studio. 4. Make sure `HySLAM` project is the startup project, build configuration is set to `DebugGame_Editor` and `Win64`. Hit F5 to run. 5. Press the Play button in Unreal Editor to start. See [how to use AirSim](https://github.com/Microsoft/AirSim/#how-to-use-it). diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 458a72d83..c099c2aa4 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -148,10 +148,6 @@ nav: - "MavLink LogViewer": "docs/log_viewer.md" # - "MavLinkCom": 'MavLinkCom/README.md' # - "MavLink MoCap": 'MavLinkCom/MavLinkMoCap/Readme.md' - - "Upgrading": - - "Upgrading Unreal": 'docs/unreal_upgrade.md' - - "Upgrading APIs": 'docs/upgrade_apis.md' - - "Upgrading Settings": 'docs/upgrade_settings.md' - "Contributed Tutorials": - "Reinforcement Learning": 'docs/reinforcement_learning.md' - "Using Environments from Marketplace": 'https://www.youtube.com/watch?v=y09VbdQWvQY' diff --git a/docs/ros.md b/docs/ros.md index bb41daf81..48c8abc61 100644 --- a/docs/ros.md +++ b/docs/ros.md @@ -6,7 +6,7 @@ AirSim and ROS can be integrated using C++ or Python. Some example ROS node are ## Prerequisites -These instructions are for Ubuntu 16.04, ROS Kinetic, UE4 4.22 and latest AirSim release. +These instructions are for Ubuntu 18.04, ROS Melodic, UE4 4.24.4 and latest AirSim release. You should have these components installed and working before proceeding ## Implemented nodes diff --git a/docs/unreal_blocks.md b/docs/unreal_blocks.md index 32d7de482..46a8b6a7c 100644 --- a/docs/unreal_blocks.md +++ b/docs/unreal_blocks.md @@ -9,7 +9,7 @@ Here are quick steps to get Blocks environment up and running: 1. Make sure you have [installed Unreal and built AirSim](build_windows.md). 2. Navigate to folder `AirSim\Unreal\Environments\Blocks` and run `update_from_git.bat`. -3. Double click on generated .sln file to open in Visual Studio 2017 or newer. +3. Double click on generated .sln file to open in Visual Studio. 4. Make sure `Blocks` project is the startup project, build configuration is set to `DebugGame_Editor` and `Win64`. Hit F5 to run. 5. Press the Play button in Unreal Editor and you will see something like in below video. Also see [how to use AirSim](https://github.com/Microsoft/AirSim/#how-to-use-it). diff --git a/docs/unreal_custenv.md b/docs/unreal_custenv.md index d4d70f99a..49f0e1146 100644 --- a/docs/unreal_custenv.md +++ b/docs/unreal_custenv.md @@ -8,7 +8,7 @@ There is no `Epic Games Launcher` for Linux which means that if you need to crea ## Step by Step Instructions -1. Make sure AirSim is built and Unreal 4.22 is installed as described in [build instructions](build_windows.md). +1. Make sure AirSim is built and Unreal 4.24.4 (Cosys-Lab fork) is installed as described in [build instructions](build_windows.md). 2. In `Epic Games Launcher` click the Learn tab then scroll down and find `Landscape Mountains`. Click the `Create Project` and download this content (~2GB download). ![current version](images/landscape_mountains.png) @@ -26,7 +26,7 @@ There is no `Epic Games Launcher` for Linux which means that if you need to crea ``` { "FileVersion": 3, - "EngineAssociation": "4.22", + "EngineAssociation": "4.24.4", "Category": "Samples", "Description": "", "Modules": [ diff --git a/docs/unreal_upgrade.md b/docs/unreal_upgrade.md deleted file mode 100644 index 8b84afb8b..000000000 --- a/docs/unreal_upgrade.md +++ /dev/null @@ -1,48 +0,0 @@ -# Upgrading to Unreal Engine 4.22 - -These instructions apply if you are already using AirSim on Unreal Engine 4.16. If you have never installed AirSim, please see [How to get it](https://github.com/microsoft/airsim#how-to-get-it). - -**Caution:** The below steps will delete any of your unsaved work in AirSim or Unreal folder. - -## Do this first - -### For Windows Users -1. Install Visual Studio 2017 with VC++, Python and C#. -2. Install UE 4.22 through Epic Games Launcher. -3. Start `x64 Native Tools Command Prompt for VS 2017` and navigate to AirSim repo. -4. Run `clean_rebuild.bat` to remove all unchecked/extra stuff and rebuild everything. - -### For Linux Users -1. From your AirSim repo folder, run 'clean_rebuild.sh`. -2. Rename or delete your existing folder for Unreal Engine. -3. Follow step 1 and 2 to [install Unreal Engine 4.22](https://cosysgit.uantwerpen.be/sensorsimulation/airsim/-/blob/master/docs/build_linux.md#install-and-build). - -## Upgrading Your Custom Unreal Project -If you have your own Unreal project created in an older version of Unreal Engine then you need to upgrade your project to Unreal 4.22. To do this, - -1. Open .uproject file and look for the line `"EngineAssociation"` and make sure it reads like `"EngineAssociation": "4.22"`. -2. Delete `Plugins/AirSim` folder in your Unreal project's folder. -3. Go to your AirSim repo folder and copy `Unreal\Plugins` folder to your Unreal project's folder. -4. Copy *.bat (or *.sh for Linux) from `Unreal\Environments\Blocks` to your project's folder. -5. Run `clean.bat` (or `clean.sh` for Linux) followed by `GenerateProjectFiles.bat` (only for Windows). - -## FAQ - -### I have an Unreal project that is older than 4.16. How do I upgrade it? - -#### Option 1: Just Recreate Project -If your project doesn't have any code or assets other than environment you downloaded then you can also simply [recreate the project in Unreal 4.22 Editor](unreal_custenv.md) and then copy Plugins folder from `AirSim/Unreal/Plugins`. - -#### Option 2: Modify Few Files -Unreal versions newer than Unreal 4.15 has breaking changes. So you need to modify your *.Build.cs and *.Target.cs which you can find in the `Source` folder of your Unreal project. So what are those changes? Below is the gist of it but you should really refer to [Unreal's official 4.16 transition post](https://forums.unrealengine.com/showthread.php?145757-C-4-16-Transition-Guide). - -##### In your project's *.Target.cs -1. Change the contructor from, `public MyProjectTarget(TargetInfo Target)` to `public MyProjectTarget(TargetInfo Target) : base(Target)` - -2. Remove `SetupBinaries` method if you have one and instead add following line in contructor above: `ExtraModuleNames.AddRange(new string[] { "MyProject" });` - -##### In your project's *.Build.cs -Change the constructor from `public MyProject(TargetInfo Target)` to `public MyProject(ReadOnlyTargetRules Target) : base(Target)`. - -##### And finally... -Follow above steps to continue the upgrade. The warning box might show only "Open Copy" button. Don't click that. Instead, click on More Options which will reveal more buttons. Choose `Convert-In-Place option`. *Caution:* Always keep backup of your project first! If you don't have anything nasty, in place conversion should go through and you are now on the new version of Unreal. diff --git a/docs/upgrade_apis.md b/docs/upgrade_apis.md deleted file mode 100644 index adb9da016..000000000 --- a/docs/upgrade_apis.md +++ /dev/null @@ -1,167 +0,0 @@ -# Upgrading API Client Code -There have been several API changes in AirSim v1.2 that we hope removes inconsistency, adds future extensibility and presents cleaner interface. Many of these changes are however *breaking changes* which means you will need to modify your client code that talks to AirSim. - -## Quicker Way -While most changes you need to do in your client code are fairly easy, a quicker way is simply to take a look at the example code such as [Hello Drone](https://github.com/Microsoft/AirSim/tree/master/PythonClient//multirotor/hello_drone.py)or [Hello Car](https://github.com/Microsoft/AirSim/tree/master/PythonClient//car/hello_car.py) to get gist of changes. - -## Importing AirSim -Instead of, - -```python -from AirSimClient import * -``` -use this: - -```python -import airsim -``` - -Above assumes you have installed AirSim module using, -``` -pip install --user airsim -``` - -If you are running you code from PythonClient folder in repo then you can also do this: - -```python -import setup_path -import airsim -``` - -Here setup_path.py should exist in your folder and it will set the path of `airsim` package in `PythonClient` repo folder. All examples in PythonClient folder uses this method. - -## Using AirSim Classes -As we have everything now in package, you will need to use explicit namespace for AirSim classes like shown below. - -Instead of, - -```python -client1 = CarClient() -``` - -use this: - -```python -client1 = airsim.CarClient() -``` - -## AirSim Types - -We have moved all types in `airsim` namespace. - -Instead of, - -```python -image_type = AirSimImageType.DepthVis - -d = DrivetrainType.MaxDegreeOfFreedom -``` - -use this: - -```python -image_type = airsim.ImageType.DepthVis - -d = airsim.DrivetrainType.MaxDegreeOfFreedom -``` - -## Getting Images - -Nothing new below, it's just combination of above. Note that all APIs that previously took `camera_id`, now takes `camera_name` instead. You can take a look at [available cameras](image_apis.md#avilable_cameras) here. - -Instead of, - -```python -responses = client.simGetImages([ImageRequest(0, AirSimImageType.DepthVis)]) -``` - -use this: - -```python -responses = client.simGetImages([airsim.ImageRequest("0", airsim.ImageType.DepthVis)]) -``` - -## Utility Methods -In earlier version, we provided several utility methods as part of `AirSimClientBase`. These methods are now moved to `airsim` namespace for more pythonic interface. - -Instead of, - -```python -AirSimClientBase.write_png(my_path, img_rgba) - -AirSimClientBase.wait_key('Press any key') -``` - -use this: - -```python -airsim.write_png(my_path, img_rgba) - -airsim.wait_key('Press any key') -``` - -## Camera Names -AirSim now uses [names](image_apis.md#available_cameras) to reference cameras instead of index numbers. However to retain backward compatibility, these names are aliased with old index numbers as string. - -Instead of, - -```python -client.simGetCameraInfo(0) -``` - -use this: - -```python -client.simGetCameraInfo("0") - -# or - -client.simGetCameraInfo("front-center") -``` - -## Async Methods -For multirotors, AirSim had various methods such as `takeoff` or `moveByVelocityZ` that would take long time to complete. All of such methods are now renamed by adding the suffix *Async* as shown below. - -Instead of, - -```python -client.takeoff() - -client.moveToPosition(-10, 10, -10, 5) -``` - -use this: - -```python -client.takeoffAsync().join() - -client.moveToPositionAsync(-10, 10, -10, 5).join() -``` - -Here `.join()` is a call on Python's `Future` class to wait for the async call to complete. You can also choose to do some other computation instead while the call is in progress. - -## Simulation-Only Methods -Now we have clear distinction between methods that are only available in simulation from the ones that may be available on actual vehicle. The simulation only methods are prefixed with `sim` as shown below. - -``` -getCollisionInfo() is renamed to simGetCollisionInfo() -getCameraInfo() is renamed to simGetCameraInfo() -setCameraOrientation() is renamed to simSetCameraOrientation() -``` - -## State Information -Previously `CarState` mixed simulation-only information like `kinematics_true`. Moving forward, `CarState` will only contain information that can be obtained in real world. - -```python -k = car_state.kinematics_true -``` - -use this: - -```python -k = car_state.kinematics_estimated - -# or - -k = client.simGetGroundTruthKinematics() -``` \ No newline at end of file diff --git a/docs/upgrade_settings.md b/docs/upgrade_settings.md deleted file mode 100644 index 18de2b0cc..000000000 --- a/docs/upgrade_settings.md +++ /dev/null @@ -1,28 +0,0 @@ -# Upgrading Settings - -The settings schema in AirSim 1.2 is changed for more flexibility and cleaner interface. If you have older [settings.json](settings.md) file then you can either delete it and restart AirSim or use this guide to make manual upgrade. - -## Quicker Way -We recommend simply deleting the [settings.json](settings.md) and add back the settings you need. -Please see [the doc](settings.md) for complete information on available settings. - -## Changes - -### UsageScenario -Previously we used `UsageScenario` to specify the `ComputerVision` mode. Now we use `"SimMode": "ComputerVision"` instead. - -### CameraDefaults and Changing Camera Settings -Previously we had `CaptureSettings` and `NoiseSettings` in root. Now these are combined in new `CameraDefaults` element. The [schema for this element](settings.md#camera_settings) is later used to configure cameras on vehicle. - -### Gimbal -The [Gimbal element](settings.md#Gimbal) (instead of old Gimble element) is now moved out of `CaptureSettings`. - -### CameraID to CameraName -All settings now reference cameras by [name](image_apis.md#available_cameras) instead of ID. - -### Using PX4 -The new Vehicles element allows to specify which vehicles to create. To use PX4, please see [this section](settings.md#using_px4). - -### AdditionalCameras -The old `AdditionalCameras` setting is now replaced by [Cameras element](settings.md#Common_Vehicle_Setting) within vehicle setting. - diff --git a/setup.sh b/setup.sh index efc94decd..03e92e887 100755 --- a/setup.sh +++ b/setup.sh @@ -164,12 +164,12 @@ popd >/dev/null rm -rf ./AirLib/deps/eigen3/Eigen echo "downloading eigen..." -wget https://gitlab.com/libeigen/eigen/-/archive/3.3.2/eigen-3.3.2.zip -unzip eigen-3.3.2.zip -d temp_eigen +wget -O eigen3.zip https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.zip +unzip eigen3.zip -d temp_eigen mkdir -p AirLib/deps/eigen3 mv temp_eigen/eigen*/Eigen AirLib/deps/eigen3 rm -rf temp_eigen -rm eigen-3.3.2.zip +rm eigen3.zip popd >/dev/null