Skip to content

Commit e67dd11

Browse files
ooooooopsxiaoxq
authored andcommitted
map tools: data verification tool, commit build files and proto files (#9038)
* first ten files fixed * first ten files fixed * first ten files fixed * build files&&proto files * build files&&proto files * fix BUILD files' problems * trigger this file to be linted * trigger this file to be linted
1 parent cdd2c77 commit e67dd11

15 files changed

+707
-90
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
load("//tools:cpplint.bzl", "cpplint")
2+
3+
4+
package(default_visibility = ["//visibility:public"])
5+
6+
cc_binary(
7+
name = "map_datachecker_client",
8+
deps = [
9+
":map_datachecker_client_lib",
10+
],
11+
)
12+
13+
cc_library(
14+
name = "map_datachecker_client_lib",
15+
srcs = [
16+
"main.cc",
17+
],
18+
deps = [
19+
":client",
20+
":client_gflags",
21+
],
22+
linkopts = [
23+
"-lboost_filesystem",
24+
"-lgrpc++",
25+
],
26+
)
27+
28+
cc_library(
29+
name = "client",
30+
srcs = [
31+
"client.cc"
32+
],
33+
hdrs = [
34+
"client.h",
35+
"client_alignment.h",
36+
],
37+
deps = [
38+
":client_gflags",
39+
":client_channel_checker",
40+
":client_common",
41+
":client_loops_check",
42+
"@yaml_cpp//:yaml",
43+
"//cyber:cyber",
44+
],
45+
linkopts = [
46+
"-lboost_filesystem",
47+
"-lgrpc++",
48+
],
49+
)
50+
51+
cc_library(
52+
name = "client_channel_checker",
53+
srcs = [
54+
"client_channel_checker.cc",
55+
],
56+
hdrs = [
57+
"client_channel_checker.h",
58+
],
59+
deps = [
60+
":client_gflags",
61+
":client_common",
62+
":exception_handler",
63+
"//cyber:cyber",
64+
"//modules/map/tools/map_datachecker/proto:map_datachecker_grpc",
65+
"@yaml_cpp//:yaml",
66+
],
67+
linkopts = [
68+
"-lboost_filesystem",
69+
"-lgrpc++",
70+
],
71+
)
72+
73+
cc_library(
74+
name = "client_common",
75+
srcs = [
76+
"client_common.cc",
77+
],
78+
hdrs = [
79+
"client_common.h",
80+
],
81+
deps = [
82+
"//cyber:cyber",
83+
],
84+
linkopts = [
85+
"-lboost_filesystem",
86+
"-lgrpc++",
87+
],
88+
)
89+
90+
cc_library(
91+
name = "client_gflags",
92+
srcs = [
93+
"client_gflags.cc",
94+
],
95+
hdrs = [
96+
"client_gflags.h",
97+
],
98+
deps = [
99+
"//external:gflags",
100+
],
101+
linkopts = [
102+
103+
],
104+
)
105+
106+
cc_library(
107+
name = "client_loops_check",
108+
srcs = [
109+
"client_loops_check.cc",
110+
],
111+
hdrs = [
112+
"client_loops_check.h",
113+
],
114+
deps = [
115+
":client_common",
116+
":client_gflags",
117+
":exception_handler",
118+
"//cyber:cyber",
119+
"//modules/map/tools/map_datachecker/proto:map_datachecker_grpc",
120+
"@yaml_cpp//:yaml",
121+
],
122+
linkopts = [
123+
"-lboost_filesystem",
124+
"-lgrpc++",
125+
],
126+
)
127+
128+
cc_library(
129+
name = "exception_handler",
130+
srcs = [
131+
"exception_handler.cc",
132+
],
133+
hdrs = [
134+
"exception_handler.h",
135+
],
136+
deps = [
137+
":client_common",
138+
"//cyber:cyber",
139+
"//modules/map/tools/map_datachecker/proto:map_datachecker_proto",
140+
],
141+
linkopts = [
142+
143+
],
144+
)
145+
146+
cpplint()

modules/map/tools/map_datachecker/client/client_common.cc

-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
#include <string>
2222
#include <vector>
2323

24-
#include "modules/map/tools/map_datachecker/client/exception_handler.h"
25-
2624
namespace apollo {
2725
namespace hdmap {
2826
std::vector<std::string> GetFileLines(const std::string& path) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
load("//tools:cpplint.bzl", "cpplint")
2+
load("//tools:grpc_library.bzl", "cc_grpc_library")
3+
package(default_visibility = ["//visibility:public"])
4+
5+
cc_proto_library(
6+
name = "map_datachecker_proto",
7+
deps = [
8+
":map_datachecker_proto_lib",
9+
],
10+
)
11+
12+
proto_library(
13+
name = "map_datachecker_proto_lib",
14+
srcs = [
15+
"collection_check_message.proto",
16+
"collection_error_code.proto",
17+
],
18+
)
19+
20+
cc_grpc_library(
21+
name = "map_datachecker_grpc",
22+
srcs = [
23+
"collection_service.proto",
24+
],
25+
deps_cc = [
26+
":map_datachecker_proto",
27+
],
28+
deps = [
29+
":map_datachecker_proto_lib",
30+
]
31+
)
32+
33+
cpplint()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
// Define Collection map-data check messages
2+
syntax = "proto2";
3+
package apollo.hdmap;
4+
5+
import "modules/map/tools/map_datachecker/proto/collection_error_code.proto";
6+
7+
enum CmdType {
8+
START = 1;
9+
CHECK = 2;
10+
STOP = 3;
11+
}
12+
13+
enum DataType {
14+
MAP_MAKING = 1;
15+
MAP_CHECKOUT = 2;
16+
}
17+
18+
message VerifyRange {
19+
optional double start_time = 1; // verify data's start timestamp
20+
optional double end_time = 2; // verify data's end timestamp
21+
}
22+
23+
message LoopResult {
24+
required bool is_reached = 1;
25+
optional double loop_num = 2; // is_reached==false, indicate current laps
26+
}
27+
28+
message TopicResult {
29+
repeated string topic_lack = 1;
30+
}
31+
32+
message FrameRate {
33+
optional string topic = 1;
34+
optional double expected_rate = 2;
35+
optional double current_rate = 3;
36+
repeated string bad_record_name = 4; // record path file name, maybe more than one.
37+
}
38+
39+
message VerifyResult {
40+
optional TopicResult topics = 1;
41+
repeated FrameRate rates = 2;
42+
}
43+
44+
// ChannelVerify API, multi-service used
45+
message ChannelVerifyRequest {
46+
optional CmdType cmd = 1;
47+
optional string collect_id = 2;
48+
optional string path = 3;
49+
}
50+
51+
message ChannelVerifyResponse {
52+
optional ErrorCode code = 1;
53+
optional VerifyResult result = 2;
54+
}
55+
56+
// LoopsVerify API, multi-service used
57+
message LoopsVerifyRequest {
58+
optional CmdType cmd = 1;
59+
optional DataType type = 2;
60+
repeated VerifyRange range = 3; // used by map-worker. verify data's timestamp ranges, maybe has more than one.
61+
}
62+
63+
message LoopsVerifyResponse {
64+
optional ErrorCode code = 1;
65+
optional double progress = 2;
66+
optional LoopResult loop_result = 3; // usable when progress==1
67+
}
68+
69+
// DynamicAlign API, multi-service used
70+
message DynamicAlignRequest {
71+
optional CmdType cmd = 1;
72+
}
73+
74+
message DynamicAlignResponse {
75+
optional ErrorCode code = 1;
76+
optional double progress = 2;
77+
}
78+
79+
// StaticAlign API, multi-service used
80+
message StaticAlignRequest {
81+
optional CmdType cmd = 1;
82+
}
83+
84+
message StaticAlignResponse {
85+
optional ErrorCode code = 1;
86+
optional double progress = 2;
87+
}
88+
89+
// EightRoute API, multi-service used
90+
message EightRouteRequest {
91+
optional CmdType cmd = 1;
92+
}
93+
94+
message EightRouteResponse {
95+
optional ErrorCode code = 1;
96+
optional double progress = 2;
97+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
syntax = "proto2";
2+
package apollo.hdmap;
3+
4+
enum ErrorCode
5+
{
6+
// common: x
7+
SUCCESS = 0;
8+
ERROR = 1;
9+
ERROR_REQUEST = 2; // invalid request parameter
10+
ERROR_SERVICE_NO_RESPONSE = 3; // cybertron services no response
11+
ERROR_REPEATED_START = 4;
12+
ERROR_CHECK_BEFORE_START = 5;
13+
14+
// APP fetch: 10x
15+
ERROR_GPSBIN_LACK = 101; // gpsbin in car is lack or not complete.
16+
ERROR_DISKINFO_ERROR = 102;
17+
ERROR_DISK_UNMOUNT = 103;
18+
19+
ERROR_SPEED_LACK = 105;
20+
WARNING_ODOMETER_LACK = 106;
21+
ERROR_RTKSTATUS_EMPTY = 107;
22+
23+
// map-datachecker: 20x
24+
ERROR_MAPGRPC_NOT_CONNECT = 201;
25+
26+
// map-datachecher: dynamic_align: 21x
27+
WARNING_NOT_STRAIGHT = 212; // heading too large, need warning straight driving.
28+
WARNING_PROGRESS_ROLLBACK = 213; // progress rollback because turn a corner.
29+
30+
// map-datachecher: eight_route: 22x
31+
ERROR_NOT_EIGHT_ROUTE = 221; // heading is not an eight route.
32+
33+
// map-datachecher: data_verify: 23x
34+
ERROR_CHANNEL_VERIFY_TOPIC_LACK = 231; // some topic lack in channel_verify.
35+
ERROR_CHANNEL_VERIFY_RATES_ABNORMAL = 232; // some topic rates abnormal
36+
ERROR_VERIFY_NO_RECORDERS = 233; // data verify has/find no recorders in disks.
37+
ERROR_LOOPS_NOT_REACHED = 234; // loops is not enough 5/6
38+
ERROR_VERIFY_NO_GNSSPOS = 235; // cybertron has no gnsspos callback.
39+
40+
// map-datachecker: static_align: 24x
41+
ERROR_NOT_STATIC = 241; // car is not static.
42+
ERROR_GNSS_SIGNAL_FAIL = 242; // gnss signal is broken | fail
43+
44+
// task handler: 30x
45+
SUCCESS_TASK_EMPTY = 301; // indicate this collect task has no recorders before
46+
SUCCESS_TASK_STOCK = 302; // indicate this collect task has collected some recorders already
47+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
syntax = "proto2";
2+
package apollo.hdmap;
3+
4+
import "modules/map/tools/map_datachecker/proto/collection_check_message.proto";
5+
// MAP
6+
service CollectionCheckerService {
7+
8+
rpc ServiceDynamicAlign (DynamicAlignRequest) returns (DynamicAlignResponse) {}
9+
10+
rpc ServiceStaticAlign (StaticAlignRequest) returns (StaticAlignResponse) {}
11+
12+
rpc ServiceEightRoute (EightRouteRequest) returns (EightRouteResponse) {}
13+
14+
rpc ServiceChannelVerify (ChannelVerifyRequest) returns (ChannelVerifyResponse) {}
15+
16+
rpc ServiceLoopsVerify (LoopsVerifyRequest) returns (LoopsVerifyResponse) {}
17+
}

0 commit comments

Comments
 (0)