Apollo 应用与源码分析:Monitor监控-硬件监控-GPS
创始人
2024-02-22 03:57:29
0

硬件架构图

可以看到左下角的“GNSS定位模块”其实是有IMU和GPS Antenna 组成的。

执行分析

代码

class GpsMonitor : public RecurrentRunner {public:GpsMonitor();void RunOnce(const double current_time) override;
};void GpsMonitor::RunOnce(const double current_time) {auto manager = MonitorManager::Instance();Component* component = apollo::common::util::FindOrNull(*manager->GetStatus()->mutable_components(), FLAGS_gps_component_name);if (component == nullptr) {// GPS is not monitored in current mode, skip.return;}ComponentStatus* component_status = component->mutable_other_status();component_status->clear_status();static auto gnss_best_pose_reader =manager->CreateReader(FLAGS_gnss_best_pose_topic);gnss_best_pose_reader->Observe();const auto gnss_best_pose_status = gnss_best_pose_reader->GetLatestObserved();if (gnss_best_pose_status == nullptr) {SummaryMonitor::EscalateStatus(ComponentStatus::ERROR,"No GnssBestPose message", component_status);return;}switch (gnss_best_pose_status->sol_type()) {case SolutionType::NARROW_INT:SummaryMonitor::EscalateStatus(ComponentStatus::OK, "", component_status);break;case SolutionType::SINGLE:SummaryMonitor::EscalateStatus(ComponentStatus::WARN, "SolutionType is SINGLE", component_status);break;default:SummaryMonitor::EscalateStatus(ComponentStatus::ERROR,"SolutionType is wrong", component_status);break;}
}

分析

gps monitor 核心内容就70 line code

基本思路如下:

  1. 从配置文件中查找GPS是否是被配置的监控组件
  2. 如果是的话,订阅GnssBestPose topic,并收取数据
  3. 获取最新的数据,如果最新的数据为null,发出ERROR级别的故障
  4. 如果获取的数据类型为NARROW_INT,表示正常
  5. 如果获取的数据类型为SINGLE,表示WARN
    1. 这里根据apollo 的定位算法设计与硬件架构,不难猜SINGLE 代表IMU 惯性单元或GPS有一个没有正常输出数据
    2. 如果获取的数据类型为其他情况,表示ERROR

GnssBestPose 和 SolutionType 的定义都来自 GNSS 驱动。

modules/drivers/gnss/proto/gnss_best_pose.proto
enum SolutionType {NONE = 0;FIXEDPOS = 1;FIXEDHEIGHT = 2;FLOATCONV = 4;WIDELANE = 5;NARROWLANE = 6;DOPPLER_VELOCITY = 8;SINGLE = 16;PSRDIFF = 17;WAAS = 18;PROPOGATED = 19;OMNISTAR = 20;L1_FLOAT = 32;IONOFREE_FLOAT = 33;NARROW_FLOAT = 34;L1_INT = 48;WIDE_INT = 49;NARROW_INT = 50;RTK_DIRECT_INS =51;  // RTK filter is directly initialized from the INS filter.INS_SBAS = 52;INS_PSRSP = 53;INS_PSRDIFF = 54;INS_RTKFLOAT = 55;INS_RTKFIXED = 56;INS_OMNISTAR = 57;INS_OMNISTAR_HP = 58;INS_OMNISTAR_XP = 59;OMNISTAR_HP = 64;OMNISTAR_XP = 65;PPP_CONVERGING = 68;PPP = 69;INS_PPP_CONVERGING = 73;INS_PPP = 74;
}

 

相关内容

热门资讯

监控摄像头接入GB28181平... 流程简介将监控摄像头的视频在网站和APP中直播,要解决的几个问题是:1&...
Windows10添加群晖磁盘... 在使用群晖NAS时,我们需要通过本地映射的方式把NAS映射成本地的一块磁盘使用。 通过...
protocol buffer... 目录 目录 什么是protocol buffer 1.protobuf 1.1安装  1.2使用...
Fluent中创建监测点 1 概述某些仿真问题,需要创建监测点,用于获取空间定点的数据࿰...
educoder数据结构与算法...                                                   ...
MySQL下载和安装(Wind... 前言:刚换了一台电脑,里面所有东西都需要重新配置,习惯了所...
MFC文件操作  MFC提供了一个文件操作的基类CFile,这个类提供了一个没有缓存的二进制格式的磁盘...
在Word、WPS中插入AxM... 引言 我最近需要写一些文章,在排版时发现AxMath插入的公式竟然会导致行间距异常&#...
有效的括号 一、题目 给定一个只包括 '(',')','{','}'...
【Ctfer训练计划】——(三... 作者名:Demo不是emo  主页面链接:主页传送门 创作初心ÿ...