From c971ae2cf1db8141cce3722d4b42bc16e5ee6c1f Mon Sep 17 00:00:00 2001 From: Rajat Singhal Date: Mon, 8 Feb 2021 09:16:43 +0530 Subject: [PATCH] Unity: Add unimplemented simAddVehicle API method --- Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.cpp | 8 ++++++++ Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.h | 1 + 2 files changed, 9 insertions(+) diff --git a/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.cpp b/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.cpp index 4679fea828..ff2dd5cbbb 100644 --- a/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.cpp +++ b/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.cpp @@ -195,4 +195,12 @@ void WorldSimApi::setWind(const Vector3r& wind) const simmode_->setWind(wind); }; +bool createVehicleAtRuntime(const std::string& vehicle_name, const std::string& vehicle_type, const Pose& pose, const std::string& pawn_path) +{ + throw std::invalid_argument(common_utils::Utils::stringf( + "createVehicleAtRuntime (simAddVehicle API) is not supported on unity").c_str()); + return false; +} + + #pragma endregion diff --git a/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.h b/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.h index d19928bd9b..b8230bd0d6 100644 --- a/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.h +++ b/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.h @@ -64,6 +64,7 @@ class WorldSimApi : public msr::airlib::WorldSimApiBase virtual void setWind(const Vector3r& wind) const override; virtual bool createVoxelGrid(const Vector3r& position, const int& x_size, const int& y_size, const int& z_size, const float& res, const std::string& output_file) override; + virtual bool createVehicleAtRuntime(const std::string& vehicle_name, const std::string& vehicle_type, const Pose& pose, const std::string& pawn_path = "") override; private: SimModeBase * simmode_;