Abstract base class for all system check plugins. More...
#include <system_check_base.hpp>
Inheritance diagram for system_health_check::base::SystemCheckBase:Public Member Functions | |
| virtual | ~SystemCheckBase () |
| bool | check (rclcpp::Node::SharedPtr node) |
| Executes the system check with caching support. | |
| std::string | report (rclcpp::Node::SharedPtr node) |
| Generates a human-readable report of the check. | |
Protected Member Functions | |
| virtual std::string | get_unique_id () const |
| Generates a unique identifier for the check instance. | |
| virtual void | prepare_check (rclcpp::Node::SharedPtr node) |
| Prepares the check before execution. | |
| virtual bool | check_impl (rclcpp::Node::SharedPtr node)=0 |
| Actual implementation of the check logic. | |
| virtual std::string | report_impl (rclcpp::Node::SharedPtr node)=0 |
| Generates a detailed report of the check. | |
Abstract base class for all system check plugins.
Any package that wants to perform a system check must inherit from this class and implement the check() and report() methods.
|
inlinevirtual |
|
inline |
Executes the system check with caching support.
| node | Shared pointer to the ROS 2 node. |
This function follows the NVI pattern. It first checks if a valid result exists in the cache for the generated ID. If found, it returns the cached result immediately. Otherwise, it invokes check_impl() and saves the result.
|
protectedpure virtual |
Actual implementation of the check logic.
check. | node | Shared pointer to the ROS 2 node. |
Implemented in system_health_check::checks::PassCheck, and system_health_check::checks::FailCheck.
|
inlineprotectedvirtual |
Generates a unique identifier for the check instance.
Used as a key for the result cache.
|
inlineprotectedvirtual |
Prepares the check before execution.
| node | Shared pointer to the ROS 2 node. |
Derived classes can override this function to perform any necessary setup.
Reimplemented in system_health_check::base::ActionGraphCheckBase, system_health_check::base::LifecycleStatusCheckBase, system_health_check::base::ServiceGraphCheckBase, system_health_check::base::TopicCountCheckBase, system_health_check::base::TopicStatusCheckBase< MessageT >, system_health_check::base::TopicStatusCheckBase< Msg >, system_health_check::base::TopicStatusCheckBase< JoyMsg >, system_health_check::base::TopicStatusCheckBase< WrenchMsg >, system_health_check::base::TopicStatusCheckBase< JoyCommonMsg >, system_health_check::base::TopicStatusCheckBase< OdometryMsg >, system_health_check::base::TopicStatusCheckBase< GnssMsg >, system_health_check::base::TopicStatusCheckBase< OdomMsg >, system_health_check::base::TopicStatusCheckBase< DepthMsg >, system_health_check::base::TopicStatusCheckBase< DvlMsg >, system_health_check::base::TopicStatusCheckBase< ImuMsg >, and system_health_check::base::TopicStatusCheckBase< std_msgs::msg::String >.
|
inline |
Generates a human-readable report of the check.
| node | Shared pointer to the ROS 2 node. |
|
protectedpure virtual |
Generates a detailed report of the check.
| node | Shared pointer to the ROS 2 node. |
It should return a string containing diagnostic information (e.g., sensor values, error codes).
Implemented in system_health_check::checks::PassCheck, and system_health_check::checks::FailCheck.