Apollo  6.0
Open source self driving car software
rtcm3_parser.h
Go to the documentation of this file.
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 <cmath>
20 #include <iostream>
21 #include <limits>
22 #include <map>
23 #include <memory>
24 #include <vector>
25 
26 #include "modules/drivers/gnss/proto/gnss_raw_observation.pb.h"
27 
28 #include "cyber/cyber.h"
29 
32 
33 namespace apollo {
34 namespace drivers {
35 namespace gnss {
36 
37 class Rtcm3Parser : public Parser {
38  public:
39  explicit Rtcm3Parser(bool is_base_satation);
40  virtual MessageType GetMessage(MessagePtr *message_ptr);
41 
42  private:
43  void SetObservationTime();
44  bool SetStationPosition();
45  void FillKepplerOrbit(const eph_t &eph,
46  apollo::drivers::gnss::KepplerOrbit *keppler_orbit);
47  void FillGlonassOrbit(const geph_t &eph,
48  apollo::drivers::gnss::GlonassOrbit *keppler_orbit);
49  bool ProcessObservation();
50  bool ProcessEphemerides();
51  bool ProcessStationParameters();
52  bool init_flag_;
53 
54  std::vector<uint8_t> buffer_;
55 
56  rtcm_t rtcm_;
57  bool is_base_station_ = false;
58 
59  apollo::drivers::gnss::GnssEphemeris ephemeris_;
60  apollo::drivers::gnss::EpochObservation observation_;
61 
62  struct Point3D {
63  double x;
64  double y;
65  double z;
66  };
67  std::map<int, Point3D> station_location_;
68 };
69 
70 } // namespace gnss
71 } // namespace drivers
72 } // namespace apollo
::google::protobuf::Message * MessagePtr
Definition: parser.h:54
Rtcm3Parser(bool is_base_satation)
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
MessageType
Definition: parser.h:75
Definition: parser.h:51
virtual MessageType GetMessage(MessagePtr *message_ptr)
Definition: rtcm3_parser.h:37