From 6a6c2107436a04f4df1979878587086f97696a6e Mon Sep 17 00:00:00 2001 From: Nate Koenig Date: Tue, 26 Jul 2022 12:36:56 -0700 Subject: [PATCH 1/2] Use stepping field in message Signed-off-by: Nate Koenig --- Migration.md | 4 ++++ src/SimulationRunner.cc | 3 +++ 2 files changed, 7 insertions(+) diff --git a/Migration.md b/Migration.md index 12a3dd6a25..467c930b09 100644 --- a/Migration.md +++ b/Migration.md @@ -37,6 +37,10 @@ release will remove the deprecated code. * The shared libraries have `gz` where there used to be `ignition`. * Using the un-migrated version is still possible due to tick-tocks, but will be removed in future versions. +* The WorldStatistics message published on the 'stats' topic now has +a `stepping` field that should be used in place the 'step' field in the +message's header. + * **Breaking Changes** * The project name has been changed to use the `gz-` prefix, you **must** use the `gz` prefix! * This also means that any generated code that use the project name (e.g. CMake variables, in-source macros) would have to be migrated. diff --git a/src/SimulationRunner.cc b/src/SimulationRunner.cc index 7fd4f13bfa..2d25d534b5 100644 --- a/src/SimulationRunner.cc +++ b/src/SimulationRunner.cc @@ -428,8 +428,11 @@ void SimulationRunner::PublishStats() if (this->Stepping()) { + // Remove this header in Gazebo H auto headerData = msg.mutable_header()->add_data(); headerData->set_key("step"); + + msg.set_stepping(true); } // Publish the stats message. The stats message is throttled. From 23c0e7d73451a75cfcd53abb0e28a3f234ec9c6e Mon Sep 17 00:00:00 2001 From: Nate Koenig Date: Tue, 26 Jul 2022 15:03:08 -0700 Subject: [PATCH 2/2] deprecated Signed-off-by: Nate Koenig --- src/SimulationRunner.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SimulationRunner.cc b/src/SimulationRunner.cc index 2d25d534b5..46a81d5b31 100644 --- a/src/SimulationRunner.cc +++ b/src/SimulationRunner.cc @@ -428,7 +428,7 @@ void SimulationRunner::PublishStats() if (this->Stepping()) { - // Remove this header in Gazebo H + // (deprecated) Remove this header in Gazebo H auto headerData = msg.mutable_header()->add_data(); headerData->set_key("step");