QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
FemtoPlan.h
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <chrono>
5#include <span>
6#include <string_view>
7
8#include <QtCore/QByteArray>
9
10#include "GPSCommand.h"
11
13
16namespace Femto::Plan {
17
18struct Command
19{
20 std::string_view line;
21 std::string_view accepted;
22};
23
25inline constexpr std::chrono::milliseconds RESPONSE_TIMEOUT{200};
26inline constexpr std::string_view REJECTED = "<ERROR";
27
29inline constexpr unsigned BAUD = 115200;
30inline constexpr std::array BAUD_RATES{BAUD};
31
33inline constexpr Command VERSION{"VERSION\r\n", "<VERSION OK"};
34
36inline constexpr std::array IDENTIFY{
37 Command{"UNLOGALL THISPORT\r\n", "<UNLOGALL OK"},
38 VERSION,
39};
40inline constexpr unsigned IDENTIFY_ROUNDS = 2;
41
43inline constexpr Command GGA_OUTPUT{"LOG GPGGA 1 \r\n", "<LOG OK"};
45inline constexpr unsigned AVERAGED_POSITION_QUALITY = 7;
46
48inline constexpr std::array SURVEY_IN{
49 Command{"POSAVE ON \r\n", "<POSAVE OK"},
51};
52
55inline constexpr Command ELLIPSOID_HEIGHTS{"UNDULATION USER 0\r\n", "UNDULATION OK"};
56
59inline constexpr std::string_view FIX_POSITION_ACCEPTED = "FIX OK";
60
62inline constexpr std::array RTCM_OUTPUT{
63 Command{"LOG RTCM 1\r\n", "<LOG OK"},
64};
65
66[[nodiscard]] GPSCommandSequence sequence(std::span<const Command> commands);
67
69[[nodiscard]] GPSCommandSequence fixedBase(const GPSEllipsoidPosition& position);
70
71} // namespace Femto::Plan
constexpr std::string_view REJECTED
Definition FemtoPlan.h:26
constexpr unsigned AVERAGED_POSITION_QUALITY
GGA fix quality of a position the receiver holds fixed: position averaging finished.
Definition FemtoPlan.h:45
constexpr std::string_view FIX_POSITION_ACCEPTED
Definition FemtoPlan.h:59
GPSCommandSequence sequence(std::span< const Command > commands)
Definition FemtoPlan.cc:24
constexpr Command GGA_OUTPUT
GGA output; the base station uses it only to observe the survey-in.
Definition FemtoPlan.h:43
constexpr std::array IDENTIFY
Stops every log on this port and identifies the receiver, in up to IDENTIFY_ROUNDS rounds.
Definition FemtoPlan.h:36
GPSCommandSequence fixedBase(const GPSEllipsoidPosition &position)
ELLIPSOID_HEIGHTS, FIX_POSITION for position, then GGA_OUTPUT.
Definition FemtoPlan.cc:33
constexpr std::array RTCM_OUTPUT
RTCM3 output once the base position is known.
Definition FemtoPlan.h:62
constexpr std::array SURVEY_IN
Survey-in base: receiver position averaging. A GGA fix of quality 7 completes it, and RTCM_OUTPUT fol...
Definition FemtoPlan.h:48
constexpr unsigned IDENTIFY_ROUNDS
Definition FemtoPlan.h:40
constexpr Command ELLIPSOID_HEIGHTS
Definition FemtoPlan.h:55
constexpr Command VERSION
Identifies the receiver without changing it, so receiver detection probes with it alone.
Definition FemtoPlan.h:33
constexpr std::chrono::milliseconds RESPONSE_TIMEOUT
Per attempt, for every command.
Definition FemtoPlan.h:25
constexpr std::array BAUD_RATES
Definition FemtoPlan.h:30
constexpr unsigned BAUD
The link rate unless one is selected or detected, and the only rate receiver detection probes.
Definition FemtoPlan.h:29
std::string_view line
Definition FemtoPlan.h:20
std::string_view accepted
Definition FemtoPlan.h:21
WGS84 geodetic position with ellipsoid height, not mean-sea-level altitude.