Function ros2_medkit_gateway::ros2::conversions::fault_to_json
Defined in File fault_msg_conversions.hpp
Function Documentation
-
nlohmann::json ros2_medkit_gateway::ros2::conversions::fault_to_json(const ros2_medkit_msgs::msg::Fault &fault)
Convert a ros2_medkit_msgs::msg::Fault to JSON.
Produces the flat per-fault representation consumed by
list_faultsitems, the SSE fault-event payload, and the trigger subsystem’s notifier change values. Timestamps become seconds-as-double; severity gains a label.Lives at the ROS-coupled boundary because three independent call sites each translate
ros2_medkit_msgs::msg::Faultdirectly into JSON: the fault-service transport adapter, the SSE fault handler (subscribes to the FaultEvent topic directly), and the trigger fault subscriber. Keeping the helper free standing avoids code duplication while preserving the neutral FaultManager contract.