Skip to content

Commit

Permalink
Revert "implement safe fault handling for hazard status converter"
Browse files Browse the repository at this point in the history
This reverts commit 08a64be.
  • Loading branch information
saka1-s committed Feb 14, 2025
1 parent 7c88a9c commit 7a10e0c
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 20 deletions.
9 changes: 1 addition & 8 deletions launch/tier4_system_launch/launch/system.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@
<arg name="launch_rqt_robot_monitor" default="false"/>
<arg name="launch_rqt_runtime_monitor_err" default="false"/>

<!-- Hazard Status Converter -->
<arg name="report_only_diag" default="false"/>
<arg name="report_safe_fault" default="false"/>

<group>
<push-ros-namespace namespace="/system"/>

Expand Down Expand Up @@ -124,10 +120,7 @@

<!-- Hazard Status Converter -->
<group unless="$(var use_emergency_handler)">
<include file="$(find-pkg-share hazard_status_converter)/launch/hazard_status_converter.launch.xml">
<arg name="report_only_diag" value="$(var report_only_diag)"/>
<arg name="report_safe_fault" value="$(var report_safe_fault)"/>
</include>
<include file="$(find-pkg-share hazard_status_converter)/launch/hazard_status_converter.launch.xml"/>
</group>

<!-- MRM Handler -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<launch>
<arg name="report_only_diag" default="false"/>
<arg name="report_safe_fault" default="false"/>
<node pkg="hazard_status_converter" exec="converter" name="hazard_status_converter">
<remap from="~/diagnostics_graph" to="/diagnostics_graph"/>
<remap from="~/hazard_status" to="/system/emergency/hazard_status"/>
<param name="report_only_diag" value="$(var report_only_diag)"/>
<param name="report_safe_fault" value="$(var report_safe_fault)"/>
</node>
</launch>
6 changes: 0 additions & 6 deletions system/hazard_status_converter/src/converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ Converter::Converter(const rclcpp::NodeOptions & options) : Node("converter", op
sub_graph_.register_create_callback(std::bind(&Converter::on_create, this, _1));
sub_graph_.register_update_callback(std::bind(&Converter::on_update, this, _1));
sub_graph_.subscribe(*this, 1);

report_only_diag_ = declare_parameter<bool>("report_only_diag", false);
report_safe_fault_ = declare_parameter<bool>("report_safe_fault", false);
}

void Converter::on_create(DiagGraph::ConstSharedPtr graph)
Expand Down Expand Up @@ -110,7 +107,6 @@ void Converter::on_update(DiagGraph::ConstSharedPtr graph)
HazardStatusStamped hazard;
for (const auto & unit : graph->units()) {
if (unit->path().empty()) continue;
if (report_only_diag_ && unit->type() != "diag") continue;
const bool is_auto_tree = auto_mode_tree_.count(unit);
const auto root_level = is_auto_tree ? auto_mode_root_->level() : DiagnosticStatus::OK;
const auto unit_level = unit->level();
Expand All @@ -121,8 +117,6 @@ void Converter::on_update(DiagGraph::ConstSharedPtr graph)
hazard.stamp = graph->updated_stamp();
hazard.status.level = get_system_level(hazard.status);
hazard.status.emergency = hazard.status.level == HazardStatus::SINGLE_POINT_FAULT;
if (report_safe_fault_)
hazard.status.emergency &= hazard.status.level == HazardStatus::SAFE_FAULT;
hazard.status.emergency_holding = false;
pub_hazard_->publish(hazard);
}
Expand Down
2 changes: 0 additions & 2 deletions system/hazard_status_converter/src/converter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ class Converter : public rclcpp::Node

DiagUnit * auto_mode_root_;
std::unordered_set<DiagUnit *> auto_mode_tree_;
bool report_only_diag_;
bool report_safe_fault_;
};

} // namespace hazard_status_converter
Expand Down

0 comments on commit 7a10e0c

Please sign in to comment.