diff --git a/.gitignore b/.gitignore index e9d75f20dd..d732530295 100644 --- a/.gitignore +++ b/.gitignore @@ -286,12 +286,14 @@ ModelManifest.xml /cmake/MavLinkCom/Makefile /cmake/Makefile /cmake/HelloDrone/Makefile +/cmake/HelloSpawnedDrones/Makefile /cmake/DroneShell/Makefile /cmake/DroneServer/Makefile /cmake/AirLib/Makefile /cmake/AirLibUnity/Makefile /cmake/AirLibUnity/AirLibUnity /cmake/HelloDrone/HelloDrone +/cmake/HelloSpawnedDrones/HelloSpawnedDrones /cmake/DroneShell/DroneShell /cmake/DroneServer/DroneServer cmake/AirLibUnitTests/Makefile @@ -361,4 +363,4 @@ xcuserdata/ /Unity/UnityDemo/Assembly-CSharp.csproj /Unity/UnityDemo/UnityDemo.sln /Unity/UnityDemo/Logs/ -/Unity/UnityDemo/Assets/Plugins/AirsimWrapper.dll \ No newline at end of file +/Unity/UnityDemo/Assets/Plugins/AirsimWrapper.dll diff --git a/AirLib/include/api/RpcLibClientBase.hpp b/AirLib/include/api/RpcLibClientBase.hpp index 7609fb175f..e233850f9b 100644 --- a/AirLib/include/api/RpcLibClientBase.hpp +++ b/AirLib/include/api/RpcLibClientBase.hpp @@ -80,6 +80,8 @@ class RpcLibClientBase { vector simGetImages(vector request, const std::string& vehicle_name = ""); vector simGetImage(const std::string& camera_name, ImageCaptureBase::ImageType type, const std::string& vehicle_name = ""); + bool simAddVehicle(const std::string& vehicle_name, const std::string& vehicle_type, const std::string& pawn_path, float north, float east, float down); + CollisionInfo simGetCollisionInfo(const std::string& vehicle_name = "") const; CameraInfo simGetCameraInfo(const std::string& camera_name, const std::string& vehicle_name = "") const; diff --git a/AirLib/include/api/WorldSimApiBase.hpp b/AirLib/include/api/WorldSimApiBase.hpp index e7137984ea..3ea8b5b230 100644 --- a/AirLib/include/api/WorldSimApiBase.hpp +++ b/AirLib/include/api/WorldSimApiBase.hpp @@ -5,6 +5,8 @@ #define air_WorldSimApiBase_hpp #include "common/CommonStructs.hpp" +#include "common/AirSimSettings.hpp" + namespace msr { namespace airlib { @@ -39,6 +41,8 @@ class WorldSimApiBase { virtual bool setSegmentationObjectID(const std::string& mesh_name, int object_id, bool is_name_regex = false) = 0; virtual int getSegmentationObjectID(const std::string& mesh_name) const = 0; + virtual bool createVehicleAtRuntime(AirSimSettings::VehicleSetting& vehicle_setting) = 0; + virtual void printLogMessage(const std::string& message, const std::string& message_param = "", unsigned char severity = 0) = 0; diff --git a/AirLib/include/common/AirSimSettings.hpp b/AirLib/include/common/AirSimSettings.hpp index 4ab93639ab..919f0effbf 100644 --- a/AirLib/include/common/AirSimSettings.hpp +++ b/AirLib/include/common/AirSimSettings.hpp @@ -406,6 +406,15 @@ struct AirSimSettings { settings_json.saveJSonFile(settings_filename); } + // This is for the case when a new vehicle is made on the fly, at runtime + void addVehicleSetting(const VehicleSetting &vehicle_setting) + { + std::unique_ptr vehicle_setting_p = std::unique_ptr(new VehicleSetting()); + + // Usually we have a pointer to an entry from the json, but here we have to make a new one + vehicles[vehicle_setting.vehicle_name] = std::move(vehicle_setting_p); + } + const VehicleSetting* getVehicleSetting(const std::string& vehicle_name) const { auto it = vehicles.find(vehicle_name); diff --git a/AirLib/include/physics/PhysicsWorld.hpp b/AirLib/include/physics/PhysicsWorld.hpp index da47751ff6..7aef640867 100644 --- a/AirLib/include/physics/PhysicsWorld.hpp +++ b/AirLib/include/physics/PhysicsWorld.hpp @@ -43,6 +43,13 @@ class PhysicsWorld { unlock(); } + void addBody(UpdatableObject* body) + { + lock(); + world_.insert(body); + unlock(); + } + uint64_t getUpdatePeriodNanos() const { return update_period_nanos_; diff --git a/AirLib/src/api/RpcLibClientBase.cpp b/AirLib/src/api/RpcLibClientBase.cpp index cd15f72cb9..28ddb185a8 100644 --- a/AirLib/src/api/RpcLibClientBase.cpp +++ b/AirLib/src/api/RpcLibClientBase.cpp @@ -232,6 +232,11 @@ vector RpcLibClientBase::simGetImage(const std::string& camera_name, Im return result; } +bool RpcLibClientBase::simAddVehicle(const std::string& vehicle_name, const std::string& vehicle_type, const std::string& pawn_path, float north, float east, float down) +{ + return pimpl_->client.call("simAddVehicle", vehicle_name, vehicle_type, pawn_path, north, east, down).as(); +} + void RpcLibClientBase::simPrintLogMessage(const std::string& message, std::string message_param, unsigned char severity) { pimpl_->client.call("simPrintLogMessage", message, message_param, severity); diff --git a/AirLib/src/api/RpcLibServerBase.cpp b/AirLib/src/api/RpcLibServerBase.cpp index 067a2270b1..d0b5fac4a1 100644 --- a/AirLib/src/api/RpcLibServerBase.cpp +++ b/AirLib/src/api/RpcLibServerBase.cpp @@ -115,8 +115,27 @@ RpcLibServerBase::RpcLibServerBase(ApiProvider* api_provider, const std::string& return result; }); - pimpl_->server. - bind("simSetVehiclePose", [&](const RpcLibAdapatorsBase::Pose &pose, bool ignore_collision, const std::string& vehicle_name) -> void { + pimpl_->server.bind("simAddVehicle", [&](const std::string& vehicle_name, const std::string& vehicle_type, const std::string& pawn_path, float north, float east, float down) -> bool { + + AirSimSettings::VehicleSetting vehicle_setting; + + // TODO expose other VehicleSettings fields + vehicle_setting.vehicle_name = vehicle_name; + vehicle_setting.vehicle_type = vehicle_type; + vehicle_setting.pawn_path = pawn_path; + + vehicle_setting.position[0] = north; + vehicle_setting.position[1] = east; + vehicle_setting.position[2] = down; + + vehicle_setting.rotation.yaw = 0; + vehicle_setting.rotation.pitch = 0; + vehicle_setting.rotation.roll = 0; + + return getWorldSimApi()->createVehicleAtRuntime(vehicle_setting); + }); + + pimpl_->server.bind("simSetVehiclePose", [&](const RpcLibAdapatorsBase::Pose &pose, bool ignore_collision, const std::string& vehicle_name) -> void { getVehicleSimApi(vehicle_name)->setPose(pose.to(), ignore_collision); }); pimpl_->server.bind("simGetVehiclePose", [&](const std::string& vehicle_name) -> RpcLibAdapatorsBase::Pose { diff --git a/AirSim.sln b/AirSim.sln index 9a75019858..761f10d1ec 100644 --- a/AirSim.sln +++ b/AirSim.sln @@ -1,217 +1,235 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27428.2043 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DroneShell", "DroneShell\DroneShell.vcxproj", "{9FE9234B-373A-4D5A-AD6B-FB0B593312DD}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AirLib", "AirLib\AirLib.vcxproj", "{4BFB7231-077A-4671-BD21-D3ADE3EA36E7}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloDrone", "HelloDrone\HelloDrone.vcxproj", "{98BB426F-6FB5-4754-81BC-BB481900E135}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MavLinkCom", "MavLinkCom\MavLinkCom.vcxproj", "{8510C7A4-BF63-41D2-94F6-D8731D137A5A}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DroneServer", "DroneServer\DroneServer.vcxproj", "{A050F015-87E2-498F-866A-2E5AF65AF7AC}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MavLinkTest", "MavLinkCom\MavLinkTest\MavLinkTest.vcxproj", "{25EB67BE-468A-4AA5-910F-07EFD58C5516}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Examples", "Examples\Examples.vcxproj", "{C679466F-9D35-4AFC-B9AE-F9FB5448FB99}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AirLibUnitTests", "AirLibUnitTests\AirLibUnitTests.vcxproj", "{2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{11C1B3C5-35A0-46EA-B532-100A14FDAAC6}" - ProjectSection(SolutionItems) = preProject - .gitignore = .gitignore - .gitmodules = .gitmodules - .travis.yml = .travis.yml - build.cmd = build.cmd - build.sh = build.sh - clean.cmd = clean.cmd - clean.sh = clean.sh - LICENSE = LICENSE - README.md = README.md - setup.sh = setup.sh - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCar", "HelloCar\HelloCar.vcxproj", "{4358ED90-CCA1-47A8-8D68-A260F212931E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnrealPluginFiles", "UnrealPluginFiles.vcxproj", "{39683523-C864-4D47-8350-33FC3EC0F00F}" -EndProject -Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "PythonClient", "PythonClient\PythonClient.pyproj", "{E2049E20-B6DD-474E-8BCA-1C8DC54725AA}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sgmstereo", "SGM\src\sgmstereo\sgmstereo_vc15.vcxproj", "{A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stereoPipeline", "SGM\src\stereoPipeline\stereoPipeline_vc15.vcxproj", "{E512EB59-4EAB-49D1-9174-0CAF1B40CED0}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|ARM = Debug|ARM - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|ARM = Release|ARM - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Debug|ARM.ActiveCfg = Debug|Win32 - {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Debug|x64.ActiveCfg = Debug|x64 - {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Debug|x64.Build.0 = Debug|x64 - {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Debug|x86.ActiveCfg = Debug|Win32 - {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Debug|x86.Build.0 = Debug|Win32 - {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Release|Any CPU.ActiveCfg = Release|Win32 - {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Release|ARM.ActiveCfg = Release|Win32 - {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Release|x64.ActiveCfg = Release|x64 - {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Release|x64.Build.0 = Release|x64 - {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Release|x86.ActiveCfg = Release|Win32 - {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Release|x86.Build.0 = Release|Win32 - {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Debug|ARM.ActiveCfg = Debug|Win32 - {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Debug|x64.ActiveCfg = Debug|x64 - {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Debug|x64.Build.0 = Debug|x64 - {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Debug|x86.ActiveCfg = Debug|Win32 - {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Debug|x86.Build.0 = Debug|Win32 - {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Release|Any CPU.ActiveCfg = Release|Win32 - {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Release|ARM.ActiveCfg = Release|Win32 - {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Release|x64.ActiveCfg = Release|x64 - {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Release|x64.Build.0 = Release|x64 - {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Release|x86.ActiveCfg = Release|Win32 - {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Release|x86.Build.0 = Release|Win32 - {98BB426F-6FB5-4754-81BC-BB481900E135}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {98BB426F-6FB5-4754-81BC-BB481900E135}.Debug|ARM.ActiveCfg = Debug|Win32 - {98BB426F-6FB5-4754-81BC-BB481900E135}.Debug|x64.ActiveCfg = Debug|x64 - {98BB426F-6FB5-4754-81BC-BB481900E135}.Debug|x64.Build.0 = Debug|x64 - {98BB426F-6FB5-4754-81BC-BB481900E135}.Debug|x86.ActiveCfg = Debug|Win32 - {98BB426F-6FB5-4754-81BC-BB481900E135}.Debug|x86.Build.0 = Debug|Win32 - {98BB426F-6FB5-4754-81BC-BB481900E135}.Release|Any CPU.ActiveCfg = Release|Win32 - {98BB426F-6FB5-4754-81BC-BB481900E135}.Release|ARM.ActiveCfg = Release|Win32 - {98BB426F-6FB5-4754-81BC-BB481900E135}.Release|x64.ActiveCfg = Release|x64 - {98BB426F-6FB5-4754-81BC-BB481900E135}.Release|x64.Build.0 = Release|x64 - {98BB426F-6FB5-4754-81BC-BB481900E135}.Release|x86.ActiveCfg = Release|Win32 - {98BB426F-6FB5-4754-81BC-BB481900E135}.Release|x86.Build.0 = Release|Win32 - {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Debug|ARM.ActiveCfg = Debug|ARM - {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Debug|ARM.Build.0 = Debug|ARM - {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Debug|x64.ActiveCfg = Debug|x64 - {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Debug|x64.Build.0 = Debug|x64 - {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Debug|x86.ActiveCfg = Debug|Win32 - {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Debug|x86.Build.0 = Debug|Win32 - {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Release|Any CPU.ActiveCfg = Release|Win32 - {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Release|ARM.ActiveCfg = Release|ARM - {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Release|ARM.Build.0 = Release|ARM - {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Release|x64.ActiveCfg = Release|x64 - {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Release|x64.Build.0 = Release|x64 - {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Release|x86.ActiveCfg = Release|Win32 - {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Release|x86.Build.0 = Release|Win32 - {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Debug|ARM.ActiveCfg = Debug|Win32 - {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Debug|x64.ActiveCfg = Debug|x64 - {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Debug|x64.Build.0 = Debug|x64 - {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Debug|x86.ActiveCfg = Debug|Win32 - {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Debug|x86.Build.0 = Debug|Win32 - {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Release|Any CPU.ActiveCfg = Release|Win32 - {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Release|ARM.ActiveCfg = Release|Win32 - {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Release|x64.ActiveCfg = Release|x64 - {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Release|x64.Build.0 = Release|x64 - {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Release|x86.ActiveCfg = Release|Win32 - {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Release|x86.Build.0 = Release|Win32 - {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Debug|ARM.ActiveCfg = Debug|ARM - {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Debug|ARM.Build.0 = Debug|ARM - {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Debug|x64.ActiveCfg = Debug|x64 - {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Debug|x64.Build.0 = Debug|x64 - {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Debug|x86.ActiveCfg = Debug|Win32 - {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Debug|x86.Build.0 = Debug|Win32 - {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Release|Any CPU.ActiveCfg = Release|Win32 - {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Release|ARM.ActiveCfg = Release|ARM - {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Release|ARM.Build.0 = Release|ARM - {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Release|x64.ActiveCfg = Release|x64 - {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Release|x64.Build.0 = Release|x64 - {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Release|x86.ActiveCfg = Release|Win32 - {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Release|x86.Build.0 = Release|Win32 - {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Debug|ARM.ActiveCfg = Debug|Win32 - {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Debug|x64.ActiveCfg = Debug|x64 - {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Debug|x64.Build.0 = Debug|x64 - {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Debug|x86.ActiveCfg = Debug|Win32 - {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Debug|x86.Build.0 = Debug|Win32 - {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Release|Any CPU.ActiveCfg = Release|Win32 - {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Release|ARM.ActiveCfg = Release|Win32 - {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Release|x64.ActiveCfg = Release|x64 - {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Release|x64.Build.0 = Release|x64 - {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Release|x86.ActiveCfg = Release|Win32 - {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Release|x86.Build.0 = Release|Win32 - {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Debug|ARM.ActiveCfg = Debug|Win32 - {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Debug|x64.ActiveCfg = Debug|x64 - {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Debug|x64.Build.0 = Debug|x64 - {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Debug|x86.ActiveCfg = Debug|Win32 - {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Debug|x86.Build.0 = Debug|Win32 - {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Release|Any CPU.ActiveCfg = Release|Win32 - {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Release|ARM.ActiveCfg = Release|Win32 - {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Release|x64.ActiveCfg = Release|x64 - {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Release|x64.Build.0 = Release|x64 - {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Release|x86.ActiveCfg = Release|Win32 - {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Release|x86.Build.0 = Release|Win32 - {4358ED90-CCA1-47A8-8D68-A260F212931E}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {4358ED90-CCA1-47A8-8D68-A260F212931E}.Debug|ARM.ActiveCfg = Debug|Win32 - {4358ED90-CCA1-47A8-8D68-A260F212931E}.Debug|x64.ActiveCfg = Debug|x64 - {4358ED90-CCA1-47A8-8D68-A260F212931E}.Debug|x64.Build.0 = Debug|x64 - {4358ED90-CCA1-47A8-8D68-A260F212931E}.Debug|x86.ActiveCfg = Debug|Win32 - {4358ED90-CCA1-47A8-8D68-A260F212931E}.Debug|x86.Build.0 = Debug|Win32 - {4358ED90-CCA1-47A8-8D68-A260F212931E}.Release|Any CPU.ActiveCfg = Release|Win32 - {4358ED90-CCA1-47A8-8D68-A260F212931E}.Release|ARM.ActiveCfg = Release|Win32 - {4358ED90-CCA1-47A8-8D68-A260F212931E}.Release|x64.ActiveCfg = Release|x64 - {4358ED90-CCA1-47A8-8D68-A260F212931E}.Release|x64.Build.0 = Release|x64 - {4358ED90-CCA1-47A8-8D68-A260F212931E}.Release|x86.ActiveCfg = Release|Win32 - {4358ED90-CCA1-47A8-8D68-A260F212931E}.Release|x86.Build.0 = Release|Win32 - {39683523-C864-4D47-8350-33FC3EC0F00F}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {39683523-C864-4D47-8350-33FC3EC0F00F}.Debug|ARM.ActiveCfg = Debug|Win32 - {39683523-C864-4D47-8350-33FC3EC0F00F}.Debug|x64.ActiveCfg = Debug|x64 - {39683523-C864-4D47-8350-33FC3EC0F00F}.Debug|x86.ActiveCfg = Debug|Win32 - {39683523-C864-4D47-8350-33FC3EC0F00F}.Release|Any CPU.ActiveCfg = Release|Win32 - {39683523-C864-4D47-8350-33FC3EC0F00F}.Release|ARM.ActiveCfg = Release|Win32 - {39683523-C864-4D47-8350-33FC3EC0F00F}.Release|x64.ActiveCfg = Release|x64 - {39683523-C864-4D47-8350-33FC3EC0F00F}.Release|x86.ActiveCfg = Release|Win32 - {E2049E20-B6DD-474E-8BCA-1C8DC54725AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E2049E20-B6DD-474E-8BCA-1C8DC54725AA}.Debug|ARM.ActiveCfg = Debug|Any CPU - {E2049E20-B6DD-474E-8BCA-1C8DC54725AA}.Debug|x64.ActiveCfg = Debug|Any CPU - {E2049E20-B6DD-474E-8BCA-1C8DC54725AA}.Debug|x86.ActiveCfg = Debug|Any CPU - {E2049E20-B6DD-474E-8BCA-1C8DC54725AA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E2049E20-B6DD-474E-8BCA-1C8DC54725AA}.Release|ARM.ActiveCfg = Release|Any CPU - {E2049E20-B6DD-474E-8BCA-1C8DC54725AA}.Release|x64.ActiveCfg = Release|Any CPU - {E2049E20-B6DD-474E-8BCA-1C8DC54725AA}.Release|x86.ActiveCfg = Release|Any CPU - {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Debug|ARM.ActiveCfg = Debug|Win32 - {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Debug|x64.ActiveCfg = Debug|x64 - {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Debug|x64.Build.0 = Debug|x64 - {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Debug|x86.ActiveCfg = Debug|Win32 - {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Debug|x86.Build.0 = Debug|Win32 - {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Release|Any CPU.ActiveCfg = Release|Win32 - {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Release|ARM.ActiveCfg = Release|Win32 - {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Release|x64.ActiveCfg = Release|x64 - {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Release|x64.Build.0 = Release|x64 - {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Release|x86.ActiveCfg = Release|Win32 - {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Release|x86.Build.0 = Release|Win32 - {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Debug|ARM.ActiveCfg = Debug|Win32 - {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Debug|x64.ActiveCfg = Debug|x64 - {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Debug|x64.Build.0 = Debug|x64 - {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Debug|x86.ActiveCfg = Debug|Win32 - {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Debug|x86.Build.0 = Debug|Win32 - {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Release|Any CPU.ActiveCfg = Release|Win32 - {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Release|ARM.ActiveCfg = Release|Win32 - {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Release|x64.ActiveCfg = Release|x64 - {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Release|x64.Build.0 = Release|x64 - {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Release|x86.ActiveCfg = Release|Win32 - {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {AA26EB02-C5EF-4DA2-B3D9-B2DAD8F1E43F} - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27428.2043 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DroneShell", "DroneShell\DroneShell.vcxproj", "{9FE9234B-373A-4D5A-AD6B-FB0B593312DD}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AirLib", "AirLib\AirLib.vcxproj", "{4BFB7231-077A-4671-BD21-D3ADE3EA36E7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloDrone", "HelloDrone\HelloDrone.vcxproj", "{98BB426F-6FB5-4754-81BC-BB481900E135}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MavLinkCom", "MavLinkCom\MavLinkCom.vcxproj", "{8510C7A4-BF63-41D2-94F6-D8731D137A5A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DroneServer", "DroneServer\DroneServer.vcxproj", "{A050F015-87E2-498F-866A-2E5AF65AF7AC}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MavLinkTest", "MavLinkCom\MavLinkTest\MavLinkTest.vcxproj", "{25EB67BE-468A-4AA5-910F-07EFD58C5516}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Examples", "Examples\Examples.vcxproj", "{C679466F-9D35-4AFC-B9AE-F9FB5448FB99}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AirLibUnitTests", "AirLibUnitTests\AirLibUnitTests.vcxproj", "{2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{11C1B3C5-35A0-46EA-B532-100A14FDAAC6}" + ProjectSection(SolutionItems) = preProject + .gitignore = .gitignore + .gitmodules = .gitmodules + .travis.yml = .travis.yml + build.cmd = build.cmd + build.sh = build.sh + clean.cmd = clean.cmd + clean.sh = clean.sh + LICENSE = LICENSE + README.md = README.md + setup.sh = setup.sh + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCar", "HelloCar\HelloCar.vcxproj", "{4358ED90-CCA1-47A8-8D68-A260F212931E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnrealPluginFiles", "UnrealPluginFiles.vcxproj", "{39683523-C864-4D47-8350-33FC3EC0F00F}" +EndProject +Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "PythonClient", "PythonClient\PythonClient.pyproj", "{E2049E20-B6DD-474E-8BCA-1C8DC54725AA}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sgmstereo", "SGM\src\sgmstereo\sgmstereo_vc15.vcxproj", "{A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stereoPipeline", "SGM\src\stereoPipeline\stereoPipeline_vc15.vcxproj", "{E512EB59-4EAB-49D1-9174-0CAF1B40CED0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloSpawnedDrones", "HelloSpawnedDrones\HelloSpawnedDrones.vcxproj", "{99CBF376-5EBA-4164-A657-E7D708C9D685}" + ProjectSection(ProjectDependencies) = postProject + {4BFB7231-077A-4671-BD21-D3ADE3EA36E7} = {4BFB7231-077A-4671-BD21-D3ADE3EA36E7} + {8510C7A4-BF63-41D2-94F6-D8731D137A5A} = {8510C7A4-BF63-41D2-94F6-D8731D137A5A} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|ARM = Debug|ARM + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|ARM = Release|ARM + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Debug|ARM.ActiveCfg = Debug|Win32 + {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Debug|x64.ActiveCfg = Debug|x64 + {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Debug|x64.Build.0 = Debug|x64 + {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Debug|x86.ActiveCfg = Debug|Win32 + {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Debug|x86.Build.0 = Debug|Win32 + {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Release|Any CPU.ActiveCfg = Release|Win32 + {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Release|ARM.ActiveCfg = Release|Win32 + {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Release|x64.ActiveCfg = Release|x64 + {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Release|x64.Build.0 = Release|x64 + {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Release|x86.ActiveCfg = Release|Win32 + {9FE9234B-373A-4D5A-AD6B-FB0B593312DD}.Release|x86.Build.0 = Release|Win32 + {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Debug|ARM.ActiveCfg = Debug|Win32 + {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Debug|x64.ActiveCfg = Debug|x64 + {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Debug|x64.Build.0 = Debug|x64 + {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Debug|x86.ActiveCfg = Debug|Win32 + {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Debug|x86.Build.0 = Debug|Win32 + {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Release|Any CPU.ActiveCfg = Release|Win32 + {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Release|ARM.ActiveCfg = Release|Win32 + {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Release|x64.ActiveCfg = Release|x64 + {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Release|x64.Build.0 = Release|x64 + {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Release|x86.ActiveCfg = Release|Win32 + {4BFB7231-077A-4671-BD21-D3ADE3EA36E7}.Release|x86.Build.0 = Release|Win32 + {98BB426F-6FB5-4754-81BC-BB481900E135}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {98BB426F-6FB5-4754-81BC-BB481900E135}.Debug|ARM.ActiveCfg = Debug|Win32 + {98BB426F-6FB5-4754-81BC-BB481900E135}.Debug|x64.ActiveCfg = Debug|x64 + {98BB426F-6FB5-4754-81BC-BB481900E135}.Debug|x64.Build.0 = Debug|x64 + {98BB426F-6FB5-4754-81BC-BB481900E135}.Debug|x86.ActiveCfg = Debug|Win32 + {98BB426F-6FB5-4754-81BC-BB481900E135}.Debug|x86.Build.0 = Debug|Win32 + {98BB426F-6FB5-4754-81BC-BB481900E135}.Release|Any CPU.ActiveCfg = Release|Win32 + {98BB426F-6FB5-4754-81BC-BB481900E135}.Release|ARM.ActiveCfg = Release|Win32 + {98BB426F-6FB5-4754-81BC-BB481900E135}.Release|x64.ActiveCfg = Release|x64 + {98BB426F-6FB5-4754-81BC-BB481900E135}.Release|x64.Build.0 = Release|x64 + {98BB426F-6FB5-4754-81BC-BB481900E135}.Release|x86.ActiveCfg = Release|Win32 + {98BB426F-6FB5-4754-81BC-BB481900E135}.Release|x86.Build.0 = Release|Win32 + {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Debug|ARM.ActiveCfg = Debug|ARM + {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Debug|ARM.Build.0 = Debug|ARM + {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Debug|x64.ActiveCfg = Debug|x64 + {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Debug|x64.Build.0 = Debug|x64 + {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Debug|x86.ActiveCfg = Debug|Win32 + {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Debug|x86.Build.0 = Debug|Win32 + {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Release|Any CPU.ActiveCfg = Release|Win32 + {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Release|ARM.ActiveCfg = Release|ARM + {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Release|ARM.Build.0 = Release|ARM + {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Release|x64.ActiveCfg = Release|x64 + {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Release|x64.Build.0 = Release|x64 + {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Release|x86.ActiveCfg = Release|Win32 + {8510C7A4-BF63-41D2-94F6-D8731D137A5A}.Release|x86.Build.0 = Release|Win32 + {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Debug|ARM.ActiveCfg = Debug|Win32 + {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Debug|x64.ActiveCfg = Debug|x64 + {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Debug|x64.Build.0 = Debug|x64 + {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Debug|x86.ActiveCfg = Debug|Win32 + {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Debug|x86.Build.0 = Debug|Win32 + {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Release|Any CPU.ActiveCfg = Release|Win32 + {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Release|ARM.ActiveCfg = Release|Win32 + {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Release|x64.ActiveCfg = Release|x64 + {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Release|x64.Build.0 = Release|x64 + {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Release|x86.ActiveCfg = Release|Win32 + {A050F015-87E2-498F-866A-2E5AF65AF7AC}.Release|x86.Build.0 = Release|Win32 + {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Debug|ARM.ActiveCfg = Debug|ARM + {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Debug|ARM.Build.0 = Debug|ARM + {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Debug|x64.ActiveCfg = Debug|x64 + {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Debug|x64.Build.0 = Debug|x64 + {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Debug|x86.ActiveCfg = Debug|Win32 + {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Debug|x86.Build.0 = Debug|Win32 + {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Release|Any CPU.ActiveCfg = Release|Win32 + {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Release|ARM.ActiveCfg = Release|ARM + {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Release|ARM.Build.0 = Release|ARM + {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Release|x64.ActiveCfg = Release|x64 + {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Release|x64.Build.0 = Release|x64 + {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Release|x86.ActiveCfg = Release|Win32 + {25EB67BE-468A-4AA5-910F-07EFD58C5516}.Release|x86.Build.0 = Release|Win32 + {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Debug|ARM.ActiveCfg = Debug|Win32 + {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Debug|x64.ActiveCfg = Debug|x64 + {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Debug|x64.Build.0 = Debug|x64 + {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Debug|x86.ActiveCfg = Debug|Win32 + {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Debug|x86.Build.0 = Debug|Win32 + {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Release|Any CPU.ActiveCfg = Release|Win32 + {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Release|ARM.ActiveCfg = Release|Win32 + {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Release|x64.ActiveCfg = Release|x64 + {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Release|x64.Build.0 = Release|x64 + {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Release|x86.ActiveCfg = Release|Win32 + {C679466F-9D35-4AFC-B9AE-F9FB5448FB99}.Release|x86.Build.0 = Release|Win32 + {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Debug|ARM.ActiveCfg = Debug|Win32 + {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Debug|x64.ActiveCfg = Debug|x64 + {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Debug|x64.Build.0 = Debug|x64 + {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Debug|x86.ActiveCfg = Debug|Win32 + {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Debug|x86.Build.0 = Debug|Win32 + {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Release|Any CPU.ActiveCfg = Release|Win32 + {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Release|ARM.ActiveCfg = Release|Win32 + {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Release|x64.ActiveCfg = Release|x64 + {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Release|x64.Build.0 = Release|x64 + {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Release|x86.ActiveCfg = Release|Win32 + {2A61ED54-2B66-4B9B-99FA-299DD0EF57CD}.Release|x86.Build.0 = Release|Win32 + {4358ED90-CCA1-47A8-8D68-A260F212931E}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {4358ED90-CCA1-47A8-8D68-A260F212931E}.Debug|ARM.ActiveCfg = Debug|Win32 + {4358ED90-CCA1-47A8-8D68-A260F212931E}.Debug|x64.ActiveCfg = Debug|x64 + {4358ED90-CCA1-47A8-8D68-A260F212931E}.Debug|x64.Build.0 = Debug|x64 + {4358ED90-CCA1-47A8-8D68-A260F212931E}.Debug|x86.ActiveCfg = Debug|Win32 + {4358ED90-CCA1-47A8-8D68-A260F212931E}.Debug|x86.Build.0 = Debug|Win32 + {4358ED90-CCA1-47A8-8D68-A260F212931E}.Release|Any CPU.ActiveCfg = Release|Win32 + {4358ED90-CCA1-47A8-8D68-A260F212931E}.Release|ARM.ActiveCfg = Release|Win32 + {4358ED90-CCA1-47A8-8D68-A260F212931E}.Release|x64.ActiveCfg = Release|x64 + {4358ED90-CCA1-47A8-8D68-A260F212931E}.Release|x64.Build.0 = Release|x64 + {4358ED90-CCA1-47A8-8D68-A260F212931E}.Release|x86.ActiveCfg = Release|Win32 + {4358ED90-CCA1-47A8-8D68-A260F212931E}.Release|x86.Build.0 = Release|Win32 + {39683523-C864-4D47-8350-33FC3EC0F00F}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {39683523-C864-4D47-8350-33FC3EC0F00F}.Debug|ARM.ActiveCfg = Debug|Win32 + {39683523-C864-4D47-8350-33FC3EC0F00F}.Debug|x64.ActiveCfg = Debug|x64 + {39683523-C864-4D47-8350-33FC3EC0F00F}.Debug|x86.ActiveCfg = Debug|Win32 + {39683523-C864-4D47-8350-33FC3EC0F00F}.Release|Any CPU.ActiveCfg = Release|Win32 + {39683523-C864-4D47-8350-33FC3EC0F00F}.Release|ARM.ActiveCfg = Release|Win32 + {39683523-C864-4D47-8350-33FC3EC0F00F}.Release|x64.ActiveCfg = Release|x64 + {39683523-C864-4D47-8350-33FC3EC0F00F}.Release|x86.ActiveCfg = Release|Win32 + {E2049E20-B6DD-474E-8BCA-1C8DC54725AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E2049E20-B6DD-474E-8BCA-1C8DC54725AA}.Debug|ARM.ActiveCfg = Debug|Any CPU + {E2049E20-B6DD-474E-8BCA-1C8DC54725AA}.Debug|x64.ActiveCfg = Debug|Any CPU + {E2049E20-B6DD-474E-8BCA-1C8DC54725AA}.Debug|x86.ActiveCfg = Debug|Any CPU + {E2049E20-B6DD-474E-8BCA-1C8DC54725AA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E2049E20-B6DD-474E-8BCA-1C8DC54725AA}.Release|ARM.ActiveCfg = Release|Any CPU + {E2049E20-B6DD-474E-8BCA-1C8DC54725AA}.Release|x64.ActiveCfg = Release|Any CPU + {E2049E20-B6DD-474E-8BCA-1C8DC54725AA}.Release|x86.ActiveCfg = Release|Any CPU + {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Debug|ARM.ActiveCfg = Debug|Win32 + {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Debug|x64.ActiveCfg = Debug|x64 + {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Debug|x64.Build.0 = Debug|x64 + {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Debug|x86.ActiveCfg = Debug|Win32 + {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Debug|x86.Build.0 = Debug|Win32 + {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Release|Any CPU.ActiveCfg = Release|Win32 + {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Release|ARM.ActiveCfg = Release|Win32 + {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Release|x64.ActiveCfg = Release|x64 + {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Release|x64.Build.0 = Release|x64 + {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Release|x86.ActiveCfg = Release|Win32 + {A01E543F-EF34-46BB-8F3F-29AB84E7A5D4}.Release|x86.Build.0 = Release|Win32 + {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Debug|ARM.ActiveCfg = Debug|Win32 + {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Debug|x64.ActiveCfg = Debug|x64 + {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Debug|x64.Build.0 = Debug|x64 + {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Debug|x86.ActiveCfg = Debug|Win32 + {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Debug|x86.Build.0 = Debug|Win32 + {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Release|Any CPU.ActiveCfg = Release|Win32 + {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Release|ARM.ActiveCfg = Release|Win32 + {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Release|x64.ActiveCfg = Release|x64 + {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Release|x64.Build.0 = Release|x64 + {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Release|x86.ActiveCfg = Release|Win32 + {E512EB59-4EAB-49D1-9174-0CAF1B40CED0}.Release|x86.Build.0 = Release|Win32 + {99CBF376-5EBA-4164-A657-E7D708C9D685}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {99CBF376-5EBA-4164-A657-E7D708C9D685}.Debug|ARM.ActiveCfg = Debug|Win32 + {99CBF376-5EBA-4164-A657-E7D708C9D685}.Debug|x64.ActiveCfg = Debug|x64 + {99CBF376-5EBA-4164-A657-E7D708C9D685}.Debug|x64.Build.0 = Debug|x64 + {99CBF376-5EBA-4164-A657-E7D708C9D685}.Debug|x86.ActiveCfg = Debug|Win32 + {99CBF376-5EBA-4164-A657-E7D708C9D685}.Debug|x86.Build.0 = Debug|Win32 + {99CBF376-5EBA-4164-A657-E7D708C9D685}.Release|Any CPU.ActiveCfg = Release|Win32 + {99CBF376-5EBA-4164-A657-E7D708C9D685}.Release|ARM.ActiveCfg = Release|Win32 + {99CBF376-5EBA-4164-A657-E7D708C9D685}.Release|x64.ActiveCfg = Release|x64 + {99CBF376-5EBA-4164-A657-E7D708C9D685}.Release|x64.Build.0 = Release|x64 + {99CBF376-5EBA-4164-A657-E7D708C9D685}.Release|x86.ActiveCfg = Release|Win32 + {99CBF376-5EBA-4164-A657-E7D708C9D685}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {AA26EB02-C5EF-4DA2-B3D9-B2DAD8F1E43F} + EndGlobalSection +EndGlobal diff --git a/HelloSpawnedDrones/HelloSpawnedDrones.cpp b/HelloSpawnedDrones/HelloSpawnedDrones.cpp new file mode 100644 index 0000000000..9bfd4e4b6c --- /dev/null +++ b/HelloSpawnedDrones/HelloSpawnedDrones.cpp @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#include "common/common_utils/StrictMode.hpp" +STRICT_MODE_OFF +#ifndef RPCLIB_MSGPACK +#define RPCLIB_MSGPACK clmdep_msgpack +#endif // !RPCLIB_MSGPACK +#include "rpc/rpc_error.h" +STRICT_MODE_ON + +#include "vehicles/multirotor/api/MultirotorRpcLibClient.hpp" +#include "common/common_utils/FileSystem.hpp" +#include +#include +#include +#include + + +void runSingleClient(uint16_t port, int ordinal) +{ + using namespace msr::airlib; + const char host[] = "localhost"; + float timeout_s = 60; + + try + { + msr::airlib::MultirotorRpcLibClient *client = new msr::airlib::MultirotorRpcLibClient(host, port, timeout_s); + std::cout << "Confirming connections..." << std::endl; + client->confirmConnection(); + + std::string vehicleName = "UAV_" + std::to_string(ordinal); + std::cout << "Vehicle name:" << vehicleName << std::endl; + + client->simAddVehicle(vehicleName, "simpleflight", "", 0, 5.0f * (ordinal + 1), 0); + + // This is a bit crude, but give it a moment to settle on the ground, else takeoff will fail + std::this_thread::sleep_for(std::chrono::duration(2)); + + // moveByVelocityZ is an offboard operation, so we need to set offboard mode. + client->enableApiControl(true, vehicleName); + client->armDisarm(true, vehicleName); + + auto groundPosition = client->getMultirotorState(vehicleName).getPosition(); + float groundZ = groundPosition.z(); // current position (NED coordinate system). + + float takeoffTimeout = 5; + std::cout << "Initiating takeoff for " << vehicleName << "..." << std::endl; + client->takeoffAsync(takeoffTimeout, vehicleName)->waitOnLastTask(); + std::cout << "Completed takeoff for " << vehicleName << "..." << std::endl; + + const float speed = 3.0f; + + // switch to explicit hover mode so that this is the fallback when + // move* commands are finished. + std::cout << "Initiating hover for " << vehicleName << "..." << std::endl; + client->hoverAsync(vehicleName)->waitOnLastTask(); + std::cout << "Completed hover for " << vehicleName << "..." << std::endl; + + auto position = client->getMultirotorState(vehicleName).getPosition(); + float duration = 1; + float z = position.z(); // current position (NED coordinate system). + + // Altitude difference between each platform, in meters + const float altitudeDelta = 1.0f; + + z -= ordinal * altitudeDelta; + float timeout = 10.0f; + client->moveToZAsync(z, speed, timeout, msr::airlib::YawMode(), -1.0f, 1.0f, vehicleName)->waitOnLastTask(); + + std::cout << "Completed move to z " << z << " for " << vehicleName << "..." << std::endl; + std::cout << "Flying in a 10m box pattern at 3 m/s velocity" << std::endl; + + const float size = 5.0f; + duration = size / speed; + DrivetrainType driveTrain = DrivetrainType::ForwardOnly; + YawMode yaw_mode(true, 0); + + position = client->getMultirotorState(vehicleName).getPosition(); + std::cout << "Position of " << port << ": " << position << std::endl; + z = position.z(); // current position (NED coordinate system). + + std::cout << "moveByVelocityZ(" << speed << ", 0, " << z << "," << duration << ")" << std::endl; + client->moveByVelocityZAsync(speed, 0, z, duration, driveTrain, yaw_mode, vehicleName); + std::this_thread::sleep_for(std::chrono::duration(duration)); + std::cout << "moveByVelocityZ(0, " << speed << "," << z << "," << duration << ")" << std::endl; + client->moveByVelocityZAsync(0, speed, z, duration, driveTrain, yaw_mode, vehicleName); + std::this_thread::sleep_for(std::chrono::duration(duration)); + std::cout << "moveByVelocityZ(" << -speed << ", 0, " << z << "," << duration << ")" << std::endl; + client->moveByVelocityZAsync(-speed, 0, z, duration, driveTrain, yaw_mode, vehicleName); + std::this_thread::sleep_for(std::chrono::duration(duration)); + std::cout << "moveByVelocityZ(0, " << -speed << "," << z << "," << duration << ")" << std::endl; + client->moveByVelocityZAsync(0, -speed, z, duration, driveTrain, yaw_mode, vehicleName); + + std::this_thread::sleep_for(std::chrono::duration(duration)); + + client->moveToZAsync(groundZ - 0.5f, speed, timeout, msr::airlib::YawMode(), -1.0f, 1.0f, vehicleName)->waitOnLastTask(); + + std::cout << "Hovering..." << std::endl; + client->hoverAsync(vehicleName)->waitOnLastTask(); + + client->enableApiControl(true, vehicleName); + + std::cout << "Landing..." << std::endl; + client->landAsync(timeout, vehicleName)->waitOnLastTask(); + std::this_thread::sleep_for(std::chrono::duration(5)); + + std::cout << "Disarming..." << std::endl; + client->armDisarm(false, vehicleName); + + std::cout << "Done!..." << std::endl; + + delete client; + + std::this_thread::sleep_for(std::chrono::duration(50)); + } + catch (rpc::rpc_error& e) + { + std::string msg = e.get_error().as(); + std::cout << "Exception raised by the API, something went wrong." << std::endl << msg << std::endl; + } +} + +int main(int argc, char *argv[]) +{ + using namespace msr::airlib; + + uint16_t rpcPort = 41451; + int numPlatforms = 1; + + std::cout << "argc is " << argc << std::endl; + if (argc > 1) + { + std::cout << "Num plats string: " << argv[1] << std::endl; + int numPlatsInt = atoi(argv[1]); + numPlatforms = static_cast(numPlatsInt); + } + + std::cout << "First port is " << rpcPort << std::endl; + std::cout << "Num platforms: " << numPlatforms << std::endl; + std::cout << "Making clients..." << std::endl; + + + try + { + std::cout << "Press Enter to begin..." << std::endl; std::cin.get(); + + std::vector clientThreads; + + // Count down, so the first one can easily go the highest (without knowing count) + int clientOrdinal = numPlatforms - 1; + for (int i = 0; i < numPlatforms; i++) + { + clientThreads.push_back(std::thread(runSingleClient, rpcPort, clientOrdinal)); + clientOrdinal--; + + std::this_thread::sleep_for(std::chrono::duration(0.1)); + } + + for (auto &toJoin : clientThreads) + { + toJoin.join(); + } + } + catch (rpc::rpc_error& e) + { + std::string msg = e.get_error().as(); + std::cout << "Exception raised by the API, something went wrong." << std::endl << msg << std::endl; + } + + return 0; +} diff --git a/HelloSpawnedDrones/HelloSpawnedDrones.vcxproj b/HelloSpawnedDrones/HelloSpawnedDrones.vcxproj new file mode 100644 index 0000000000..3f632f8e73 --- /dev/null +++ b/HelloSpawnedDrones/HelloSpawnedDrones.vcxproj @@ -0,0 +1,161 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {99CBF376-5EBA-4164-A657-E7D708C9D685} + Win32Proj + HelloSpawnedDrones + 10.0.17134.0 + + + + Application + true + v141 + Unicode + + + Application + false + v141 + true + Unicode + + + Application + true + v141 + Unicode + + + Application + false + v141 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + NotUsing + Level3 + Disabled + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + $(ProjectDir)..\AirLib\deps\rpclib\include;include;$(ProjectDir)..\AirLib\deps\eigen3;$(ProjectDir)..\AirLib\include + + + Console + true + $(ProjectDir)\..\AirLib\deps\MavLinkCom\lib\$(Platform)\$(Configuration);$(ProjectDir)\..\AirLib\deps\rpclib\lib\$(Platform)\$(Configuration);$(ProjectDir)\..\AirLib\lib\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + rpc.lib;AirLib.lib;%(AdditionalDependencies) + + + + + Use + Level3 + Disabled + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Use + Level3 + MaxSpeed + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + NotUsing + Level3 + MaxSpeed + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + $(ProjectDir)..\AirLib\deps\rpclib\include;include;$(ProjectDir)..\AirLib\deps\eigen3;$(ProjectDir)..\AirLib\include + + + Console + true + true + true + $(ProjectDir)\..\AirLib\deps\MavLinkCom\lib\$(Platform)\$(Configuration);$(ProjectDir)\..\AirLib\deps\rpclib\lib\$(Platform)\$(Configuration);$(ProjectDir)\..\AirLib\lib\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + rpc.lib;AirLib.lib;%(AdditionalDependencies) + + + + + + + + + \ No newline at end of file diff --git a/HelloSpawnedDrones/HelloSpawnedDrones.vcxproj.filters b/HelloSpawnedDrones/HelloSpawnedDrones.vcxproj.filters new file mode 100644 index 0000000000..d428262af8 --- /dev/null +++ b/HelloSpawnedDrones/HelloSpawnedDrones.vcxproj.filters @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Unreal/Plugins/AirSim/Source/SimMode/SimModeBase.cpp b/Unreal/Plugins/AirSim/Source/SimMode/SimModeBase.cpp index ae53d7272d..c67deb589c 100644 --- a/Unreal/Plugins/AirSim/Source/SimMode/SimModeBase.cpp +++ b/Unreal/Plugins/AirSim/Source/SimMode/SimModeBase.cpp @@ -470,6 +470,74 @@ FRotator ASimModeBase::toFRotator(const msr::airlib::AirSimSettings::Rotation& r return frotator; } +// TODO factor out commonalities with this and setupVehiclesAndCamera, below +bool ASimModeBase::createVehicleAtRuntime(const AirSimSettings::VehicleSetting &vehicle_setting) +{ + if (!isVehicleTypeSupported(vehicle_setting.vehicle_type)) { + Utils::log(Utils::stringf("Vehicle type %s is not supported in this game mode", vehicle_setting.vehicle_type.c_str()), Utils::kLogLevelWarn); + return false; + } + + // Retroactively adjust AirSimSettings, so it's like we knew about this vehicle all along + // (Other places in the code use this for reference) + AirSimSettings::singleton().addVehicleSetting(vehicle_setting); + + //get UU origin of global NED frame + const FTransform uu_origin = getGlobalNedTransform().getGlobalTransform(); + + //compute initial pose + FVector spawn_position = uu_origin.GetLocation(); + msr::airlib::Vector3r settings_position = vehicle_setting.position; + if (!msr::airlib::VectorMath::hasNan(settings_position)) + spawn_position = getGlobalNedTransform().fromGlobalNed(settings_position); + + FRotator spawn_rotation = toFRotator(vehicle_setting.rotation, uu_origin.Rotator()); + + //spawn vehicle pawn + FActorSpawnParameters pawn_spawn_params; + + std::string vehicle_name = vehicle_setting.vehicle_name; + + pawn_spawn_params.Name = FName(vehicle_name.c_str()); + pawn_spawn_params.SpawnCollisionHandlingOverride = + ESpawnActorCollisionHandlingMethod::AdjustIfPossibleButAlwaysSpawn; + auto vehicle_bp_class = UAirBlueprintLib::LoadClass( + getSettings().pawn_paths.at(getVehiclePawnPathName(vehicle_setting)).pawn_bp); + APawn* spawned_pawn = static_cast(this->GetWorld()->SpawnActor( + vehicle_bp_class, &spawn_position, &spawn_rotation, pawn_spawn_params)); + + spawned_actors_.Add(spawned_pawn); + + initializeVehiclePawn(spawned_pawn); + + //create vehicle sim api + const auto& ned_transform = getGlobalNedTransform(); + const auto& pawn_ned_pos = ned_transform.toLocalNed(spawned_pawn->GetActorLocation()); + const auto& home_geopoint = msr::airlib::EarthUtils::nedToGeodetic(pawn_ned_pos, getSettings().origin_geopoint); + + PawnSimApi::Params pawn_sim_api_params(spawned_pawn, &getGlobalNedTransform(), + getVehiclePawnEvents(spawned_pawn), getVehiclePawnCameras(spawned_pawn), pip_camera_class, + collision_display_template, home_geopoint, vehicle_name); + + auto vehicle_sim_api = createVehicleSimApi(pawn_sim_api_params); + auto vehicle_sim_api_p = vehicle_sim_api.get(); + auto vehicle_Api = getVehicleApi(pawn_sim_api_params, vehicle_sim_api_p); + getApiProvider()->insert_or_assign(vehicle_name, vehicle_Api, vehicle_sim_api_p); + + // Usually physics registration happens at init, in ASimModeWorldBase::initializeForPlay(), but not in this case + vehicle_sim_api_p->reset(); + registerPhysicsBody(vehicle_sim_api_p); + + if ((vehicle_setting.is_fpv_vehicle || !getApiProvider()->hasDefaultVehicle()) && vehicle_name != "") + { + getApiProvider()->makeDefaultVehicle(vehicle_name); + } + + vehicle_sim_apis_.push_back(std::move(vehicle_sim_api)); + + return true; +} + void ASimModeBase::setupVehiclesAndCamera() { //get UU origin of global NED frame diff --git a/Unreal/Plugins/AirSim/Source/SimMode/SimModeBase.h b/Unreal/Plugins/AirSim/Source/SimMode/SimModeBase.h index bf116989dd..cd7ff6f2af 100644 --- a/Unreal/Plugins/AirSim/Source/SimMode/SimModeBase.h +++ b/Unreal/Plugins/AirSim/Source/SimMode/SimModeBase.h @@ -61,6 +61,8 @@ class AIRSIM_API ASimModeBase : public AActor void stopApiServer(); bool isApiServerStarted(); + bool createVehicleAtRuntime(const msr::airlib::AirSimSettings::VehicleSetting &vehicle_setting); + const NedTransform& getGlobalNedTransform(); msr::airlib::ApiProvider* getApiProvider() const @@ -99,6 +101,7 @@ class AIRSIM_API ASimModeBase : public AActor void initializeCameraDirector(const FTransform& camera_transform, float follow_distance); void checkVehicleReady(); //checks if vehicle is available to use virtual void updateDebugReport(msr::airlib::StateReporterWrapper& debug_reporter); + virtual void registerPhysicsBody(msr::airlib::VehicleSimApiBase *physicsBody) {} protected: //Utility methods for derived classes virtual const msr::airlib::AirSimSettings& getSettings() const; diff --git a/Unreal/Plugins/AirSim/Source/SimMode/SimModeWorldBase.cpp b/Unreal/Plugins/AirSim/Source/SimMode/SimModeWorldBase.cpp index 5fa2861581..0d361cc3af 100644 --- a/Unreal/Plugins/AirSim/Source/SimMode/SimModeWorldBase.cpp +++ b/Unreal/Plugins/AirSim/Source/SimMode/SimModeWorldBase.cpp @@ -21,6 +21,12 @@ void ASimModeWorldBase::initializeForPlay() vehicles, getPhysicsLoopPeriod())); } +void ASimModeWorldBase::registerPhysicsBody(msr::airlib::VehicleSimApiBase *physicsBody) +{ + physics_world_.get()->addBody(physicsBody); +} + + void ASimModeWorldBase::EndPlay(const EEndPlayReason::Type EndPlayReason) { //remove everything that we created in BeginPlay diff --git a/Unreal/Plugins/AirSim/Source/SimMode/SimModeWorldBase.h b/Unreal/Plugins/AirSim/Source/SimMode/SimModeWorldBase.h index cc1c622ce2..d00ad72d0c 100644 --- a/Unreal/Plugins/AirSim/Source/SimMode/SimModeWorldBase.h +++ b/Unreal/Plugins/AirSim/Source/SimMode/SimModeWorldBase.h @@ -39,6 +39,9 @@ class AIRSIM_API ASimModeWorldBase : public ASimModeBase //should be called by derived class once all api_provider_ is ready to use void initializeForPlay(); + //used for adding physics bodies on the fly + virtual void registerPhysicsBody(msr::airlib::VehicleSimApiBase *physicsBody); + long long getPhysicsLoopPeriod() const; void setPhysicsLoopPeriod(long long period); private: diff --git a/Unreal/Plugins/AirSim/Source/WorldSimApi.cpp b/Unreal/Plugins/AirSim/Source/WorldSimApi.cpp index 9a978566cf..6854daac93 100644 --- a/Unreal/Plugins/AirSim/Source/WorldSimApi.cpp +++ b/Unreal/Plugins/AirSim/Source/WorldSimApi.cpp @@ -41,6 +41,22 @@ void WorldSimApi::setTimeOfDay(bool is_enabled, const std::string& start_datetim celestial_clock_speed, update_interval_secs, move_sun); } +bool WorldSimApi::createVehicleAtRuntime(AirSimSettings::VehicleSetting& vehicle_setting) +{ + bool result; + + // We need to run this code on the main game thread, since it iterates over actors + FGraphEventRef task = FFunctionGraphTask::CreateAndDispatchWhenReady([&]() + { + result = simmode_->createVehicleAtRuntime(vehicle_setting); + }, TStatId(), NULL, ENamedThreads::GameThread); + + // Wait for the result + FTaskGraphInterface::Get().WaitUntilTaskCompletes(task); + + return result; +} + bool WorldSimApi::setSegmentationObjectID(const std::string& mesh_name, int object_id, bool is_name_regex) { bool success; diff --git a/Unreal/Plugins/AirSim/Source/WorldSimApi.h b/Unreal/Plugins/AirSim/Source/WorldSimApi.h index f8f5f3c24c..a5f6f69bbe 100644 --- a/Unreal/Plugins/AirSim/Source/WorldSimApi.h +++ b/Unreal/Plugins/AirSim/Source/WorldSimApi.h @@ -28,6 +28,8 @@ class WorldSimApi : public msr::airlib::WorldSimApiBase { virtual bool setSegmentationObjectID(const std::string& mesh_name, int object_id, bool is_name_regex = false) override; virtual int getSegmentationObjectID(const std::string& mesh_name) const override; + virtual bool createVehicleAtRuntime(msr::airlib::AirSimSettings::VehicleSetting& vehicle_setting); + virtual void printLogMessage(const std::string& message, const std::string& message_param = "", unsigned char severity = 0) override; diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 5e31535511..d5dbc29235 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -6,6 +6,7 @@ add_subdirectory("AirLib") add_subdirectory("MavLinkCom") add_subdirectory("AirLibUnitTests") add_subdirectory("HelloDrone") +add_subdirectory("HelloSpawnedDrones") add_subdirectory("HelloCar") add_subdirectory("DroneShell") add_subdirectory("DroneServer") diff --git a/cmake/HelloSpawnedDrones/CMakeLists.txt b/cmake/HelloSpawnedDrones/CMakeLists.txt new file mode 100644 index 0000000000..32906f0081 --- /dev/null +++ b/cmake/HelloSpawnedDrones/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.5.0) +project(HelloSpawnedDrones) + +LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake-modules") +INCLUDE("${CMAKE_CURRENT_LIST_DIR}/../cmake-modules/CommonSetup.cmake") +CommonSetup() + +IncludeEigen() + +SetupConsoleBuild() + +## Specify additional locations of header files +include_directories( + ${AIRSIM_ROOT}/HelloSpawnedDrones + ${AIRSIM_ROOT}/AirLib/include + ${RPC_LIB_INCLUDES} + ${AIRSIM_ROOT}/MavLinkCom/include + ${AIRSIM_ROOT}/MavLinkCom/common_utils +) + +AddExecutableSource() + +CommonTargetLink() +target_link_libraries(${PROJECT_NAME} AirLib) +target_link_libraries(${PROJECT_NAME} ${RPC_LIB}) diff --git a/docs/apis_cpp.md b/docs/apis_cpp.md index 3a01d54448..4f02378d80 100644 --- a/docs/apis_cpp.md +++ b/docs/apis_cpp.md @@ -87,5 +87,6 @@ int main() ## See Also * [Examples](../Examples) of how to use internal infrastructure in AirSim in your other projects * [DroneShell](../DroneShell) app shows how to make simple interface using C++ APIs to control drones +* [HelloSpawnedDrones](./HelloSpawnedDrones) app shows how to make additional vehicles on the fly * [Python APIs](apis.md)