2 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef POSITIONING_CLIENT_INCLUDE_DEAD_RECKONING_API_H_
18 #define POSITIONING_CLIENT_INCLUDE_DEAD_RECKONING_API_H_
19 /****************************************************************************
20 * File name :Dead_Reckoning_API.h
21 * System name :PastModel002
23 ******************************************************************************/
25 /*****************************************************************************
27 *****************************************************************************/
28 #include <vehicle_service/positioning_base_library.h>
29 #include "Sensor_Common_API.h"
30 #include <native_service/frameworkunified_types.h>
32 /*****************************************************************************
34 *****************************************************************************/
35 #define NUM_OF_100msData (10) /* Number of gyro data items delivered every 100 ms */
37 /*****************************************************************************
39 *****************************************************************************/
40 typedef RET_API DR_RET_API;
42 /*****************************************************************************
44 *****************************************************************************/
45 /*******************************************************************************
46 TAG : NAVI_MATCHING_STATUS
47 ABSTRACT : Map matching data(Status)
49 *******************************************************************************/
50 typedef enum NaviMatchingStatus {
51 NAVI_MATCHING_STS_2D_FIX = 0x00,
52 NAVI_MATCHING_STS_3D_FIX,
53 NAVI_MATCHING_STS_DR_COMBINED,
54 NAVI_MATCHING_STS_DR_ONLY,
55 NAVI_MATCHING_STS_MAP_2D_GPS_FIX,
56 NAVI_MATCHING_STS_MAP_3D_GPS_FIX,
57 NAVI_MATCHING_STS_MAP_DR_COMBINED,
58 NAVI_MATCHING_STS_MAP_DR_ONLY,
59 NAVI_MATCHING_STS_MAP_NO_FIX,
60 NAVI_MATCHING_STS_AWAITING_FIRST_FIX,
61 NAVI_MATCHING_STS_DATA_INVALID,
62 NAVI_MATCHING_STS_NO_FIX,
63 NAVI_MATCHING_STS_TIME_ONLY_FIX
64 } NAVI_MATCHING_STATUS;
66 /*******************************************************************************
67 TAG : NAVI_MATCHING_DATA_AVAILABLE
68 ABSTRACT : Map matching data(Availability)
70 *******************************************************************************/
72 NAVI_MATCHING_DATA_INVALID = 0x00,
73 NAVI_MATCHING_DATA_VALID
74 } NAVI_MATCHING_DATA_AVAILABLE;
76 /*****************************************************************************
78 *****************************************************************************/
80 /*******************************************************************************
81 TAG : Struct_PulseRevTbl
82 ABSTRACT : Vehicle speed/REV data table structure
84 *******************************************************************************/
86 u_int8 reverse_flag; /* 0:Forward march 1:Backward 3:Disabled Reverse signal status */
87 u_int8 pulse_flag; /* Vehicle speed pulse flag */
88 /* 0:Enabled 1:Receive invalid value from CAN 2:Unable to receive at download timing */
89 u_int16 pulse_sum_cyclic; /* Vehicle speed pulse counter value */
91 /*******************************************************************************
93 ABSTRACT : Gyro Data Table Structure
95 *******************************************************************************/
97 u_int16 gyro_data[NUM_OF_100msData]; /* A/D-converted gyro data */
99 /*******************************************************************************
100 TAG : Struct_SensData
101 ABSTRACT : Sensor data structure
103 *******************************************************************************/
105 u_int8 sens_cnt_flag; /* Sensor data transmission counter flag */
106 /* 0:Disabled(->Initial Sensor) 1:Enabled(->100 ms periodic transmission) */
107 /* Set "0" for initial sensor transmission and "1" for periodic transmission. */
108 u_int8 sens_cnt; /* Sensor data transmission counter value Set "0" at initial transmission of sensor */
109 Struct_PulseRevTbl pulse_rev_tbl; /* Vehicle speed/REV Data table */
110 Struct_GyroTbl gyro_x_tbl; /* Gyro(X axis) data table */
111 Struct_GyroTbl gyro_y_tbl; /* Gyro(Y axis) data table */
112 Struct_GyroTbl gyro_z_tbl; /* Gyro(Z axis) data table */
116 /*******************************************************************************
118 ABSTRACT : GPS data structure
120 *******************************************************************************/
122 u_int8 sens_cnt; /* Sensor data transmission counter value */
123 u_int8 sens_cnt_flag; /* Sensor data transmission counter flag */
124 /* 0:Disabled(Incorrect GPS sensor counter) */
126 u_int16 gps_data_size; /* GPS data storage area size */
127 DID did; /* Data ID */
128 const void* gps_data; /* GPS data storage area */
131 /* Estimated Navigation Calculation Result */
132 /*******************************************************************************
134 ABSTRACT : Estimated Navigation Calculation Result
136 *******************************************************************************/
138 int64_t latitude; /* Latitude(WGS-84) 10^-7deg */
139 int64_t longitude; /* Longitude(WGS-84) 10^-7deg */
140 int64_t altitude; /* Altitude 10^-2m */
141 u_int16 rate; /* Speeds 10^-2m/sec */
142 u_int16 heading; /* Orientation North-reference clockwise 10^-2deg */
143 u_int16 reserve; /* RESERVE */
144 u_int8 dr_status; /* DR calculation status */
145 u_int8 positioning_time; /* Sensor Counter */
148 /*******************************************************************************
150 ABSTRACT : Estimated navigation information
152 *******************************************************************************/
154 u_int16 gyro_offset; /* Correction coefficient:Gyro offset */
155 u_int8 gyro_scale_factor; /* Correction coefficient:Gyro Sensitivity */
156 u_int8 gyro_scale_factor_level; /* Learning Level(Gyro Sensitivity) */
157 u_int16 speed_pulse_scale_factor; /* Correction coefficient:Vehicle speed factor */
158 u_int8 speed_pulse_scale_factor_level; /* Learning Level(Vehicle speed factor) */
159 u_int8 reserve; /* Reserve(1Byte) */
162 /*******************************************************************************
163 TAG : DR_POSITION_INFO
164 ABSTRACT : Location information
166 *******************************************************************************/
170 NAVI_MATCHING_DATA_AVAILABLE status;
173 /*******************************************************************************
175 ABSTRACT : Location information
177 *******************************************************************************/
181 NAVI_MATCHING_DATA_AVAILABLE status;
184 /*******************************************************************************
186 ABSTRACT : Location information
188 *******************************************************************************/
192 NAVI_MATCHING_DATA_AVAILABLE status;
195 /*******************************************************************************
196 TAG : NAVI_MATCHING_DATA
197 ABSTRACT : Map matching data
199 *******************************************************************************/
201 DR_POSITION_INFO position_info;
202 DR_RATE_INFO rate_info;
203 DR_ORIENT_INFO orient_info;
204 NAVI_MATCHING_STATUS status;
205 } NAVI_MATCHING_DATA;
207 /************************************************************************
208 * Function prototype *
209 ************************************************************************/
214 DR_RET_API DeadReckoningLibraryInit(void);
215 DR_RET_API SetGpsData(Struct_GpsData *st_gps_data);
216 DR_RET_API CalculateDeadReckoningData(Struct_SensData *st_sensor_data,
217 Struct_DR_DATA *st_dr_data, DR_CALC_INFO *dr_calc_data);
218 DR_RET_API SetMatchingData(NAVI_MATCHING_DATA *st_matching_data);
220 DR_RET_API ClearBackupData(void); /* Clear DR backup data */
221 /* BOOL Problem Avoidance */
222 DR_RET_API GetLocationLogSetting(int *log_sw, unsigned char *severity); /* Location log output ON/OFF acquisition */
223 DR_RET_API SetLocationLogStatus(int log_sw, unsigned char severity); /* Location log output ON/OFF setting */
229 #endif // POSITIONING_CLIENT_INCLUDE_DEAD_RECKONING_API_H_