Apollo 10.0
自动驾驶开放平台
forsense_base_parser.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2024 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;
68 // 数据标准差
69 double lat_std = 0.0;
70 double lon_std = 0.0;
71 double alti_std = 0.0;
72 double vn_std = 0.0;
73 double ve_std = 0.0;
74 double vu_std = 0.0;
75 double v_std = 0.0;
76
77 double roll_std = 0.0;
78 double pitch_std = 0.0;
79 double yaw_std = 0.0;
80};
81
82class ForsenseBaseParser : public Parser {
83 public:
85 explicit ForsenseBaseParser(const config::Config &config);
86
87 virtual bool PrepareMessage() = 0;
88
89 virtual void GetMessages(MessageInfoVec *messages);
90
91 protected:
92 void PrepareMessageStatus(const uint8_t &system_state,
93 const uint8_t &satellite_status);
95
96 private:
97 void FillGnssBestpos();
98 void FillIns();
99 void FillInsStat();
100 void FillImu();
101 void FillHeading();
102
103 GnssBestPose bestpos_;
104 Imu imu_;
105 Heading heading_;
106 Ins ins_;
107 InsStat ins_stat_;
108};
109
110} // namespace gnss
111} // namespace drivers
112} // namespace apollo
virtual void GetMessages(MessageInfoVec *messages)
void PrepareMessageStatus(const uint8_t &system_state, const uint8_t &satellite_status)
std::vector< MessageInfo > MessageInfoVec
Definition parser.h:57
class register implement
Definition arena_queue.h:37