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

#include <monitor.h>

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

Public 成员函数

bool Init () override
 
bool Proc () override
 The Proc logic of the component, which called by the CyberRT frame.
 
- Public 成员函数 继承自 apollo::cyber::TimerComponent
 TimerComponent ()
 
 ~TimerComponent () override
 
bool Initialize (const TimerComponentConfig &config) override
 init the component by protobuf object.
 
void Clear () override
 
bool Process ()
 
uint32_t GetInterval () const
 
- Public 成员函数 继承自 apollo::cyber::ComponentBase
virtual ~ComponentBase ()
 
virtual bool Initialize (const ComponentConfig &config)
 
virtual void Shutdown ()
 
template<typename T >
bool GetProtoConfig (T *config) const
 

额外继承的成员函数

- Public 类型 继承自 apollo::cyber::ComponentBase
template<typename M >
using Reader = cyber::Reader< M >
 
- Protected 成员函数 继承自 apollo::cyber::ComponentBase
const std::string & ConfigFilePath () const
 
void LoadConfigFiles (const ComponentConfig &config)
 
void LoadConfigFiles (const TimerComponentConfig &config)
 
- Protected 属性 继承自 apollo::cyber::ComponentBase
std::atomic< bool > is_shutdown_ = {false}
 
std::shared_ptr< Nodenode_ = nullptr
 
std::string config_file_path_ = ""
 
std::vector< std::shared_ptr< ReaderBase > > readers_
 

详细描述

在文件 monitor.h33 行定义.

成员函数说明

◆ Init()

bool apollo::monitor::Monitor::Init ( )
overridevirtual

实现了 apollo::cyber::ComponentBase.

在文件 monitor.cc40 行定义.

40 {
41 MonitorManager::Instance()->Init(node_);
42
43 // Only the one CAN card corresponding to current mode will take effect.
44 runners_.emplace_back(new EsdCanMonitor());
45 runners_.emplace_back(new SocketCanMonitor());
46 // To enable the GpsMonitor, you must add FLAGS_gps_component_name to the
47 // mode's monitored_components.
48 runners_.emplace_back(new GpsMonitor());
49 // To enable the LocalizationMonitor, you must add
50 // FLAGS_localization_component_name to the mode's monitored_components.
51 runners_.emplace_back(new LocalizationMonitor());
52 // To enable the CameraMonitor, you must add
53 // FLAGS_camera_component_name to the mode's monitored_components.
54 runners_.emplace_back(new CameraMonitor());
55 // Monitor if processes are running.
56 runners_.emplace_back(new ProcessMonitor());
57 // Monitor if modules are running.
58 runners_.emplace_back(new ModuleMonitor());
59 // Monitor message processing latencies across modules
60 const std::shared_ptr<LatencyMonitor> latency_monitor(new LatencyMonitor());
61 runners_.emplace_back(latency_monitor);
62 // Monitor if channel messages are updated in time.
63 runners_.emplace_back(new ChannelMonitor(latency_monitor));
64 // Monitor if resources are sufficient.
65 runners_.emplace_back(new ResourceMonitor());
66 // Monitor all changes made by each sub-monitor, and summarize to a final
67 // overall status.
68 runners_.emplace_back(new SummaryMonitor());
69 // Check functional safety according to the summary.
70 if (FLAGS_enable_functional_safety) {
71 runners_.emplace_back(new FunctionalSafetyMonitor());
72 }
73
74 return true;
75}
std::shared_ptr< Node > node_

◆ Proc()

bool apollo::monitor::Monitor::Proc ( )
overridevirtual

The Proc logic of the component, which called by the CyberRT frame.

返回
returns true if successful, otherwise returns false

实现了 apollo::cyber::TimerComponent.

在文件 monitor.cc77 行定义.

77 {
78 const double current_time = apollo::cyber::Clock::NowInSeconds();
79 if (!MonitorManager::Instance()->StartFrame(current_time)) {
80 return false;
81 }
82 for (auto& runner : runners_) {
83 runner->Tick(current_time);
84 }
85 MonitorManager::Instance()->EndFrame();
86
87 return true;
88}
static double NowInSeconds()
gets the current time in second.
Definition clock.cc:56

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