Apollo 10.0
自动驾驶开放平台
rtcm_decode.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2017 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
17#pragma once
18
19#include "third_party/rtklib/rtklib.h"
20#include "modules/common_msgs/sensor_msgs/gnss_raw_observation.pb.h"
21
22namespace apollo {
23namespace drivers {
24namespace gnss {
25
26static inline int baud_obs_num(int type) {
27 switch (type) {
28 case 1002: // gps L1 only
29 return 1;
30
31 case 1004: // gps L1/L1
32 return 2;
33
34 case 1010: // glonass L1 only
35 return 0;
36
37 case 1012: // glonass L1 & L2
38 return 2;
39
40 case 1125:
41 case 1005: // station arp, for pose, no antenna height
42 case 1006: // station arp, with antenna height
43 case 1007: // antenna descriptor
44 case 1008: // antenna descriptor& serial number
45 case 1019: // gps ephemerides
46 case 1020: // glonass ephemerides
47 case 1033: // receiver and antenna descriptor, for station
48 case 1044: // qzss ephemerides
49 case 1045: // galileo
50 default:
51 return 0;
52 }
53}
54
55static inline bool gnss_sys(int message_type,
57 switch (message_type) {
58 case 1019: // gps ephemerides
60 break;
61
62 case 1020: // glonass ephemerides
64 break;
65
66 case 1045: // galileo ephemerides
68 break;
69
70 case 1047: // beidou ephemerides
72 break;
73
74 case 1044: // qzss ephemerides
75 default:
76 return false;
77 }
78 return true;
79}
80
81static inline bool gnss_sys_type(int sys_id,
83 switch (sys_id) {
84 case SYS_GPS:
86 break;
87
88 case SYS_CMP:
90 break;
91
92 case SYS_GLO:
94 break;
95
96 case SYS_GAL:
98 break;
99
100 default:
101 AINFO << "Not support sys id: " << sys_id;
102 return false;
103 }
104 return true;
105}
106
107static inline bool gnss_baud_id(apollo::drivers::gnss::GnssType sys_type,
108 int seq,
110 switch (sys_type) {
112 if (seq == 0) {
114 } else if (seq == 1) {
116 } else if (seq == 2) {
118 } else {
119 AINFO << "Not support gps baud seq : " << seq;
120 return false;
121 }
122 break;
123
125 if (seq == 0) {
127 } else if (seq == 1) {
129 } else if (seq == 2) {
131 } else {
132 AINFO << "Not support beidou baud seq : " << seq;
133 return false;
134 }
135 break;
136
138 if (seq == 0) {
140 } else if (seq == 1) {
142 } else {
143 AINFO << "Not support beidou glonass seq : " << seq;
144 return false;
145 }
146 break;
147
148 default:
149 AINFO << "Not support sys " << static_cast<int>(sys_type) << ", seq "
150 << seq;
151 return false;
152 }
153 return true;
154}
155
156static inline bool gnss_time_type(
159 switch (sys_type) {
162 break;
163
166 break;
167
170 break;
171
174 break;
175
176 default:
177 AINFO << "Not support sys " << static_cast<int>(sys_type);
178 return false;
179 }
180 return true;
181}
182
183} // namespace gnss
184} // namespace drivers
185} // namespace apollo
#define AINFO
Definition log.h:42
uint32_t seq
Sequence number of message
class register implement
Definition arena_queue.h:37