Skip to content

Commit

Permalink
Merge pull request #3351 from niekvleeuwen/fix-continueForFrames
Browse files Browse the repository at this point in the history
Fix compile error for Unity build
  • Loading branch information
zimmy87 authored Feb 2, 2021
2 parents 5639d55 + c0cdad7 commit 3d1195e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion PythonClient/airsim/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 5 additions & 0 deletions Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 3d1195e

Please sign in to comment.