Apollo 10.0
自动驾驶开放平台
huace_base_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// An parser for decoding binary messages from a NovAtel receiver. The following
18// messages must be
19// logged in order for this parser to work properly.
20//
21#include <string>
22
23#include "modules/common_msgs/sensor_msgs/gnss.pb.h"
24#include "modules/common_msgs/sensor_msgs/gnss_best_pose.pb.h"
25#include "modules/common_msgs/sensor_msgs/gnss_raw_observation.pb.h"
26#include "modules/common_msgs/sensor_msgs/heading.pb.h"
27#include "modules/common_msgs/sensor_msgs/imu.pb.h"
28#include "modules/common_msgs/sensor_msgs/ins.pb.h"
29
30#include "cyber/cyber.h"
34
35namespace apollo {
36namespace drivers {
37namespace gnss {
38
40 std::string messageID;
42 double GPSTime;
43 double Heading;
44 double Pitch;
45 double Roll;
46 double GyroX;
47 double GyroY;
48 double GyroZ;
49 double AccX;
50 double AccY;
51 double AccZ;
52 double Latitude;
53 double Longitude;
54 double Altitude;
55 double Ve;
56 double Vn;
57 double Vu;
58 double V;
59 int NSV1;
60 int NSV2;
63 double Age;
64 std::string WarningCs;
65 uint8_t satellites_num = 0;
66 uint8_t wheel_speed_status = 0;
67
69 // 数据标准差
70 double lat_std = 0.0;
71 double lon_std = 0.0;
72 double alti_std = 0.0;
73 double vn_std = 0.0;
74 double ve_std = 0.0;
75 double vu_std = 0.0;
76 double v_std = 0.0;
77
78 double roll_std = 0.0;
79 double pitch_std = 0.0;
80 double yaw_std = 0.0;
81};
82
83class HuaCeBaseParser : public Parser {
84 public:
86 explicit HuaCeBaseParser(const config::Config &config);
87
88 virtual bool PrepareMessage() = 0;
89
90 virtual void GetMessages(MessageInfoVec *messages);
91
92 protected:
93 void PrepareMessageStatus(const uint8_t &system_state,
94 const uint8_t &satellite_status);
96
97 private:
98 void FillGnssBestpos();
99 void FillIns();
100 void FillInsStat();
101 void FillImu();
102 void FillHeading();
103
104 GnssBestPose bestpos_;
105 // bestpos 1hz rate control
106 RateControl bestpos_ratecontrol_{PERIOD_NS_1HZ};
107 Imu imu_;
108 Heading heading_;
109 Ins ins_;
110 InsStat ins_stat_;
111};
112
113} // namespace gnss
114} // namespace drivers
115} // namespace apollo
void PrepareMessageStatus(const uint8_t &system_state, const uint8_t &satellite_status)
virtual void GetMessages(MessageInfoVec *messages)
constexpr uint64_t PERIOD_NS_1HZ
std::vector< MessageInfo > MessageInfoVec
Definition parser.h:57
class register implement
Definition arena_queue.h:37