Skip to content

Commit

Permalink
cleanup code
Browse files Browse the repository at this point in the history
Signed-off-by: Keisuke Shima <19993104+KeisukeShima@users.noreply.github.com>
  • Loading branch information
KeisukeShima committed Apr 10, 2024
1 parent a37e39e commit 6f46242
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ class FaultInjectionNode : public rclcpp::Node
void on_simulation_events(const SimulationEvents::ConstSharedPtr msg);
rclcpp::Subscription<SimulationEvents>::SharedPtr sub_simulation_events_;

// Parameter Server
rcl_interfaces::msg::SetParametersResult on_set_param(
const std::vector<rclcpp::Parameter> & params);
OnSetParametersCallbackHandle::SharedPtr set_param_res_;

void update_event_diag(
diagnostic_updater::DiagnosticStatusWrapper & wrap, const std::string & event_name);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ FaultInjectionNode::FaultInjectionNode(rclcpp::NodeOptions node_options)

using std::placeholders::_1;

// Parameter Server
set_param_res_ =
this->add_on_set_parameters_callback(std::bind(&FaultInjectionNode::on_set_param, this, _1));

// Subscriber
sub_simulation_events_ = this->create_subscription<SimulationEvents>(
"~/input/simulation_events", rclcpp::QoS{rclcpp::KeepLast(10)},
Expand Down Expand Up @@ -86,29 +82,6 @@ void FaultInjectionNode::update_event_diag(
wrap.hardware_id = diag.hardware_id;
}

rcl_interfaces::msg::SetParametersResult FaultInjectionNode::on_set_param(
const std::vector<rclcpp::Parameter> & params)
{
rcl_interfaces::msg::SetParametersResult result;

RCLCPP_DEBUG(this->get_logger(), "call on_set_param");

try {
double value = NAN;
if (tier4_autoware_utils::updateParam(params, "diagnostic_updater.period", value)) {
updater_.set_period(value);
}
} catch (const rclcpp::exceptions::InvalidParameterTypeException & e) {
result.successful = false;
result.reason = e.what();
return result;
}

result.successful = true;
result.reason = "success";
return result;
}

std::vector<DiagConfig> FaultInjectionNode::read_event_diag_list()
{
// Expected parameter name is "event_diag_list.param_name".
Expand Down

0 comments on commit 6f46242

Please sign in to comment.