From 5d86907da0491164a1116608f0a2e7f231ef27d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Lech?= Date: Tue, 5 Mar 2024 09:36:15 +0100 Subject: [PATCH] use_sim_time used in concealer initialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Lech --- simulation/traffic_simulator/src/entity/ego_entity.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/simulation/traffic_simulator/src/entity/ego_entity.cpp b/simulation/traffic_simulator/src/entity/ego_entity.cpp index e3a056c2dc8..93c2ffb3033 100644 --- a/simulation/traffic_simulator/src/entity/ego_entity.cpp +++ b/simulation/traffic_simulator/src/entity/ego_entity.cpp @@ -40,7 +40,9 @@ static auto getParameter(const std::string & name, T value = {}) { rclcpp::Node node{"get_parameter", "simulation"}; - node.declare_parameter(name, value); + if (!node.has_parameter(name)) { + node.declare_parameter(name, value); + } node.get_parameter(name, value); return value; @@ -67,7 +69,9 @@ auto EgoEntity::makeFieldOperatorApplication(const Configuration & configuration : Configuration::Pathname(rviz_config).string()), "scenario_simulation:=true", "use_foa:=false", "perception/enable_traffic_light:=" + - std::string((architecture_type >= "awf/universe/20230906") ? "true" : "false")) + std::string((architecture_type >= "awf/universe/20230906") ? "true" : "false"), + "use_sim_time:=" + + std::string(getParameter("use_sim_time") ? "true" : "false")) : std::make_unique< concealer::FieldOperatorApplicationFor>(); } else {