Skip to content

Commit

Permalink
fix(mock): hard-coded update rate
Browse files Browse the repository at this point in the history
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
  • Loading branch information
satoshi-ota committed Sep 13, 2024
1 parent e78981c commit f6ef3c9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mock/cpp_mock_scenarios/src/cpp_scenario_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ void CppScenarioNode::start()
{
onInitialize();
api_.startNpcLogic();
using namespace std::chrono_literals;
update_timer_ = this->create_wall_timer(50ms, std::bind(&CppScenarioNode::update, this));
const auto rate =
std::chrono::duration<double>(1.0 / get_parameter("global_frame_rate").as_double());
update_timer_ = this->create_wall_timer(rate, std::bind(&CppScenarioNode::update, this));
}

void CppScenarioNode::stop(Result result, const std::string & description)
Expand Down

0 comments on commit f6ef3c9

Please sign in to comment.