Skip to content

Commit

Permalink
Merge pull request #1379 from tier4/fix/hard-coded-update-rate
Browse files Browse the repository at this point in the history
fix(mock): hard-coded update rate
  • Loading branch information
hakuturu583 authored Sep 13, 2024
2 parents e78981c + f6ef3c9 commit 2da5c9e
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 2da5c9e

Please sign in to comment.