Apollo 11.0
自动驾驶开放平台
exception_handler.cc
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2019 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 *****************************************************************************/
17
18#include "cyber/cyber.h"
20#include "modules/map/tools/map_datachecker/proto/collection_error_code.pb.h"
21
22namespace apollo {
23namespace hdmap {
24
26 int ret = 0;
27 switch (error_code) {
29 AINFO << "ErrorCode::SUCCESS";
30 fprintf(USER_STREAM, "SUCCESS\n");
31 break;
33 AINFO << "ErrorCode::ERROR_CHECK_BEFORE_START";
34 fprintf(USER_STREAM,
35 "Do not start repeated. This request will be ignored\n");
36 break;
38 AINFO << "ErrorCode::ERROR_CHECK_BEFORE_START";
39 fprintf(USER_STREAM,
40 "Start command should be called before check. This request will "
41 "be ignored\n");
42 break;
44 AINFO << "ErrorCode::ERROR_REQUEST";
45 fprintf(USER_STREAM, "Request error. This request will be ignored\n");
46 break;
48 AINFO << "ErrorCode::ERROR_GNSS_SIGNAL_FAIL."
49 << "Please check if area is spacious";
50 fprintf(USER_STREAM,
51 "ERROR: GNSS signal do not meet the requirements, please make "
52 "sure area is spacious\n");
53 ret = -1;
54 break;
56 AINFO << "ErrorCode::ERROR_VERIFY_NO_GNSSPOS."
57 << "Please check if channel /apollo/sensor/gnss/best_pose exists "
58 "in system";
59 fprintf(USER_STREAM,
60 "ERROR:System has no channel /apollo/sensor/gnss/best_pose, you "
61 "may need to reboot system\n");
62 ret = -1;
63 break;
65 AINFO << "ErrorCode::ERROR_NOT_STATIC. Please keep the car still";
66 fprintf(USER_STREAM, "ERROR:Please keep the car still\n");
67 ret = -1;
68 break;
70 AINFO << "ErrorCode::ERROR_NOT_EIGHT_ROUTE. "
71 << "Please keep the car 8-like maneuver";
72 fprintf(USER_STREAM, "WARNING:Please keep the car 8-like maneuver\n");
73 break;
75 AINFO << "ErrorCode.ERROR_LOOPS_NOT_REACHED";
76 fprintf(USER_STREAM,
77 "WARNING:Collection time do not meet the requirements. "
78 "Supplementary data collection may be required\n");
79 ret = -1;
80 break;
82 AINFO << "ErrorCode.ERROR_CHANNEL_VERIFY_TOPIC_LACK";
83 fprintf(USER_STREAM, "ERROR: Missing topic\n");
84 ret = -1;
85 break;
87 AINFO << "ErrorCode.ERROR_CHANNEL_VERIFY_RATES_ABNORMAL";
88 fprintf(USER_STREAM, "ERROR: Missing topic\n");
89 ret = -1;
90 break;
92 AINFO << "ErrorCode.ERROR_VERIFY_NO_RECORDERS";
93 fprintf(USER_STREAM, "ERROR: Missing record\n");
94 ret = -1;
95 break;
96 default:
97 AINFO << "This branch should never be reached. If this happened, please "
98 "open an issue. code: "
99 << error_code;
100 fprintf(USER_STREAM,
101 "ERROR:This branch should never be reached. If this happened, "
102 "please open an issue\n");
103 break;
104 }
105 return ret;
106}
107
108} // namespace hdmap
109} // namespace apollo
static int ExceptionHandlerFun(ErrorCode error_code)
#define USER_STREAM
#define AINFO
Definition log.h:42
class register implement
Definition arena_queue.h:37