Apollo 10.0
自动驾驶开放平台
data_parser.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 <memory>
20#include <string>
21
22#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
23#include <proj_api.h>
24
25#include "modules/common_msgs/localization_msgs/gps.pb.h"
26#include "modules/common_msgs/localization_msgs/imu.pb.h"
27#include "modules/common_msgs/sensor_msgs/gnss.pb.h"
28#include "modules/common_msgs/sensor_msgs/gnss_best_pose.pb.h"
29#include "modules/common_msgs/sensor_msgs/gnss_raw_observation.pb.h"
30#include "modules/common_msgs/sensor_msgs/heading.pb.h"
31#include "modules/common_msgs/sensor_msgs/imu.pb.h"
32#include "modules/common_msgs/sensor_msgs/ins.pb.h"
33#include "modules/drivers/gnss/proto/config.pb.h"
34#include "modules/drivers/gnss/proto/gnss_status.pb.h"
35
36#include "cyber/cyber.h"
39
40namespace apollo {
41namespace drivers {
42namespace gnss {
43
45 public:
46 DataParser(const config::Config &config,
47 const std::shared_ptr<apollo::cyber::Node> &node);
49 bool Init();
50 void ParseRawData(const std::string &msg);
51
52 private:
53 void DispatchMessage(const MessageInfo &message_info);
54 void PublishInsStat(const MessagePtr message);
55 void PublishOdometry(const MessagePtr message);
56 void PublishCorrimu(const MessagePtr message);
57 void PublishImu(const MessagePtr message);
58 void PublishBestpos(const MessagePtr message);
59 void PublishEphemeris(const MessagePtr message);
60 void PublishObservation(const MessagePtr message);
61 void PublishHeading(const MessagePtr message);
62 void CheckInsStatus(Ins *ins);
63 void CheckGnssStatus(Gnss *gnss);
64 void GpsToTransformStamped(
65 const std::shared_ptr<apollo::localization::Gps> &gps,
67
68 bool init_flag_ = false;
69 config::Config config_;
70 std::unique_ptr<Parser> data_parser_;
72
73 GnssStatus gnss_status_;
74 InsStatus ins_status_;
75 uint32_t ins_status_record_ = static_cast<uint32_t>(0);
76 projPJ wgs84pj_source_;
77 projPJ utm_target_;
78 bool has_ins_stat_message_ = false;
79
80 std::shared_ptr<apollo::cyber::Node> node_ = nullptr;
81 std::shared_ptr<apollo::cyber::Writer<GnssStatus>> gnssstatus_writer_ =
82 nullptr;
83 std::shared_ptr<apollo::cyber::Writer<InsStatus>> insstatus_writer_ = nullptr;
84 std::shared_ptr<apollo::cyber::Writer<GnssBestPose>> gnssbestpose_writer_ =
85 nullptr;
86 std::shared_ptr<apollo::cyber::Writer<apollo::localization::CorrectedImu>>
87 corrimu_writer_ = nullptr;
88 std::shared_ptr<apollo::cyber::Writer<Imu>> rawimu_writer_ = nullptr;
89 std::shared_ptr<apollo::cyber::Writer<apollo::localization::Gps>>
90 gps_writer_ = nullptr;
91 std::shared_ptr<apollo::cyber::Writer<InsStat>> insstat_writer_ = nullptr;
92 std::shared_ptr<apollo::cyber::Writer<GnssEphemeris>> gnssephemeris_writer_ =
93 nullptr;
94 std::shared_ptr<apollo::cyber::Writer<EpochObservation>>
95 epochobservation_writer_ = nullptr;
96 std::shared_ptr<apollo::cyber::Writer<Heading>> heading_writer_ = nullptr;
97};
98
99} // namespace gnss
100} // namespace drivers
101} // namespace apollo
void ParseRawData(const std::string &msg)
This class provides an easy way to publish coordinate frame transform information.
::google::protobuf::Message * MessagePtr
Definition parser.h:34
class register implement
Definition arena_queue.h:37