From 7eef659548287ef60ed60c649430bc7343627e5d Mon Sep 17 00:00:00 2001 From: Cyrille Nofficial Date: Tue, 23 Jan 2024 23:35:28 +0100 Subject: [PATCH] feat(disparity): add disparity in record message --- events/events.proto | 1 + go/events/events.pb.go | 27 ++++++++++++++++++++------- python/events/events_pb2.py | 16 ++++++++-------- python/events/events_pb2.pyi | 13 ++++++++++--- 4 files changed, 39 insertions(+), 18 deletions(-) diff --git a/events/events.proto b/events/events.proto index 507cd0d..7c09990 100644 --- a/events/events.proto +++ b/events/events.proto @@ -112,5 +112,6 @@ message RecordMessage { SteeringMessage steering = 2; SteeringMessage autopilot_steering = 4; DriveModeMessage drive_mode = 5; + DisparityMessage disparity = 6; string recordSet = 3; // Record set name } diff --git a/go/events/events.pb.go b/go/events/events.pb.go index db2276a..8cb67e8 100644 --- a/go/events/events.pb.go +++ b/go/events/events.pb.go @@ -1009,6 +1009,7 @@ type RecordMessage struct { Steering *SteeringMessage `protobuf:"bytes,2,opt,name=steering,proto3" json:"steering,omitempty"` AutopilotSteering *SteeringMessage `protobuf:"bytes,4,opt,name=autopilot_steering,json=autopilotSteering,proto3" json:"autopilot_steering,omitempty"` DriveMode *DriveModeMessage `protobuf:"bytes,5,opt,name=drive_mode,json=driveMode,proto3" json:"drive_mode,omitempty"` + Disparity *DisparityMessage `protobuf:"bytes,6,opt,name=disparity,proto3" json:"disparity,omitempty"` RecordSet string `protobuf:"bytes,3,opt,name=recordSet,proto3" json:"recordSet,omitempty"` // Record set name } @@ -1072,6 +1073,13 @@ func (x *RecordMessage) GetDriveMode() *DriveModeMessage { return nil } +func (x *RecordMessage) GetDisparity() *DisparityMessage { + if x != nil { + return x.Disparity + } + return nil +} + func (x *RecordMessage) GetRecordSet() string { if x != nil { return x.RecordSet @@ -1189,7 +1197,7 @@ var file_events_events_proto_rawDesc = []byte{ 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6e, 0x67, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x61, 0x6e, 0x67, 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x22, 0xaf, 0x02, 0x0a, 0x0d, 0x52, 0x65, 0x63, 0x6f, 0x72, + 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x22, 0xef, 0x02, 0x0a, 0x0d, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x72, 0x6f, 0x62, 0x6f, 0x63, 0x61, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x4d, 0x65, @@ -1206,7 +1214,11 @@ var file_events_events_proto_rawDesc = []byte{ 0x76, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x72, 0x6f, 0x62, 0x6f, 0x63, 0x61, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, - 0x09, 0x64, 0x72, 0x69, 0x76, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, + 0x09, 0x64, 0x72, 0x69, 0x76, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x3e, 0x0a, 0x09, 0x64, 0x69, + 0x73, 0x70, 0x61, 0x72, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, + 0x72, 0x6f, 0x62, 0x6f, 0x63, 0x61, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x44, + 0x69, 0x73, 0x70, 0x61, 0x72, 0x69, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, + 0x09, 0x64, 0x69, 0x73, 0x70, 0x61, 0x72, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x53, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x53, 0x65, 0x74, 0x2a, 0x38, 0x0a, 0x09, 0x53, 0x70, 0x65, 0x65, 0x64, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, @@ -1277,11 +1289,12 @@ var file_events_events_proto_depIdxs = []int32{ 6, // 16: robocar.events.RecordMessage.steering:type_name -> robocar.events.SteeringMessage 6, // 17: robocar.events.RecordMessage.autopilot_steering:type_name -> robocar.events.SteeringMessage 9, // 18: robocar.events.RecordMessage.drive_mode:type_name -> robocar.events.DriveModeMessage - 19, // [19:19] is the sub-list for method output_type - 19, // [19:19] is the sub-list for method input_type - 19, // [19:19] is the sub-list for extension type_name - 19, // [19:19] is the sub-list for extension extendee - 0, // [0:19] is the sub-list for field type_name + 5, // 19: robocar.events.RecordMessage.disparity:type_name -> robocar.events.DisparityMessage + 20, // [20:20] is the sub-list for method output_type + 20, // [20:20] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_events_events_proto_init() } diff --git a/python/events/events_pb2.py b/python/events/events_pb2.py index 9486680..1bceeb1 100644 --- a/python/events/events_pb2.py +++ b/python/events/events_pb2.py @@ -14,7 +14,7 @@ _sym_db = _symbol_database.Default() from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13\x65vents/events.proto\x12\x0erobocar.events\x1a\x1fgoogle/protobuf/timestamp.proto\"T\n\x08\x46rameRef\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12.\n\ncreated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"C\n\x0c\x46rameMessage\x12$\n\x02id\x18\x01 \x01(\x0b\x32\x18.robocar.events.FrameRef\x12\r\n\x05\x66rame\x18\x02 \x01(\x0c\"\x8a\x01\n\x10\x44isparityMessage\x12+\n\tframe_ref\x18\x01 \x01(\x0b\x32\x18.robocar.events.FrameRef\x12\x11\n\tdisparity\x18\x02 \x01(\x0c\x12\x1e\n\x16\x66ocal_length_in_pixels\x18\x03 \x01(\x01\x12\x16\n\x0e\x62\x61seline_in_mm\x18\x04 \x01(\x01\"d\n\x0fSteeringMessage\x12\x10\n\x08steering\x18\x01 \x01(\x02\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12+\n\tframe_ref\x18\x03 \x01(\x0b\x32\x18.robocar.events.FrameRef\"d\n\x0fThrottleMessage\x12\x10\n\x08throttle\x18\x01 \x01(\x02\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12+\n\tframe_ref\x18\x03 \x01(\x0b\x32\x18.robocar.events.FrameRef\"\x82\x01\n\x10SpeedZoneMessage\x12-\n\nspeed_zone\x18\x01 \x01(\x0e\x32\x19.robocar.events.SpeedZone\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12+\n\tframe_ref\x18\x03 \x01(\x0b\x32\x18.robocar.events.FrameRef\"A\n\x10\x44riveModeMessage\x12-\n\ndrive_mode\x18\x01 \x01(\x0e\x32\x19.robocar.events.DriveMode\"f\n\x0eObjectsMessage\x12\'\n\x07objects\x18\x01 \x03(\x0b\x32\x16.robocar.events.Object\x12+\n\tframe_ref\x18\x02 \x01(\x0b\x32\x18.robocar.events.FrameRef\"\x96\x01\n\x06Object\x12(\n\x04type\x18\x01 \x01(\x0e\x32\x1a.robocar.events.TypeObject\x12\x0c\n\x04left\x18\x02 \x01(\x02\x12\x0b\n\x03top\x18\x03 \x01(\x02\x12\r\n\x05right\x18\x04 \x01(\x02\x12\x0e\n\x06\x62ottom\x18\x05 \x01(\x02\x12\x12\n\nconfidence\x18\x06 \x01(\x02\x12\x14\n\x0c\x64istanceInMm\x18\x07 \x01(\x03\"&\n\x13SwitchRecordMessage\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\"\x8c\x01\n\x0bRoadMessage\x12&\n\x07\x63ontour\x18\x01 \x03(\x0b\x32\x15.robocar.events.Point\x12(\n\x07\x65llipse\x18\x02 \x01(\x0b\x32\x17.robocar.events.Ellipse\x12+\n\tframe_ref\x18\x03 \x01(\x0b\x32\x18.robocar.events.FrameRef\"\x1d\n\x05Point\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\"r\n\x07\x45llipse\x12%\n\x06\x63\x65nter\x18\x01 \x01(\x0b\x32\x15.robocar.events.Point\x12\r\n\x05width\x18\x02 \x01(\x05\x12\x0e\n\x06height\x18\x03 \x01(\x05\x12\r\n\x05\x61ngle\x18\x04 \x01(\x02\x12\x12\n\nconfidence\x18\x05 \x01(\x02\"\xf5\x01\n\rRecordMessage\x12+\n\x05\x66rame\x18\x01 \x01(\x0b\x32\x1c.robocar.events.FrameMessage\x12\x31\n\x08steering\x18\x02 \x01(\x0b\x32\x1f.robocar.events.SteeringMessage\x12;\n\x12\x61utopilot_steering\x18\x04 \x01(\x0b\x32\x1f.robocar.events.SteeringMessage\x12\x34\n\ndrive_mode\x18\x05 \x01(\x0b\x32 .robocar.events.DriveModeMessage\x12\x11\n\trecordSet\x18\x03 \x01(\t*8\n\tSpeedZone\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x08\n\x04SLOW\x10\x01\x12\n\n\x06NORMAL\x10\x02\x12\x08\n\x04\x46\x41ST\x10\x03*:\n\tDriveMode\x12\x0b\n\x07INVALID\x10\x00\x12\x08\n\x04USER\x10\x01\x12\t\n\x05PILOT\x10\x02\x12\x0b\n\x07\x43OPILOT\x10\x03*2\n\nTypeObject\x12\x07\n\x03\x41NY\x10\x00\x12\x07\n\x03\x43\x41R\x10\x01\x12\x08\n\x04\x42UMP\x10\x02\x12\x08\n\x04PLOT\x10\x03\x42\nZ\x08./eventsb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13\x65vents/events.proto\x12\x0erobocar.events\x1a\x1fgoogle/protobuf/timestamp.proto\"T\n\x08\x46rameRef\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12.\n\ncreated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"C\n\x0c\x46rameMessage\x12$\n\x02id\x18\x01 \x01(\x0b\x32\x18.robocar.events.FrameRef\x12\r\n\x05\x66rame\x18\x02 \x01(\x0c\"\x8a\x01\n\x10\x44isparityMessage\x12+\n\tframe_ref\x18\x01 \x01(\x0b\x32\x18.robocar.events.FrameRef\x12\x11\n\tdisparity\x18\x02 \x01(\x0c\x12\x1e\n\x16\x66ocal_length_in_pixels\x18\x03 \x01(\x01\x12\x16\n\x0e\x62\x61seline_in_mm\x18\x04 \x01(\x01\"d\n\x0fSteeringMessage\x12\x10\n\x08steering\x18\x01 \x01(\x02\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12+\n\tframe_ref\x18\x03 \x01(\x0b\x32\x18.robocar.events.FrameRef\"d\n\x0fThrottleMessage\x12\x10\n\x08throttle\x18\x01 \x01(\x02\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12+\n\tframe_ref\x18\x03 \x01(\x0b\x32\x18.robocar.events.FrameRef\"\x82\x01\n\x10SpeedZoneMessage\x12-\n\nspeed_zone\x18\x01 \x01(\x0e\x32\x19.robocar.events.SpeedZone\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12+\n\tframe_ref\x18\x03 \x01(\x0b\x32\x18.robocar.events.FrameRef\"A\n\x10\x44riveModeMessage\x12-\n\ndrive_mode\x18\x01 \x01(\x0e\x32\x19.robocar.events.DriveMode\"f\n\x0eObjectsMessage\x12\'\n\x07objects\x18\x01 \x03(\x0b\x32\x16.robocar.events.Object\x12+\n\tframe_ref\x18\x02 \x01(\x0b\x32\x18.robocar.events.FrameRef\"\x96\x01\n\x06Object\x12(\n\x04type\x18\x01 \x01(\x0e\x32\x1a.robocar.events.TypeObject\x12\x0c\n\x04left\x18\x02 \x01(\x02\x12\x0b\n\x03top\x18\x03 \x01(\x02\x12\r\n\x05right\x18\x04 \x01(\x02\x12\x0e\n\x06\x62ottom\x18\x05 \x01(\x02\x12\x12\n\nconfidence\x18\x06 \x01(\x02\x12\x14\n\x0c\x64istanceInMm\x18\x07 \x01(\x03\"&\n\x13SwitchRecordMessage\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\"\x8c\x01\n\x0bRoadMessage\x12&\n\x07\x63ontour\x18\x01 \x03(\x0b\x32\x15.robocar.events.Point\x12(\n\x07\x65llipse\x18\x02 \x01(\x0b\x32\x17.robocar.events.Ellipse\x12+\n\tframe_ref\x18\x03 \x01(\x0b\x32\x18.robocar.events.FrameRef\"\x1d\n\x05Point\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\"r\n\x07\x45llipse\x12%\n\x06\x63\x65nter\x18\x01 \x01(\x0b\x32\x15.robocar.events.Point\x12\r\n\x05width\x18\x02 \x01(\x05\x12\x0e\n\x06height\x18\x03 \x01(\x05\x12\r\n\x05\x61ngle\x18\x04 \x01(\x02\x12\x12\n\nconfidence\x18\x05 \x01(\x02\"\xaa\x02\n\rRecordMessage\x12+\n\x05\x66rame\x18\x01 \x01(\x0b\x32\x1c.robocar.events.FrameMessage\x12\x31\n\x08steering\x18\x02 \x01(\x0b\x32\x1f.robocar.events.SteeringMessage\x12;\n\x12\x61utopilot_steering\x18\x04 \x01(\x0b\x32\x1f.robocar.events.SteeringMessage\x12\x34\n\ndrive_mode\x18\x05 \x01(\x0b\x32 .robocar.events.DriveModeMessage\x12\x33\n\tdisparity\x18\x06 \x01(\x0b\x32 .robocar.events.DisparityMessage\x12\x11\n\trecordSet\x18\x03 \x01(\t*8\n\tSpeedZone\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x08\n\x04SLOW\x10\x01\x12\n\n\x06NORMAL\x10\x02\x12\x08\n\x04\x46\x41ST\x10\x03*:\n\tDriveMode\x12\x0b\n\x07INVALID\x10\x00\x12\x08\n\x04USER\x10\x01\x12\t\n\x05PILOT\x10\x02\x12\x0b\n\x07\x43OPILOT\x10\x03*2\n\nTypeObject\x12\x07\n\x03\x41NY\x10\x00\x12\x07\n\x03\x43\x41R\x10\x01\x12\x08\n\x04\x42UMP\x10\x02\x12\x08\n\x04PLOT\x10\x03\x42\nZ\x08./eventsb\x06proto3') _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'events.events_pb2', globals()) @@ -22,12 +22,12 @@ if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'Z\010./events' - _SPEEDZONE._serialized_start=1607 - _SPEEDZONE._serialized_end=1663 - _DRIVEMODE._serialized_start=1665 - _DRIVEMODE._serialized_end=1723 - _TYPEOBJECT._serialized_start=1725 - _TYPEOBJECT._serialized_end=1775 + _SPEEDZONE._serialized_start=1660 + _SPEEDZONE._serialized_end=1716 + _DRIVEMODE._serialized_start=1718 + _DRIVEMODE._serialized_end=1776 + _TYPEOBJECT._serialized_start=1778 + _TYPEOBJECT._serialized_end=1828 _FRAMEREF._serialized_start=72 _FRAMEREF._serialized_end=156 _FRAMEMESSAGE._serialized_start=158 @@ -55,5 +55,5 @@ if _descriptor._USE_C_DESCRIPTORS == False: _ELLIPSE._serialized_start=1243 _ELLIPSE._serialized_end=1357 _RECORDMESSAGE._serialized_start=1360 - _RECORDMESSAGE._serialized_end=1605 + _RECORDMESSAGE._serialized_end=1658 # @@protoc_insertion_point(module_scope) diff --git a/python/events/events_pb2.pyi b/python/events/events_pb2.pyi index cc4388e..1cb2373 100644 --- a/python/events/events_pb2.pyi +++ b/python/events/events_pb2.pyi @@ -263,12 +263,14 @@ class Object(google.protobuf.message.Message): RIGHT_FIELD_NUMBER: builtins.int BOTTOM_FIELD_NUMBER: builtins.int CONFIDENCE_FIELD_NUMBER: builtins.int + DISTANCEINMM_FIELD_NUMBER: builtins.int type: global___TypeObject.ValueType left: builtins.float top: builtins.float right: builtins.float bottom: builtins.float confidence: builtins.float + distanceInMm: builtins.int def __init__( self, *, @@ -278,8 +280,9 @@ class Object(google.protobuf.message.Message): right: builtins.float = ..., bottom: builtins.float = ..., confidence: builtins.float = ..., + distanceInMm: builtins.int = ..., ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["bottom", b"bottom", "confidence", b"confidence", "left", b"left", "right", b"right", "top", b"top", "type", b"type"]) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["bottom", b"bottom", "confidence", b"confidence", "distanceInMm", b"distanceInMm", "left", b"left", "right", b"right", "top", b"top", "type", b"type"]) -> None: ... global___Object = Object @@ -385,6 +388,7 @@ class RecordMessage(google.protobuf.message.Message): STEERING_FIELD_NUMBER: builtins.int AUTOPILOT_STEERING_FIELD_NUMBER: builtins.int DRIVE_MODE_FIELD_NUMBER: builtins.int + DISPARITY_FIELD_NUMBER: builtins.int RECORDSET_FIELD_NUMBER: builtins.int @property def frame(self) -> global___FrameMessage: ... @@ -394,6 +398,8 @@ class RecordMessage(google.protobuf.message.Message): def autopilot_steering(self) -> global___SteeringMessage: ... @property def drive_mode(self) -> global___DriveModeMessage: ... + @property + def disparity(self) -> global___DisparityMessage: ... recordSet: builtins.str """Record set name""" def __init__( @@ -403,9 +409,10 @@ class RecordMessage(google.protobuf.message.Message): steering: global___SteeringMessage | None = ..., autopilot_steering: global___SteeringMessage | None = ..., drive_mode: global___DriveModeMessage | None = ..., + disparity: global___DisparityMessage | None = ..., recordSet: builtins.str = ..., ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["autopilot_steering", b"autopilot_steering", "drive_mode", b"drive_mode", "frame", b"frame", "steering", b"steering"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["autopilot_steering", b"autopilot_steering", "drive_mode", b"drive_mode", "frame", b"frame", "recordSet", b"recordSet", "steering", b"steering"]) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["autopilot_steering", b"autopilot_steering", "disparity", b"disparity", "drive_mode", b"drive_mode", "frame", b"frame", "steering", b"steering"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["autopilot_steering", b"autopilot_steering", "disparity", b"disparity", "drive_mode", b"drive_mode", "frame", b"frame", "recordSet", b"recordSet", "steering", b"steering"]) -> None: ... global___RecordMessage = RecordMessage