Skip to content

Commit

Permalink
Merge pull request #592 from ToyotaResearchInstitute/bmarchi/repeated…
Browse files Browse the repository at this point in the history
…_pause_play_step

Repeated simulation pausing/stepping misbehaves fix #589
  • Loading branch information
BMarchi committed Feb 19, 2019
2 parents 95b7a61 + 104e045 commit 716911c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/backend/simulation_runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,12 @@ void SimulationRunner::SendWorldStats() {
void SimulationRunner::ProcessWorldControlMessage(
const ignition::msgs::WorldControl& msg) {
if (msg.has_pause()) {
if (msg.pause()) {
/* If we press the play-pause button quickly,
more than one play/pause message will be sent
so we just ignore it. */
if (msg.pause() && !IsSimulationPaused()) {
PauseSimulation();
} else {
} else if (IsSimulationPaused()) {
UnpauseSimulation();
}
} else if (msg.has_step() && msg.step()) {
Expand Down

0 comments on commit 716911c

Please sign in to comment.