Skip to content

Commit

Permalink
chore: use diagnostic_updater.use_fqn parameter
Browse files Browse the repository at this point in the history
Signed-off-by: Max SCHMELLER <max.schmeller@tier4.jp>
  • Loading branch information
mojomex committed Nov 6, 2024
1 parent cfde492 commit a71032c
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions nebula_ros/src/hesai/hw_monitor_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "nebula_ros/common/parameter_descriptors.hpp"

#include <diagnostic_updater/diagnostic_updater.hpp>
#include <nebula_common/nebula_common.hpp>

namespace nebula
Expand All @@ -15,7 +16,8 @@ HesaiHwMonitorWrapper::HesaiHwMonitorWrapper(
const std::shared_ptr<nebula::drivers::HesaiHwInterface> & hw_interface,
std::shared_ptr<const nebula::drivers::HesaiSensorConfiguration> & config)
: logger_(parent_node->get_logger().get_child("HwMonitor")),
diagnostics_updater_(parent_node),
diagnostics_updater_(
(parent_node->declare_parameter<bool>("diagnostic_updater.use_fqn", true), parent_node)),
status_(Status::OK),
hw_interface_(hw_interface),
parent_node_(parent_node)
Expand Down Expand Up @@ -77,18 +79,11 @@ void HesaiHwMonitorWrapper::InitializeHesaiDiagnostics()
diagnostics_updater_.setHardwareID(hardware_id);
RCLCPP_INFO_STREAM(logger_, "Hardware ID: " + hardware_id);

diagnostics_updater_.add("hesai_status", this, &HesaiHwMonitorWrapper::HesaiCheckStatus);
diagnostics_updater_.add("hesai_ptp", this, &HesaiHwMonitorWrapper::HesaiCheckPtp);
diagnostics_updater_.add(
std::string(parent_node_->get_namespace()) + " :hesai_status", this,
&HesaiHwMonitorWrapper::HesaiCheckStatus);
diagnostics_updater_.add(
std::string(parent_node_->get_namespace()) + " :hesai_ptp", this,
&HesaiHwMonitorWrapper::HesaiCheckPtp);
diagnostics_updater_.add(
std::string(parent_node_->get_namespace()) + " :hesai_temperature", this,
&HesaiHwMonitorWrapper::HesaiCheckTemperature);
diagnostics_updater_.add(
std::string(parent_node_->get_namespace()) + " :hesai_rpm", this,
&HesaiHwMonitorWrapper::HesaiCheckRpm);
"hesai_temperature", this, &HesaiHwMonitorWrapper::HesaiCheckTemperature);
diagnostics_updater_.add("hesai_rpm", this, &HesaiHwMonitorWrapper::HesaiCheckRpm);

current_status_.reset();
current_monitor_.reset();
Expand Down

0 comments on commit a71032c

Please sign in to comment.