From 457e4d7f5a9d293b36767f56ae476abcbdeda17a Mon Sep 17 00:00:00 2001 From: Nate Koenig Date: Tue, 26 Jul 2022 18:53:07 -0700 Subject: [PATCH] Use stepping field in message (#441) * Use stepping field in message Signed-off-by: Nate Koenig * Missing parens Signed-off-by: Nate Koenig Co-authored-by: Nate Koenig --- src/plugins/world_control/WorldControl.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/world_control/WorldControl.cc b/src/plugins/world_control/WorldControl.cc index e3cb15cb4..9e549190f 100644 --- a/src/plugins/world_control/WorldControl.cc +++ b/src/plugins/world_control/WorldControl.cc @@ -254,8 +254,12 @@ void WorldControl::ProcessMsg() // ignore the message if it's associated with a step const auto &header = this->dataPtr->msg.header(); - if ((header.data_size() > 0) && (header.data(0).key() == "step")) + if (this->dataPtr->msg.stepping() || + // (deprecated) Remove this check in Gazebo H + ((header.data_size() > 0) && (header.data(0).key() == "step"))) + { return; + } // If the pause state of the message doesn't match the pause state of this // plugin, then play/pause must have occurred elsewhere (for example, the