From 87568883a934ad7d290cc23953e0e44a158bff12 Mon Sep 17 00:00:00 2001 From: guanshoukui Date: Wed, 6 Mar 2024 15:51:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B5=8B=E8=AF=95proto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../protoc-plugin/example/CMakeLists.txt | 4 ++ .../protoc-plugin/example/chasis.proto | 16 ++++++ .../protoc-plugin/example/perception.proto | 51 +++++++++++++++++++ .../protoc-plugin/example/state.proto | 6 +-- 4 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 src/struct_pb/protoc-plugin/example/chasis.proto create mode 100644 src/struct_pb/protoc-plugin/example/perception.proto diff --git a/src/struct_pb/protoc-plugin/example/CMakeLists.txt b/src/struct_pb/protoc-plugin/example/CMakeLists.txt index 5e25c469b..59c348dae 100644 --- a/src/struct_pb/protoc-plugin/example/CMakeLists.txt +++ b/src/struct_pb/protoc-plugin/example/CMakeLists.txt @@ -17,6 +17,8 @@ if (Protobuf_FOUND) imu.proto gnss.proto state.proto + chasis.proto + perception.proto ) add_executable(struct_pb_tutorial tutorial.cpp ${PROTO_SRCS} @@ -34,6 +36,8 @@ if (Protobuf_FOUND) imu.proto gnss.proto state.proto + chasis.proto + perception.proto OPTION "namespace=inner_struct,converter_namespace=converter") endif() diff --git a/src/struct_pb/protoc-plugin/example/chasis.proto b/src/struct_pb/protoc-plugin/example/chasis.proto new file mode 100644 index 000000000..e96cf35ca --- /dev/null +++ b/src/struct_pb/protoc-plugin/example/chasis.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package inner_class; + +import "base.proto"; +import "proto_to_struct.proto"; + +message ZChassis +{ + ZFrame header = 1 [(inherits_from) = true]; + Point4D vel = 2; + Point4D spd_status = 3; + double steering_percentage = 4; + double brake_percentage = 5; + bool parking_brake = 6; + int32 gear_position_type = 7; +} \ No newline at end of file diff --git a/src/struct_pb/protoc-plugin/example/perception.proto b/src/struct_pb/protoc-plugin/example/perception.proto new file mode 100644 index 000000000..a4b1f0518 --- /dev/null +++ b/src/struct_pb/protoc-plugin/example/perception.proto @@ -0,0 +1,51 @@ +syntax = "proto3"; +package inner_class; + +import "base.proto"; +import "proto_to_struct.proto"; + +message ZPercBase +{ + int32 track_id = 1; + string id = 2; // 需要单帧独立 + float object_confidence = 3; + repeated Point3D points = 4; + repeated Point3D points_confidence = 5; +} + +message ZPercLine +{ + ZPercBase base = 1 [(inherits_from) = true]; + int32 ptype = 2; + int32 color = 3; + float c0 = 4; + float c1 = 5; + float c2 = 6; + float c3 = 7; + float begin_dist = 8; + float end_dist = 9; + int32 side_type = 10; +} + +message ZPercSign +{ + ZPercBase base = 1 [(inherits_from) = true]; + int32 ptype = 2; + float rect_width = 3; + float rect_height = 4; +} + +message ZPercPole +{ + ZPercBase base = 1 [(inherits_from) = true]; + int32 ptype = 2; +} + +message ZPerception +{ + ZFrame header = 1 [(inherits_from) = true]; + int32 ptype = 2; + repeated ZPercLine line = 3; + repeated ZPercSign sign = 4; + repeated ZPercPole pole = 5; +} diff --git a/src/struct_pb/protoc-plugin/example/state.proto b/src/struct_pb/protoc-plugin/example/state.proto index 2dc83075c..0614a5439 100644 --- a/src/struct_pb/protoc-plugin/example/state.proto +++ b/src/struct_pb/protoc-plugin/example/state.proto @@ -5,7 +5,7 @@ import "base.proto"; import "proto_to_struct.proto"; -message State{ +message ZState{ ZFrame header = 1 [(inherits_from) = true]; Point3D pos = 2;//位置: X Y Z Point3D pos_llh = 3; //位置:纬度 经度 高度 @@ -28,8 +28,8 @@ message AugmentationState{ Quaternion qua = 3; } -message ExtendState{ - State state = 1 [(inherits_from) = true]; +message ZExtendState{ + ZState state = 1 [(inherits_from) = true]; IntrinsicImuPara imu_in_para = 2; Point4D odo_in_para = 3; Matrix cov = 4;