From 517d8c21b231c15b3ff1e5221a35d6267a00e558 Mon Sep 17 00:00:00 2001 From: Niek van Leeuwen Date: Sun, 31 Jan 2021 15:11:47 +0100 Subject: [PATCH 1/2] Fix compile error for Unity build --- .../AirsimWrapper/Source/SimMode/SimModeBase.cpp | 7 +++++++ .../AirsimWrapper/Source/SimMode/SimModeBase.h | 1 + Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.cpp | 5 +++++ Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.h | 1 + 4 files changed, 14 insertions(+) diff --git a/Unity/AirLibWrapper/AirsimWrapper/Source/SimMode/SimModeBase.cpp b/Unity/AirLibWrapper/AirsimWrapper/Source/SimMode/SimModeBase.cpp index c8d5ef1129..fd1e170256 100644 --- a/Unity/AirLibWrapper/AirsimWrapper/Source/SimMode/SimModeBase.cpp +++ b/Unity/AirLibWrapper/AirsimWrapper/Source/SimMode/SimModeBase.cpp @@ -73,6 +73,13 @@ void SimModeBase::continueForTime(double seconds) throw std::domain_error("continueForTime is not implemented by SimMode"); } +void SimModeBase::continueForFrames(uint32_t frames) +{ + //should be overridden by derived class + unused(frames); + throw std::domain_error("continueForFrames is not implemented by SimMode"); +} + void SimModeBase::setTimeOfDay(bool is_enabled, const std::string& start_datetime, bool is_start_datetime_dst, float celestial_clock_speed, float update_interval_secs, bool move_sun) { diff --git a/Unity/AirLibWrapper/AirsimWrapper/Source/SimMode/SimModeBase.h b/Unity/AirLibWrapper/AirsimWrapper/Source/SimMode/SimModeBase.h index 6e4020c7ee..d41ecb88d5 100644 --- a/Unity/AirLibWrapper/AirsimWrapper/Source/SimMode/SimModeBase.h +++ b/Unity/AirLibWrapper/AirsimWrapper/Source/SimMode/SimModeBase.h @@ -46,6 +46,7 @@ class SimModeBase virtual bool isPaused() const; virtual void pause(bool is_paused); virtual void continueForTime(double seconds); + virtual void continueForFrames(uint32_t frames); virtual void setWind(const msr::airlib::Vector3r& wind) const; void startApiServer(); void stopApiServer(); diff --git a/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.cpp b/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.cpp index e645e205ef..4679fea828 100644 --- a/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.cpp +++ b/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.cpp @@ -30,6 +30,11 @@ void WorldSimApi::continueForTime(double seconds) simmode_->continueForTime(seconds); } +void WorldSimApi::continueForFrames(uint32_t frames) +{ + simmode_->continueForFrames(frames); +} + void WorldSimApi::setTimeOfDay(bool is_enabled, const std::string& start_datetime, bool is_start_datetime_dst, float celestial_clock_speed, float update_interval_secs, bool move_sun) { diff --git a/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.h b/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.h index 2f479655f3..d19928bd9b 100644 --- a/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.h +++ b/Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.h @@ -23,6 +23,7 @@ class WorldSimApi : public msr::airlib::WorldSimApiBase virtual void reset() override; virtual void pause(bool is_paused) override; virtual void continueForTime(double seconds) override; + virtual void continueForFrames(uint32_t frames) override; virtual void setTimeOfDay(bool is_enabled, const std::string& start_datetime, bool is_start_datetime_dst, float celestial_clock_speed, float update_interval_secs, bool move_sun) override; From c0cdad7c76d059f7b0c66d89b562348e926eda23 Mon Sep 17 00:00:00 2001 From: Niek van Leeuwen Date: Sun, 31 Jan 2021 16:34:08 +0100 Subject: [PATCH 2/2] Fixed wrong type in docstring --- PythonClient/airsim/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PythonClient/airsim/client.py b/PythonClient/airsim/client.py index c1ea8dcadf..27e6cc84b7 100644 --- a/PythonClient/airsim/client.py +++ b/PythonClient/airsim/client.py @@ -116,7 +116,7 @@ def simContinueForFrames(self, frames): Continue (or resume if paused) the simulation for the specified number of frames, after which the simulation will be paused. Args: - frames (float): Frames to run the simulation for + frames (int): Frames to run the simulation for """ self.client.call('simContinueForFrames', frames)