From 2e8ad6fecb323915eeb74efa05cfd1647d6c6138 Mon Sep 17 00:00:00 2001 From: Aaron Xiao Date: Sat, 29 Jun 2019 07:52:18 -0700 Subject: [PATCH] Map: Simple code clean of map data checker. --- .../bridge/udp_bridge_receiver_component.cc | 2 +- .../map/tools/map_datachecker/client/BUILD | 59 ++++++------- modules/map/tools/map_datachecker/proto/BUILD | 3 +- .../proto/collection_error_code.proto | 2 +- .../map/tools/map_datachecker/server/BUILD | 85 +++++++++---------- .../map_datachecker/server/laps_checker.cc | 1 + modules/perception/camera/app/cipv_camera.cc | 4 +- 7 files changed, 74 insertions(+), 82 deletions(-) diff --git a/modules/bridge/udp_bridge_receiver_component.cc b/modules/bridge/udp_bridge_receiver_component.cc index 9c7e7f830c2..259ceaf8751 100644 --- a/modules/bridge/udp_bridge_receiver_component.cc +++ b/modules/bridge/udp_bridge_receiver_component.cc @@ -201,7 +201,7 @@ bool UDPBridgeReceiverComponent::RemoveInvalidBuf(uint32_t msg_id) { return false; } typename std::vector *>::iterator itor = - proto_list_.begin(); + proto_list_.begin(); for (; itor != proto_list_.end();) { if ((*itor)->GetMsgID() < msg_id) { BridgeProtoDiserializedBuf *tmp = *itor; diff --git a/modules/map/tools/map_datachecker/client/BUILD b/modules/map/tools/map_datachecker/client/BUILD index e59a7f4c08f..29fdfc87dd8 100644 --- a/modules/map/tools/map_datachecker/client/BUILD +++ b/modules/map/tools/map_datachecker/client/BUILD @@ -1,6 +1,5 @@ load("//tools:cpplint.bzl", "cpplint") - package(default_visibility = ["//visibility:public"]) cc_binary( @@ -15,36 +14,36 @@ cc_library( srcs = [ "main.cc", ], - deps = [ - ":client", - ":client_gflags", - ], linkopts = [ "-lboost_filesystem", "-lgrpc++", ], + deps = [ + ":client", + ":client_gflags", + ], ) cc_library( name = "client", srcs = [ - "client.cc" + "client.cc", ], hdrs = [ "client.h", "client_alignment.h", ], + linkopts = [ + "-lboost_filesystem", + "-lgrpc++", + ], deps = [ - ":client_gflags", ":client_channel_checker", ":client_common", + ":client_gflags", ":client_loops_check", + "//cyber", "@yaml_cpp//:yaml", - "//cyber:cyber", - ], - linkopts = [ - "-lboost_filesystem", - "-lgrpc++", ], ) @@ -56,18 +55,18 @@ cc_library( hdrs = [ "client_channel_checker.h", ], + linkopts = [ + "-lboost_filesystem", + "-lgrpc++", + ], deps = [ - ":client_gflags", ":client_common", + ":client_gflags", ":exception_handler", - "//cyber:cyber", + "//cyber", "//modules/map/tools/map_datachecker/proto:map_datachecker_grpc", "@yaml_cpp//:yaml", ], - linkopts = [ - "-lboost_filesystem", - "-lgrpc++", - ], ) cc_library( @@ -78,13 +77,13 @@ cc_library( hdrs = [ "client_common.h", ], - deps = [ - "//cyber:cyber", - ], linkopts = [ "-lboost_filesystem", "-lgrpc++", ], + deps = [ + "//cyber", + ], ) cc_library( @@ -98,9 +97,6 @@ cc_library( deps = [ "//external:gflags", ], - linkopts = [ - - ], ) cc_library( @@ -111,18 +107,18 @@ cc_library( hdrs = [ "client_loops_check.h", ], + linkopts = [ + "-lboost_filesystem", + "-lgrpc++", + ], deps = [ ":client_common", ":client_gflags", ":exception_handler", - "//cyber:cyber", + "//cyber", "//modules/map/tools/map_datachecker/proto:map_datachecker_grpc", "@yaml_cpp//:yaml", ], - linkopts = [ - "-lboost_filesystem", - "-lgrpc++", - ], ) cc_library( @@ -135,12 +131,9 @@ cc_library( ], deps = [ ":client_common", - "//cyber:cyber", + "//cyber", "//modules/map/tools/map_datachecker/proto:map_datachecker_proto", ], - linkopts = [ - - ], ) cpplint() diff --git a/modules/map/tools/map_datachecker/proto/BUILD b/modules/map/tools/map_datachecker/proto/BUILD index 57c1d3acbac..08627f9ecc5 100644 --- a/modules/map/tools/map_datachecker/proto/BUILD +++ b/modules/map/tools/map_datachecker/proto/BUILD @@ -1,5 +1,6 @@ load("//tools:cpplint.bzl", "cpplint") load("//tools:grpc_library.bzl", "cc_grpc_library") + package(default_visibility = ["//visibility:public"]) cc_proto_library( @@ -27,7 +28,7 @@ cc_grpc_library( ], deps = [ ":map_datachecker_proto_lib", - ] + ], ) cpplint() diff --git a/modules/map/tools/map_datachecker/proto/collection_error_code.proto b/modules/map/tools/map_datachecker/proto/collection_error_code.proto index 67f260cabba..fe5077b96d9 100644 --- a/modules/map/tools/map_datachecker/proto/collection_error_code.proto +++ b/modules/map/tools/map_datachecker/proto/collection_error_code.proto @@ -1,7 +1,7 @@ syntax = "proto2"; package apollo.hdmap; -enum ErrorCode +enum ErrorCode { // common: x SUCCESS = 0; diff --git a/modules/map/tools/map_datachecker/server/BUILD b/modules/map/tools/map_datachecker/server/BUILD index b8f4ad8689c..a2c8d592d73 100644 --- a/modules/map/tools/map_datachecker/server/BUILD +++ b/modules/map/tools/map_datachecker/server/BUILD @@ -1,6 +1,5 @@ load("//tools:cpplint.bzl", "cpplint") - package(default_visibility = ["//visibility:public"]) cc_binary( @@ -14,10 +13,10 @@ cc_library( name = "map_datachecker_server_lib", srcs = [ "main.cc", - ], + ], deps = [ ":worker", - "//cyber:cyber", + "//cyber", ], ) @@ -29,13 +28,13 @@ cc_library( hdrs = [ "channel_verify.h", ], + linkopts = [ + "-lboost_filesystem", + ], deps = [ ":common", + "//cyber", "//modules/map/tools/map_datachecker/proto:map_datachecker_proto", - "//cyber:cyber", - ], - linkopts = [ - "-lboost_filesystem", ], ) @@ -47,13 +46,13 @@ cc_library( hdrs = [ "channel_verify_agent.h", ], + linkopts = [ + "-lgrpc++", + ], deps = [ ":channel_verify", - "//modules/map/tools/map_datachecker/proto:map_datachecker_proto", "//modules/map/tools/map_datachecker/proto:map_datachecker_grpc", - ], - linkopts = [ - "-lgrpc++", + "//modules/map/tools/map_datachecker/proto:map_datachecker_proto", ], ) @@ -65,12 +64,12 @@ cc_library( hdrs = [ "common.h", ], - deps = [ - "//cyber:cyber", - ], linkopts = [ "-lboost_filesystem", ], + deps = [ + "//cyber", + ], ) cc_library( @@ -82,15 +81,15 @@ cc_library( "alignment.h", "eight_route.h", ], + linkopts = [ + "-lgrpc++", + ], deps = [ ":common", ":worker_gflags", - "//cyber:cyber", + "//cyber", "//modules/map/tools/map_datachecker/proto:map_datachecker_proto", ], - linkopts = [ - "-lgrpc++", - ], ) cc_library( @@ -101,13 +100,13 @@ cc_library( hdrs = [ "laps_checker.h", ], + linkopts = [ + "-lboost_filesystem", + ], deps = [ ":common", "//modules/map/tools/map_datachecker/proto:map_datachecker_proto", ], - linkopts = [ - "-lboost_filesystem", - ], ) cc_library( @@ -118,14 +117,14 @@ cc_library( hdrs = [ "loops_verify_agent.h", ], + linkopts = [ + "-lgrpc++", + ], deps = [ ":laps_checker", ":pose_collection_agent", "//modules/map/tools/map_datachecker/proto:map_datachecker_grpc", ], - linkopts = [ - "-lgrpc++", - ], ) cc_library( @@ -137,7 +136,7 @@ cc_library( "pj_transformer.h", ], deps = [ - "//cyber:cyber", + "//cyber", "@proj4", ], ) @@ -153,7 +152,7 @@ cc_library( deps = [ ":common", ":pj_transformer", - "//cyber:cyber", + "//cyber", "//modules/drivers/gnss/proto:gnss_proto", ], ) @@ -170,12 +169,9 @@ cc_library( ":common", ":pj_transformer", ":pose_collection", - "//cyber:cyber", + "//cyber", "//modules/drivers/gnss/proto:gnss_proto", ], - linkopts = [ - - ], ) cc_library( @@ -201,16 +197,16 @@ cc_library( hdrs = [ "worker.h", ], + linkopts = [ + "-lgrpc++", + ], deps = [ + ":eight_route", + ":static_align", ":worker_agent", ":worker_cyber_node", ":worker_gflags", - ":eight_route", - ":static_align", - "//cyber:cyber", - ], - linkopts = [ - "-lgrpc++", + "//cyber", ], ) @@ -223,18 +219,18 @@ cc_library( "alignment_agent.h", "worker_agent.h", ], + linkopts = [ + "-lgrpc++", + ], deps = [ ":channel_verify_agent", ":common", + ":eight_route", ":loops_verify_agent", ":pose_collection", - ":eight_route", ":static_align", - "//modules/map/tools/map_datachecker/proto:map_datachecker_proto", "//modules/map/tools/map_datachecker/proto:map_datachecker_grpc", - ], - linkopts = [ - "-lgrpc++", + "//modules/map/tools/map_datachecker/proto:map_datachecker_proto", ], ) @@ -247,12 +243,12 @@ cc_library( "worker_cyber_node.h", ], deps = [ - ":worker_gflags", ":worker_agent", - "//cyber:cyber", + ":worker_gflags", + "//cyber", "//modules/drivers/gnss/proto:gnss_proto", - "//modules/map/tools/map_datachecker/proto:map_datachecker_proto", "//modules/map/tools/map_datachecker/proto:map_datachecker_grpc", + "//modules/map/tools/map_datachecker/proto:map_datachecker_proto", ], ) @@ -268,4 +264,5 @@ cc_library( "//external:gflags", ], ) + cpplint() diff --git a/modules/map/tools/map_datachecker/server/laps_checker.cc b/modules/map/tools/map_datachecker/server/laps_checker.cc index cb6366dce8f..9495f3374f5 100644 --- a/modules/map/tools/map_datachecker/server/laps_checker.cc +++ b/modules/map/tools/map_datachecker/server/laps_checker.cc @@ -17,6 +17,7 @@ #include #include + #include #include #include diff --git a/modules/perception/camera/app/cipv_camera.cc b/modules/perception/camera/app/cipv_camera.cc index e4bd1bee7d1..ea033e5fe9b 100644 --- a/modules/perception/camera/app/cipv_camera.cc +++ b/modules/perception/camera/app/cipv_camera.cc @@ -684,8 +684,8 @@ bool Cipv::IsObjectInTheLaneGround(const std::shared_ptr &object, float shortest_distance = 0.0f; float distance = 0.0f; float max_dist_object_to_lane_in_meter = - b_virtual ? max_dist_object_to_virtual_lane_in_meter_ : - max_dist_object_to_lane_in_meter_; + b_virtual ? max_dist_object_to_virtual_lane_in_meter_ + : max_dist_object_to_lane_in_meter_; int closest_index = -1; // Find closest edge of a given object bounding box float b_valid_object = FindClosestObjectGround(