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

#include <gps_monitor.h>

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

Public 成员函数

 GpsMonitor ()
 
void RunOnce (const double current_time) override
 
- 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
 

详细描述

在文件 gps_monitor.h23 行定义.

构造及析构函数说明

◆ GpsMonitor()

apollo::monitor::GpsMonitor::GpsMonitor ( )

在文件 gps_monitor.cc36 行定义.

37 : RecurrentRunner(FLAGS_gps_monitor_name, FLAGS_gps_monitor_interval) {}
RecurrentRunner(const std::string &name, const double interval)

成员函数说明

◆ RunOnce()

void apollo::monitor::GpsMonitor::RunOnce ( const double  current_time)
overridevirtual

实现了 apollo::monitor::RecurrentRunner.

在文件 gps_monitor.cc39 行定义.

39 {
40 auto manager = MonitorManager::Instance();
41 Component* component = apollo::common::util::FindOrNull(
42 *manager->GetStatus()->mutable_components(), FLAGS_gps_component_name);
43 if (component == nullptr) {
44 // GPS is not monitored in current mode, skip.
45 return;
46 }
47 ComponentStatus* component_status = component->mutable_other_status();
48 component_status->clear_status();
49
50 static auto gnss_best_pose_reader =
51 manager->CreateReader<GnssBestPose>(FLAGS_gnss_best_pose_topic);
52 gnss_best_pose_reader->Observe();
53 const auto gnss_best_pose_status = gnss_best_pose_reader->GetLatestObserved();
54 if (gnss_best_pose_status == nullptr) {
55 SummaryMonitor::EscalateStatus(ComponentStatus::ERROR,
56 "No GnssBestPose message", component_status);
57 return;
58 }
59 switch (gnss_best_pose_status->sol_type()) {
60 case SolutionType::NARROW_INT:
61 SummaryMonitor::EscalateStatus(ComponentStatus::OK, "", component_status);
62 break;
63 case SolutionType::SINGLE:
65 ComponentStatus::WARN, "SolutionType is SINGLE", component_status);
66 break;
67 default:
68 SummaryMonitor::EscalateStatus(ComponentStatus::ERROR,
69 "SolutionType is wrong", component_status);
70 break;
71 }
72}
static void EscalateStatus(const ComponentStatus::Status new_status, const std::string &message, ComponentStatus *current_status)

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