Apollo  6.0
Open source self driving car software
rtcm_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 <memory>
20 #include <string>
21 
22 #include "cyber/cyber.h"
23 
25 
26 #include "modules/drivers/gnss/proto/gnss_raw_observation.pb.h"
27 
28 namespace apollo {
29 namespace drivers {
30 namespace gnss {
31 
32 class RtcmParser {
33  public:
34  using MessagePtr = ::google::protobuf::Message*;
35  RtcmParser(const config::Config& config,
36  const std::shared_ptr<apollo::cyber::Node>& node);
38  bool Init();
39  void ParseRtcmData(const std::string& msg);
40 
41  private:
42  void DispatchMessage(Parser::MessageType type, MessagePtr message);
43  void PublishEphemeris(const MessagePtr& message);
44  void PublishObservation(const MessagePtr& message);
45 
46  config::Config config_;
47  std::shared_ptr<apollo::cyber::Node> node_ = nullptr;
48  std::shared_ptr<apollo::cyber::Writer<GnssEphemeris>> gnssephemeris_writer_ =
49  nullptr;
50  std::shared_ptr<apollo::cyber::Writer<EpochObservation>>
51  epochobservation_writer_ = nullptr;
52  bool init_flag_ = false;
53  std::unique_ptr<Parser> rtcm_parser_ = nullptr;
54 };
55 
56 } // namespace gnss
57 } // namespace drivers
58 } // namespace apollo
~RtcmParser()
Definition: rtcm_parser.h:37
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
MessageType
Definition: parser.h:75
::google::protobuf::Message * MessagePtr
Definition: rtcm_parser.h:34
void ParseRtcmData(const std::string &msg)
Definition: rtcm_parser.h:32
RtcmParser(const config::Config &config, const std::shared_ptr< apollo::cyber::Node > &node)