Skip to content

Commit

Permalink
增加测试proto
Browse files Browse the repository at this point in the history
  • Loading branch information
guanshoukui committed Mar 6, 2024
1 parent 6f83d8b commit 8756888
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/struct_pb/protoc-plugin/example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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()
16 changes: 16 additions & 0 deletions src/struct_pb/protoc-plugin/example/chasis.proto
Original file line number Diff line number Diff line change
@@ -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;
}
51 changes: 51 additions & 0 deletions src/struct_pb/protoc-plugin/example/perception.proto
Original file line number Diff line number Diff line change
@@ -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;
}
6 changes: 3 additions & 3 deletions src/struct_pb/protoc-plugin/example/state.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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; //位置:纬度 经度 高度
Expand All @@ -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;
Expand Down

0 comments on commit 8756888

Please sign in to comment.