syntax = "proto2";

package roadwork;

message RW_PB {
	required Roadwork_PB roadwork =1;
	optional Header header = 2;
}

message Roadwork_PB{
	optional string id = 1; // 对应id
	required int32 score = 2; // 置信度
	required int64 detect_time = 3; // 发送时间
	required int32 poi_type = 4; // poi 类型
	optional int32 type = 5;  // 事件类型
	required Center_PB center = 6; // 中心点坐标
	repeated GPSPoint_PB polygon = 7; // 多边形范围
	repeated Road_PB road = 8; // 车道集合信息
}

message GPSPoint_PB {
	required double lat = 1; // 纬度
	required double lon = 2; // 经度
	optional double hgt = 3; // 高程
}

message Road_PB{
	required string road_id = 1; // 路段id
	required string lane_no = 2; // 车道号
	required string tile_id = 3; // 瓦片id
	required int32 bearing = 4;  // 方向角，正北是0度 顺时针
}

message Center_PB{
	required Road_PB road = 1;  // 道路信息
	required GPSPoint_PB point = 2; // 坐标
}

// header

message Time {
	optional uint32 sec = 1; // 秒
	optional uint32 nsec = 2; // 纳秒
}

message Header {
	// Sequence number for each message. Each module maintains its own counter for
	// sequence_num, always starting from 1 on boot.
	optional uint32 seq = 1;

	// Message publishing time in seconds.
	optional Time stamp = 2;

	// frame id
	optional string frame_id = 3;

	// Module name.
	optional string module_name = 4;
}
