首页 > 解决方案 > 阅读 uint8_t XsRawGnssPvtData 在 C++ 和 Ubuntu 中检查 GPS RTK

问题描述

如果我的问题太愚蠢,我很抱歉,但不幸的是,我不是 C++ 开发人员。因此,我想读取 m_fixType 和 m_flags 的值,它们是名为 XsRawGnssPvtData 的结构的数据成员。

以下是关于这两个成员的信息:

uint8_t XsRawGnssPvtData::m_fixType
GNSSfix Type, range 0..5 0x00 = No Fix 0x01 = Dead Reckoning only 0x02 = 2D-Fix 0x03 = 3D-Fix 0x04 = GNSS + dead reckoning combined 0x05 = Time only fix 0x06..0xff: reserved

uint8_t XsRawGnssPvtData::m_flags
Fix Status Flags bit(0) = Set if there is a valid fix (i.e. within DOP & accuracy masks) bit(1) = Set if differential corrections were applied bit(4..2) = Power save mode state bit(5) = Set if heading of vehicle is valid bit(7..6) = Carrier phase range solution status: 0 = none, 1 = floating, 2 = fixed

我正在尝试以这种方式阅读它们:

if (packet.containsRawGnssPvtData()){
            XsRawGnssPvtData status = packet.rawGnssPvtData();
            cout << "type: " << unsigned(status.m_fixType) << " corrections: " << unsigned(status.m_flags);
        }

我得到的是输出整数,我不知道它是否正确。例如,我得到:

类型:3 更正:1

这是预期的结果吗?我想检查我的 GPS 是否处于 RTK 模式,如果它正在接收更正,但我不明白如何读取结果。如果它是正确的,我应该得到更正:0 因为没有应用更正。

标签: gpsbit-manipulationuint8trtk

解决方案


推荐阅读