forked from ApolloAuto/apollo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
map tools: data verification tool, commit build files and proto files (…
…ApolloAuto#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
- Loading branch information
Showing
15 changed files
with
707 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
load("//tools:cpplint.bzl", "cpplint") | ||
|
||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
cc_binary( | ||
name = "map_datachecker_client", | ||
deps = [ | ||
":map_datachecker_client_lib", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "map_datachecker_client_lib", | ||
srcs = [ | ||
"main.cc", | ||
], | ||
deps = [ | ||
":client", | ||
":client_gflags", | ||
], | ||
linkopts = [ | ||
"-lboost_filesystem", | ||
"-lgrpc++", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "client", | ||
srcs = [ | ||
"client.cc" | ||
], | ||
hdrs = [ | ||
"client.h", | ||
"client_alignment.h", | ||
], | ||
deps = [ | ||
":client_gflags", | ||
":client_channel_checker", | ||
":client_common", | ||
":client_loops_check", | ||
"@yaml_cpp//:yaml", | ||
"//cyber:cyber", | ||
], | ||
linkopts = [ | ||
"-lboost_filesystem", | ||
"-lgrpc++", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "client_channel_checker", | ||
srcs = [ | ||
"client_channel_checker.cc", | ||
], | ||
hdrs = [ | ||
"client_channel_checker.h", | ||
], | ||
deps = [ | ||
":client_gflags", | ||
":client_common", | ||
":exception_handler", | ||
"//cyber:cyber", | ||
"//modules/map/tools/map_datachecker/proto:map_datachecker_grpc", | ||
"@yaml_cpp//:yaml", | ||
], | ||
linkopts = [ | ||
"-lboost_filesystem", | ||
"-lgrpc++", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "client_common", | ||
srcs = [ | ||
"client_common.cc", | ||
], | ||
hdrs = [ | ||
"client_common.h", | ||
], | ||
deps = [ | ||
"//cyber:cyber", | ||
], | ||
linkopts = [ | ||
"-lboost_filesystem", | ||
"-lgrpc++", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "client_gflags", | ||
srcs = [ | ||
"client_gflags.cc", | ||
], | ||
hdrs = [ | ||
"client_gflags.h", | ||
], | ||
deps = [ | ||
"//external:gflags", | ||
], | ||
linkopts = [ | ||
|
||
], | ||
) | ||
|
||
cc_library( | ||
name = "client_loops_check", | ||
srcs = [ | ||
"client_loops_check.cc", | ||
], | ||
hdrs = [ | ||
"client_loops_check.h", | ||
], | ||
deps = [ | ||
":client_common", | ||
":client_gflags", | ||
":exception_handler", | ||
"//cyber:cyber", | ||
"//modules/map/tools/map_datachecker/proto:map_datachecker_grpc", | ||
"@yaml_cpp//:yaml", | ||
], | ||
linkopts = [ | ||
"-lboost_filesystem", | ||
"-lgrpc++", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "exception_handler", | ||
srcs = [ | ||
"exception_handler.cc", | ||
], | ||
hdrs = [ | ||
"exception_handler.h", | ||
], | ||
deps = [ | ||
":client_common", | ||
"//cyber:cyber", | ||
"//modules/map/tools/map_datachecker/proto:map_datachecker_proto", | ||
], | ||
linkopts = [ | ||
|
||
], | ||
) | ||
|
||
cpplint() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
load("//tools:cpplint.bzl", "cpplint") | ||
load("//tools:grpc_library.bzl", "cc_grpc_library") | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
cc_proto_library( | ||
name = "map_datachecker_proto", | ||
deps = [ | ||
":map_datachecker_proto_lib", | ||
], | ||
) | ||
|
||
proto_library( | ||
name = "map_datachecker_proto_lib", | ||
srcs = [ | ||
"collection_check_message.proto", | ||
"collection_error_code.proto", | ||
], | ||
) | ||
|
||
cc_grpc_library( | ||
name = "map_datachecker_grpc", | ||
srcs = [ | ||
"collection_service.proto", | ||
], | ||
deps_cc = [ | ||
":map_datachecker_proto", | ||
], | ||
deps = [ | ||
":map_datachecker_proto_lib", | ||
] | ||
) | ||
|
||
cpplint() |
97 changes: 97 additions & 0 deletions
97
modules/map/tools/map_datachecker/proto/collection_check_message.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
// Define Collection map-data check messages | ||
syntax = "proto2"; | ||
package apollo.hdmap; | ||
|
||
import "modules/map/tools/map_datachecker/proto/collection_error_code.proto"; | ||
|
||
enum CmdType { | ||
START = 1; | ||
CHECK = 2; | ||
STOP = 3; | ||
} | ||
|
||
enum DataType { | ||
MAP_MAKING = 1; | ||
MAP_CHECKOUT = 2; | ||
} | ||
|
||
message VerifyRange { | ||
optional double start_time = 1; // verify data's start timestamp | ||
optional double end_time = 2; // verify data's end timestamp | ||
} | ||
|
||
message LoopResult { | ||
required bool is_reached = 1; | ||
optional double loop_num = 2; // is_reached==false, indicate current laps | ||
} | ||
|
||
message TopicResult { | ||
repeated string topic_lack = 1; | ||
} | ||
|
||
message FrameRate { | ||
optional string topic = 1; | ||
optional double expected_rate = 2; | ||
optional double current_rate = 3; | ||
repeated string bad_record_name = 4; // record path file name, maybe more than one. | ||
} | ||
|
||
message VerifyResult { | ||
optional TopicResult topics = 1; | ||
repeated FrameRate rates = 2; | ||
} | ||
|
||
// ChannelVerify API, multi-service used | ||
message ChannelVerifyRequest { | ||
optional CmdType cmd = 1; | ||
optional string collect_id = 2; | ||
optional string path = 3; | ||
} | ||
|
||
message ChannelVerifyResponse { | ||
optional ErrorCode code = 1; | ||
optional VerifyResult result = 2; | ||
} | ||
|
||
// LoopsVerify API, multi-service used | ||
message LoopsVerifyRequest { | ||
optional CmdType cmd = 1; | ||
optional DataType type = 2; | ||
repeated VerifyRange range = 3; // used by map-worker. verify data's timestamp ranges, maybe has more than one. | ||
} | ||
|
||
message LoopsVerifyResponse { | ||
optional ErrorCode code = 1; | ||
optional double progress = 2; | ||
optional LoopResult loop_result = 3; // usable when progress==1 | ||
} | ||
|
||
// DynamicAlign API, multi-service used | ||
message DynamicAlignRequest { | ||
optional CmdType cmd = 1; | ||
} | ||
|
||
message DynamicAlignResponse { | ||
optional ErrorCode code = 1; | ||
optional double progress = 2; | ||
} | ||
|
||
// StaticAlign API, multi-service used | ||
message StaticAlignRequest { | ||
optional CmdType cmd = 1; | ||
} | ||
|
||
message StaticAlignResponse { | ||
optional ErrorCode code = 1; | ||
optional double progress = 2; | ||
} | ||
|
||
// EightRoute API, multi-service used | ||
message EightRouteRequest { | ||
optional CmdType cmd = 1; | ||
} | ||
|
||
message EightRouteResponse { | ||
optional ErrorCode code = 1; | ||
optional double progress = 2; | ||
} |
47 changes: 47 additions & 0 deletions
47
modules/map/tools/map_datachecker/proto/collection_error_code.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
syntax = "proto2"; | ||
package apollo.hdmap; | ||
|
||
enum ErrorCode | ||
{ | ||
// common: x | ||
SUCCESS = 0; | ||
ERROR = 1; | ||
ERROR_REQUEST = 2; // invalid request parameter | ||
ERROR_SERVICE_NO_RESPONSE = 3; // cybertron services no response | ||
ERROR_REPEATED_START = 4; | ||
ERROR_CHECK_BEFORE_START = 5; | ||
|
||
// APP fetch: 10x | ||
ERROR_GPSBIN_LACK = 101; // gpsbin in car is lack or not complete. | ||
ERROR_DISKINFO_ERROR = 102; | ||
ERROR_DISK_UNMOUNT = 103; | ||
|
||
ERROR_SPEED_LACK = 105; | ||
WARNING_ODOMETER_LACK = 106; | ||
ERROR_RTKSTATUS_EMPTY = 107; | ||
|
||
// map-datachecker: 20x | ||
ERROR_MAPGRPC_NOT_CONNECT = 201; | ||
|
||
// map-datachecher: dynamic_align: 21x | ||
WARNING_NOT_STRAIGHT = 212; // heading too large, need warning straight driving. | ||
WARNING_PROGRESS_ROLLBACK = 213; // progress rollback because turn a corner. | ||
|
||
// map-datachecher: eight_route: 22x | ||
ERROR_NOT_EIGHT_ROUTE = 221; // heading is not an eight route. | ||
|
||
// map-datachecher: data_verify: 23x | ||
ERROR_CHANNEL_VERIFY_TOPIC_LACK = 231; // some topic lack in channel_verify. | ||
ERROR_CHANNEL_VERIFY_RATES_ABNORMAL = 232; // some topic rates abnormal | ||
ERROR_VERIFY_NO_RECORDERS = 233; // data verify has/find no recorders in disks. | ||
ERROR_LOOPS_NOT_REACHED = 234; // loops is not enough 5/6 | ||
ERROR_VERIFY_NO_GNSSPOS = 235; // cybertron has no gnsspos callback. | ||
|
||
// map-datachecker: static_align: 24x | ||
ERROR_NOT_STATIC = 241; // car is not static. | ||
ERROR_GNSS_SIGNAL_FAIL = 242; // gnss signal is broken | fail | ||
|
||
// task handler: 30x | ||
SUCCESS_TASK_EMPTY = 301; // indicate this collect task has no recorders before | ||
SUCCESS_TASK_STOCK = 302; // indicate this collect task has collected some recorders already | ||
} |
17 changes: 17 additions & 0 deletions
17
modules/map/tools/map_datachecker/proto/collection_service.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
syntax = "proto2"; | ||
package apollo.hdmap; | ||
|
||
import "modules/map/tools/map_datachecker/proto/collection_check_message.proto"; | ||
// MAP | ||
service CollectionCheckerService { | ||
|
||
rpc ServiceDynamicAlign (DynamicAlignRequest) returns (DynamicAlignResponse) {} | ||
|
||
rpc ServiceStaticAlign (StaticAlignRequest) returns (StaticAlignResponse) {} | ||
|
||
rpc ServiceEightRoute (EightRouteRequest) returns (EightRouteResponse) {} | ||
|
||
rpc ServiceChannelVerify (ChannelVerifyRequest) returns (ChannelVerifyResponse) {} | ||
|
||
rpc ServiceLoopsVerify (LoopsVerifyRequest) returns (LoopsVerifyResponse) {} | ||
} |
Oops, something went wrong.