From a1abca215e6ad3abca769707f337bf34c54f646d Mon Sep 17 00:00:00 2001 From: Rajat Singhal Date: Sun, 8 Aug 2021 21:07:57 +0530 Subject: [PATCH] Update Unity simListassets, simSpawnObject APIs --- Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.cpp | 8 ++++++++ Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.h | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.cpp b/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.cpp index 66a7e021b3..5a984a0b7e 100644 --- a/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.cpp +++ b/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.cpp @@ -373,4 +373,12 @@ std::vector WorldSimApi::getDetections(ImageCaptureB return std::vector(); } +std::vector WorldSimApi::listAssets() const +{ + throw std::invalid_argument(common_utils::Utils::stringf( + "listAssets API is not supported on Unity") + .c_str()); + return {}; +} + #pragma endregion diff --git a/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.h b/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.h index 02f7b64881..8acb6d1db1 100644 --- a/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.h +++ b/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.h @@ -18,8 +18,9 @@ class WorldSimApi : public msr::airlib::WorldSimApiBase // ------ Level setting apis ----- // virtual bool loadLevel(const std::string& level_name) override { return false; }; - virtual std::string spawnObject(std::string& object_name, const std::string& load_component, const Pose& pose, const Vector3r& scale, bool physics_enabled) override { return ""; }; + virtual std::string spawnObject(const std::string& object_name, const std::string& load_component, const Pose& pose, const Vector3r& scale, bool physics_enabled) override { return ""; }; virtual bool destroyObject(const std::string& object_name) override { return false; }; + virtual std::vector listAssets() const override; virtual bool isPaused() const override; virtual void reset() override;