31#include <pluginlib/class_loader.hpp>
32#include <rclcpp/rclcpp.hpp>
33#include <std_srvs/srv/empty.hpp>
35#include "event_detector/AnalysisRule.hpp"
36#include "event_detector/BufferManager.hpp"
37#include "event_detector/common.hpp"
161 std::map<std::string, std::shared_ptr<AnalysisRule>>
rules_;
166 std::map<std::string, std::shared_ptr<rclcpp::Service<std_srvs::srv::Empty>>>
trigger_services_;
Component of the Event Detector responsible for identifying relevant data.
std::map< std::string, rclcpp::TimerBase::SharedPtr > analysis_timers_
ROS timers triggering rule analysis, mapped to rule name.
void toggleAnalysis(const bool enable_periodic, const bool enable_service)
Toggle analysis on/off for all rules.
void loadRule(const std::string &rule_name)
Loads a rule into the manager.
double default_period_
default analysis interval
void runAnalysis(const std::string &rule_name)
Evaluates a single rule.
void toggleAnalysisByService(const std::string &rule_name, const bool enable)
Toggle service-based analysis for a specific rule.
void loadRules()
Loads all enabled rules into the manager.
double loadRuleAnalysisPeriod(const std::string &rule_name)
Loads analysis interval for a specific rule from the parameter server.
std::map< std::string, std::shared_ptr< rclcpp::Service< std_srvs::srv::Empty > > > trigger_services_
services that can be used to trigger rule evaluation, mapped to rule name
AnalysisManager(EventDetector *ed, std::shared_ptr< BufferManager > buffer, const double default_period)
Creates a new AnalysisManager with pre-defined rules.
void togglePeriodicAnalysis(const std::string &rule_name, const bool enable)
Toggle periodic analysis for a specific rule.
std::shared_ptr< BufferManager > buffer_
BufferManager component.
std::map< std::string, std::shared_ptr< AnalysisRule > > rules_
pre-defined rules to evaluate, mapped to rule name
bool isRuleEnabled(const std::string &rule_name)
Queries the parameter server to determine whether a rule is enabled.
std::shared_ptr< pluginlib::ClassLoader< AnalysisRule > > rule_loader_
pluginlib class loader for AnalysisRule plugins
EventDetector * ed_
EventDetector node.