Apollo 10.0
自动驾驶开放平台
apollo::monitor::FunctionalSafetyMonitor类 参考

#include <functional_safety_monitor.h>

类 apollo::monitor::FunctionalSafetyMonitor 继承关系图:
apollo::monitor::FunctionalSafetyMonitor 的协作图:

Public 成员函数

 FunctionalSafetyMonitor ()
 
void RunOnce (const double current_time)
 
- Public 成员函数 继承自 apollo::monitor::RecurrentRunner
 RecurrentRunner (const std::string &name, const double interval)
 
virtual ~RecurrentRunner ()=default
 
void Tick (const double current_time)
 

额外继承的成员函数

- Protected 属性 继承自 apollo::monitor::RecurrentRunner
std::string name_
 
unsigned int round_count_ = 0
 

详细描述

在文件 functional_safety_monitor.h27 行定义.

构造及析构函数说明

◆ FunctionalSafetyMonitor()

apollo::monitor::FunctionalSafetyMonitor::FunctionalSafetyMonitor ( )

在文件 functional_safety_monitor.cc46 行定义.

47 : RecurrentRunner(FLAGS_functional_safety_monitor_name, 0) {}
RecurrentRunner(const std::string &name, const double interval)

成员函数说明

◆ RunOnce()

void apollo::monitor::FunctionalSafetyMonitor::RunOnce ( const double  current_time)
virtual

实现了 apollo::monitor::RecurrentRunner.

在文件 functional_safety_monitor.cc49 行定义.

49 {
50 auto* system_status = MonitorManager::Instance()->GetStatus();
51 // Everything looks good or has been handled properly.
52 if (CheckSafety()) {
53 system_status->clear_passenger_msg();
54 system_status->clear_safety_mode_trigger_time();
55 system_status->clear_require_emergency_stop();
56 return;
57 }
58 if (system_status->require_emergency_stop()) {
59 // EStop has already been triggered.
60 return;
61 }
62
63 // Newly entered safety mode.
64 system_status->set_passenger_msg("Error! Please disengage.");
65 if (!system_status->has_safety_mode_trigger_time()) {
66 system_status->set_safety_mode_trigger_time(current_time);
67 return;
68 }
69
70 // Trigger EStop if no action was taken in time.
71 if (system_status->safety_mode_trigger_time() +
72 FLAGS_safety_mode_seconds_before_estop <
73 current_time) {
74 system_status->set_require_emergency_stop(true);
75 }
76}

该类的文档由以下文件生成: