From e7cd6f7e40d831b019392468c31f1a6b1732cf64 Mon Sep 17 00:00:00 2001 From: Cyrille Nofficial Date: Tue, 31 Dec 2019 15:43:01 +0100 Subject: [PATCH] First definition --- LICENSE | 201 +++++++++++++++++ Makefile | 40 ++++ README.md | 3 + events/events.proto | 45 ++++ go/events/events.pb.go | 422 ++++++++++++++++++++++++++++++++++++ go/go.mod | 5 + go/go.sum | 1 + python/events/events_pb2.py | 391 +++++++++++++++++++++++++++++++++ 8 files changed, 1108 insertions(+) create mode 100644 LICENSE create mode 100644 Makefile create mode 100644 README.md create mode 100644 events/events.proto create mode 100644 go/events/events.pb.go create mode 100644 go/go.mod create mode 100644 go/go.sum create mode 100644 python/events/events_pb2.py diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..61ddf82 --- /dev/null +++ b/Makefile @@ -0,0 +1,40 @@ +.PHONY: generate +PROTOC_GEN_GO := $(GOPATH)/bin/protoc-gen-go +PROTOC := $(shell which protoc) +# If protoc isn't on the path, set it to a target that's never up to date, so +# the install command always runs. +ifeq ($(PROTOC),) + PROTOC = must-rebuild +endif + +# Figure out which machine we're running on. +UNAME := $(shell uname) + +$(PROTOC): +# Run the right installation command for the operating system. +ifeq ($(UNAME), Darwin) + brew install protobuf +endif +ifeq ($(UNAME), Linux) + sudo apt-get install protobuf-compiler +endif +# You can add instructions for other operating systems here, or use different +# branching logic as appropriate. + +# If $GOPATH/bin/protoc-gen-go does not exist, we'll run this command to install +# it. +$(PROTOC_GEN_GO): + go get -u github.com/golang/protobuf/protoc-gen-go + +events.pb.go: events/events.proto | $(PROTOC_GEN_GO) $(PROTOC) + protoc --go_out=./go events/events.proto + +events.pb.py: events/events.proto | $(PROTOC) + protoc --python_out=./python events/events.proto + +events: events.pb.go events.pb.py + +# This is a "phony" target - an alias for the above command, so "make compile" +# still works. +generate: events + diff --git a/README.md b/README.md new file mode 100644 index 0000000..494821c --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# robocar-protobuf + +Protobuf message definitions for robocar diff --git a/events/events.proto b/events/events.proto new file mode 100644 index 0000000..03332f2 --- /dev/null +++ b/events/events.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; +package robocar.events; + +message FrameRef { + string name = 1; + string id = 2; +} + +message FrameMessage { + FrameRef id = 1; + bytes frame = 2; +} + +message SteeringMessage { + float steering = 1; + float confidence = 2; + FrameRef frame_ref = 3; +} + +message ThrottleMessage { + float throttle = 1; + float confidence = 2; + FrameRef frame_ref = 3; +} + +message ObjectsMessage{ + repeated Object objects = 1; + FrameRef frame_ref = 2; +} + +message Object{ + TypeObject type = 1; + int32 lLeft = 2; + int32 up = 3; + int32 right = 4; + int32 bottom = 5; + float confidence = 6; +} + +enum TypeObject{ + ANY = 0; + CAR = 1; + BUMP = 2; + PLOT = 3; +} diff --git a/go/events/events.pb.go b/go/events/events.pb.go new file mode 100644 index 0000000..07860d7 --- /dev/null +++ b/go/events/events.pb.go @@ -0,0 +1,422 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: events/events.proto + +package robocar_events + +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type TypeObject int32 + +const ( + TypeObject_ANY TypeObject = 0 + TypeObject_CAR TypeObject = 1 + TypeObject_BUMP TypeObject = 2 + TypeObject_PLOT TypeObject = 3 +) + +var TypeObject_name = map[int32]string{ + 0: "ANY", + 1: "CAR", + 2: "BUMP", + 3: "PLOT", +} + +var TypeObject_value = map[string]int32{ + "ANY": 0, + "CAR": 1, + "BUMP": 2, + "PLOT": 3, +} + +func (x TypeObject) String() string { + return proto.EnumName(TypeObject_name, int32(x)) +} + +func (TypeObject) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_8ec31f2d2a3db598, []int{0} +} + +type FrameRef struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FrameRef) Reset() { *m = FrameRef{} } +func (m *FrameRef) String() string { return proto.CompactTextString(m) } +func (*FrameRef) ProtoMessage() {} +func (*FrameRef) Descriptor() ([]byte, []int) { + return fileDescriptor_8ec31f2d2a3db598, []int{0} +} + +func (m *FrameRef) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FrameRef.Unmarshal(m, b) +} +func (m *FrameRef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FrameRef.Marshal(b, m, deterministic) +} +func (m *FrameRef) XXX_Merge(src proto.Message) { + xxx_messageInfo_FrameRef.Merge(m, src) +} +func (m *FrameRef) XXX_Size() int { + return xxx_messageInfo_FrameRef.Size(m) +} +func (m *FrameRef) XXX_DiscardUnknown() { + xxx_messageInfo_FrameRef.DiscardUnknown(m) +} + +var xxx_messageInfo_FrameRef proto.InternalMessageInfo + +func (m *FrameRef) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *FrameRef) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +type FrameMessage struct { + Id *FrameRef `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Frame []byte `protobuf:"bytes,2,opt,name=frame,proto3" json:"frame,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FrameMessage) Reset() { *m = FrameMessage{} } +func (m *FrameMessage) String() string { return proto.CompactTextString(m) } +func (*FrameMessage) ProtoMessage() {} +func (*FrameMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_8ec31f2d2a3db598, []int{1} +} + +func (m *FrameMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FrameMessage.Unmarshal(m, b) +} +func (m *FrameMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FrameMessage.Marshal(b, m, deterministic) +} +func (m *FrameMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_FrameMessage.Merge(m, src) +} +func (m *FrameMessage) XXX_Size() int { + return xxx_messageInfo_FrameMessage.Size(m) +} +func (m *FrameMessage) XXX_DiscardUnknown() { + xxx_messageInfo_FrameMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_FrameMessage proto.InternalMessageInfo + +func (m *FrameMessage) GetId() *FrameRef { + if m != nil { + return m.Id + } + return nil +} + +func (m *FrameMessage) GetFrame() []byte { + if m != nil { + return m.Frame + } + return nil +} + +type SteeringMessage struct { + Steering float32 `protobuf:"fixed32,1,opt,name=steering,proto3" json:"steering,omitempty"` + Confidence float32 `protobuf:"fixed32,2,opt,name=confidence,proto3" json:"confidence,omitempty"` + FrameRef *FrameRef `protobuf:"bytes,3,opt,name=frame_ref,json=frameRef,proto3" json:"frame_ref,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SteeringMessage) Reset() { *m = SteeringMessage{} } +func (m *SteeringMessage) String() string { return proto.CompactTextString(m) } +func (*SteeringMessage) ProtoMessage() {} +func (*SteeringMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_8ec31f2d2a3db598, []int{2} +} + +func (m *SteeringMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SteeringMessage.Unmarshal(m, b) +} +func (m *SteeringMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SteeringMessage.Marshal(b, m, deterministic) +} +func (m *SteeringMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_SteeringMessage.Merge(m, src) +} +func (m *SteeringMessage) XXX_Size() int { + return xxx_messageInfo_SteeringMessage.Size(m) +} +func (m *SteeringMessage) XXX_DiscardUnknown() { + xxx_messageInfo_SteeringMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_SteeringMessage proto.InternalMessageInfo + +func (m *SteeringMessage) GetSteering() float32 { + if m != nil { + return m.Steering + } + return 0 +} + +func (m *SteeringMessage) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +func (m *SteeringMessage) GetFrameRef() *FrameRef { + if m != nil { + return m.FrameRef + } + return nil +} + +type ThrottleMessage struct { + Throttle float32 `protobuf:"fixed32,1,opt,name=throttle,proto3" json:"throttle,omitempty"` + Confidence float32 `protobuf:"fixed32,2,opt,name=confidence,proto3" json:"confidence,omitempty"` + FrameRef *FrameRef `protobuf:"bytes,3,opt,name=frame_ref,json=frameRef,proto3" json:"frame_ref,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ThrottleMessage) Reset() { *m = ThrottleMessage{} } +func (m *ThrottleMessage) String() string { return proto.CompactTextString(m) } +func (*ThrottleMessage) ProtoMessage() {} +func (*ThrottleMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_8ec31f2d2a3db598, []int{3} +} + +func (m *ThrottleMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ThrottleMessage.Unmarshal(m, b) +} +func (m *ThrottleMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ThrottleMessage.Marshal(b, m, deterministic) +} +func (m *ThrottleMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_ThrottleMessage.Merge(m, src) +} +func (m *ThrottleMessage) XXX_Size() int { + return xxx_messageInfo_ThrottleMessage.Size(m) +} +func (m *ThrottleMessage) XXX_DiscardUnknown() { + xxx_messageInfo_ThrottleMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_ThrottleMessage proto.InternalMessageInfo + +func (m *ThrottleMessage) GetThrottle() float32 { + if m != nil { + return m.Throttle + } + return 0 +} + +func (m *ThrottleMessage) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +func (m *ThrottleMessage) GetFrameRef() *FrameRef { + if m != nil { + return m.FrameRef + } + return nil +} + +type ObjectsMessage struct { + Objects []*Object `protobuf:"bytes,1,rep,name=objects,proto3" json:"objects,omitempty"` + FrameRef *FrameRef `protobuf:"bytes,2,opt,name=frame_ref,json=frameRef,proto3" json:"frame_ref,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ObjectsMessage) Reset() { *m = ObjectsMessage{} } +func (m *ObjectsMessage) String() string { return proto.CompactTextString(m) } +func (*ObjectsMessage) ProtoMessage() {} +func (*ObjectsMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_8ec31f2d2a3db598, []int{4} +} + +func (m *ObjectsMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ObjectsMessage.Unmarshal(m, b) +} +func (m *ObjectsMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ObjectsMessage.Marshal(b, m, deterministic) +} +func (m *ObjectsMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_ObjectsMessage.Merge(m, src) +} +func (m *ObjectsMessage) XXX_Size() int { + return xxx_messageInfo_ObjectsMessage.Size(m) +} +func (m *ObjectsMessage) XXX_DiscardUnknown() { + xxx_messageInfo_ObjectsMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_ObjectsMessage proto.InternalMessageInfo + +func (m *ObjectsMessage) GetObjects() []*Object { + if m != nil { + return m.Objects + } + return nil +} + +func (m *ObjectsMessage) GetFrameRef() *FrameRef { + if m != nil { + return m.FrameRef + } + return nil +} + +type Object struct { + Type TypeObject `protobuf:"varint,1,opt,name=type,proto3,enum=robocar.events.TypeObject" json:"type,omitempty"` + LLeft int32 `protobuf:"varint,2,opt,name=lLeft,proto3" json:"lLeft,omitempty"` + Up int32 `protobuf:"varint,3,opt,name=up,proto3" json:"up,omitempty"` + Right int32 `protobuf:"varint,4,opt,name=right,proto3" json:"right,omitempty"` + Bottom int32 `protobuf:"varint,5,opt,name=bottom,proto3" json:"bottom,omitempty"` + Confidence float32 `protobuf:"fixed32,6,opt,name=confidence,proto3" json:"confidence,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Object) Reset() { *m = Object{} } +func (m *Object) String() string { return proto.CompactTextString(m) } +func (*Object) ProtoMessage() {} +func (*Object) Descriptor() ([]byte, []int) { + return fileDescriptor_8ec31f2d2a3db598, []int{5} +} + +func (m *Object) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Object.Unmarshal(m, b) +} +func (m *Object) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Object.Marshal(b, m, deterministic) +} +func (m *Object) XXX_Merge(src proto.Message) { + xxx_messageInfo_Object.Merge(m, src) +} +func (m *Object) XXX_Size() int { + return xxx_messageInfo_Object.Size(m) +} +func (m *Object) XXX_DiscardUnknown() { + xxx_messageInfo_Object.DiscardUnknown(m) +} + +var xxx_messageInfo_Object proto.InternalMessageInfo + +func (m *Object) GetType() TypeObject { + if m != nil { + return m.Type + } + return TypeObject_ANY +} + +func (m *Object) GetLLeft() int32 { + if m != nil { + return m.LLeft + } + return 0 +} + +func (m *Object) GetUp() int32 { + if m != nil { + return m.Up + } + return 0 +} + +func (m *Object) GetRight() int32 { + if m != nil { + return m.Right + } + return 0 +} + +func (m *Object) GetBottom() int32 { + if m != nil { + return m.Bottom + } + return 0 +} + +func (m *Object) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +func init() { + proto.RegisterEnum("robocar.events.TypeObject", TypeObject_name, TypeObject_value) + proto.RegisterType((*FrameRef)(nil), "robocar.events.FrameRef") + proto.RegisterType((*FrameMessage)(nil), "robocar.events.FrameMessage") + proto.RegisterType((*SteeringMessage)(nil), "robocar.events.SteeringMessage") + proto.RegisterType((*ThrottleMessage)(nil), "robocar.events.ThrottleMessage") + proto.RegisterType((*ObjectsMessage)(nil), "robocar.events.ObjectsMessage") + proto.RegisterType((*Object)(nil), "robocar.events.Object") +} + +func init() { proto.RegisterFile("events/events.proto", fileDescriptor_8ec31f2d2a3db598) } + +var fileDescriptor_8ec31f2d2a3db598 = []byte{ + // 377 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0x4d, 0x6f, 0xa3, 0x30, + 0x10, 0x5d, 0xcc, 0x47, 0xc8, 0x24, 0x62, 0x91, 0x77, 0x15, 0xa1, 0x1c, 0x56, 0x51, 0x4e, 0xd1, + 0x1e, 0xd8, 0x15, 0xab, 0xfd, 0x01, 0x69, 0xa5, 0x9e, 0xf2, 0x25, 0x37, 0x3d, 0xf4, 0x54, 0x01, + 0x31, 0x09, 0x55, 0x82, 0x91, 0x71, 0x2a, 0xe5, 0xde, 0x9f, 0xd3, 0x1f, 0x59, 0xd9, 0x86, 0x36, + 0xe1, 0xd2, 0x5e, 0x7a, 0x62, 0xde, 0xe3, 0xcd, 0x9b, 0xe7, 0x01, 0xc3, 0x0f, 0xfa, 0x44, 0x0b, + 0x51, 0xfd, 0xd1, 0x8f, 0xb0, 0xe4, 0x4c, 0x30, 0xec, 0x71, 0x96, 0xb0, 0x34, 0xe6, 0xa1, 0x66, + 0xc7, 0x21, 0xb8, 0x37, 0x3c, 0x3e, 0x50, 0x42, 0x33, 0x8c, 0xc1, 0x2a, 0xe2, 0x03, 0x0d, 0x8c, + 0x91, 0x31, 0xe9, 0x12, 0x55, 0x63, 0x0f, 0x50, 0xbe, 0x09, 0x90, 0x62, 0x50, 0xbe, 0x19, 0x2f, + 0xa0, 0xaf, 0xf4, 0x73, 0x5a, 0x55, 0xf1, 0x96, 0xe2, 0x89, 0x7a, 0x2f, 0x3b, 0x7a, 0x51, 0x10, + 0x5e, 0x9a, 0x87, 0x8d, 0xb3, 0xec, 0xc4, 0x3f, 0xc1, 0xce, 0x24, 0x56, 0x66, 0x7d, 0xa2, 0xc1, + 0xf8, 0xd9, 0x80, 0xef, 0xb7, 0x82, 0x52, 0x9e, 0x17, 0xdb, 0xc6, 0x73, 0x08, 0x6e, 0x55, 0x53, + 0xca, 0x19, 0x91, 0x37, 0x8c, 0x7f, 0x01, 0xa4, 0xac, 0xc8, 0xf2, 0x0d, 0x2d, 0x52, 0x6d, 0x85, + 0xc8, 0x19, 0x83, 0xff, 0x43, 0x57, 0x19, 0x3f, 0x70, 0x9a, 0x05, 0xe6, 0x07, 0xb1, 0xdc, 0xac, + 0xae, 0x54, 0x8c, 0xf5, 0x8e, 0x33, 0x21, 0xf6, 0xf4, 0x2c, 0x86, 0xa8, 0xa9, 0x26, 0x46, 0x83, + 0xbf, 0x2a, 0xc6, 0x09, 0xbc, 0x65, 0xf2, 0x48, 0x53, 0x51, 0x35, 0x21, 0xfe, 0x42, 0x87, 0x69, + 0x26, 0x30, 0x46, 0xe6, 0xa4, 0x17, 0x0d, 0xda, 0x36, 0xba, 0x81, 0x34, 0xb2, 0xcb, 0xd1, 0xe8, + 0xd3, 0xa3, 0x5f, 0x0c, 0x70, 0xb4, 0x15, 0x0e, 0xc1, 0x12, 0xa7, 0x52, 0x1f, 0xda, 0x8b, 0x86, + 0xed, 0xe6, 0xf5, 0xa9, 0xa4, 0xf5, 0x50, 0xa5, 0x93, 0x5f, 0x76, 0x3f, 0xa3, 0x99, 0x50, 0xd3, + 0x6c, 0xa2, 0x81, 0xfc, 0x73, 0x8e, 0xa5, 0x3a, 0xbb, 0x4d, 0xd0, 0xb1, 0x94, 0x2a, 0x9e, 0x6f, + 0x77, 0x22, 0xb0, 0xb4, 0x4a, 0x01, 0x3c, 0x00, 0x27, 0x61, 0x42, 0xb0, 0x43, 0x60, 0x2b, 0xba, + 0x46, 0xad, 0x05, 0x3b, 0xed, 0x05, 0xff, 0x8e, 0x00, 0xde, 0x73, 0xe0, 0x0e, 0x98, 0xd3, 0xc5, + 0xbd, 0xff, 0x4d, 0x16, 0xd7, 0x53, 0xe2, 0x1b, 0xd8, 0x05, 0xeb, 0xea, 0x6e, 0xbe, 0xf2, 0x91, + 0xac, 0x56, 0xb3, 0xe5, 0xda, 0x37, 0x13, 0x47, 0x5d, 0x81, 0x7f, 0xaf, 0x01, 0x00, 0x00, 0xff, + 0xff, 0x90, 0x6c, 0xcb, 0x88, 0x19, 0x03, 0x00, 0x00, +} diff --git a/go/go.mod b/go/go.mod new file mode 100644 index 0000000..cb69d52 --- /dev/null +++ b/go/go.mod @@ -0,0 +1,5 @@ +module github.com/cyrilix/robocar-protobuf + +go 1.13 + +require github.com/golang/protobuf v1.3.2 diff --git a/go/go.sum b/go/go.sum new file mode 100644 index 0000000..8781e8c --- /dev/null +++ b/go/go.sum @@ -0,0 +1 @@ +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= diff --git a/python/events/events_pb2.py b/python/events/events_pb2.py new file mode 100644 index 0000000..f084b7b --- /dev/null +++ b/python/events/events_pb2.py @@ -0,0 +1,391 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: events/events.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='events/events.proto', + package='robocar.events', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\n\x13\x65vents/events.proto\x12\x0erobocar.events\"$\n\x08\x46rameRef\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\"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\"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\"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\"\x80\x01\n\x06Object\x12(\n\x04type\x18\x01 \x01(\x0e\x32\x1a.robocar.events.TypeObject\x12\r\n\x05lLeft\x18\x02 \x01(\x05\x12\n\n\x02up\x18\x03 \x01(\x05\x12\r\n\x05right\x18\x04 \x01(\x05\x12\x0e\n\x06\x62ottom\x18\x05 \x01(\x05\x12\x12\n\nconfidence\x18\x06 \x01(\x02*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\x62\x06proto3') +) + +_TYPEOBJECT = _descriptor.EnumDescriptor( + name='TypeObject', + full_name='robocar.events.TypeObject', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='ANY', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='CAR', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='BUMP', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='PLOT', index=3, number=3, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=585, + serialized_end=635, +) +_sym_db.RegisterEnumDescriptor(_TYPEOBJECT) + +TypeObject = enum_type_wrapper.EnumTypeWrapper(_TYPEOBJECT) +ANY = 0 +CAR = 1 +BUMP = 2 +PLOT = 3 + + + +_FRAMEREF = _descriptor.Descriptor( + name='FrameRef', + full_name='robocar.events.FrameRef', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='robocar.events.FrameRef.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='id', full_name='robocar.events.FrameRef.id', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=39, + serialized_end=75, +) + + +_FRAMEMESSAGE = _descriptor.Descriptor( + name='FrameMessage', + full_name='robocar.events.FrameMessage', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='id', full_name='robocar.events.FrameMessage.id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='frame', full_name='robocar.events.FrameMessage.frame', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=77, + serialized_end=144, +) + + +_STEERINGMESSAGE = _descriptor.Descriptor( + name='SteeringMessage', + full_name='robocar.events.SteeringMessage', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='steering', full_name='robocar.events.SteeringMessage.steering', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='confidence', full_name='robocar.events.SteeringMessage.confidence', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='frame_ref', full_name='robocar.events.SteeringMessage.frame_ref', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=146, + serialized_end=246, +) + + +_THROTTLEMESSAGE = _descriptor.Descriptor( + name='ThrottleMessage', + full_name='robocar.events.ThrottleMessage', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='throttle', full_name='robocar.events.ThrottleMessage.throttle', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='confidence', full_name='robocar.events.ThrottleMessage.confidence', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='frame_ref', full_name='robocar.events.ThrottleMessage.frame_ref', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=248, + serialized_end=348, +) + + +_OBJECTSMESSAGE = _descriptor.Descriptor( + name='ObjectsMessage', + full_name='robocar.events.ObjectsMessage', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='objects', full_name='robocar.events.ObjectsMessage.objects', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='frame_ref', full_name='robocar.events.ObjectsMessage.frame_ref', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=350, + serialized_end=452, +) + + +_OBJECT = _descriptor.Descriptor( + name='Object', + full_name='robocar.events.Object', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='type', full_name='robocar.events.Object.type', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='lLeft', full_name='robocar.events.Object.lLeft', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='up', full_name='robocar.events.Object.up', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='right', full_name='robocar.events.Object.right', index=3, + number=4, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='bottom', full_name='robocar.events.Object.bottom', index=4, + number=5, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='confidence', full_name='robocar.events.Object.confidence', index=5, + number=6, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=455, + serialized_end=583, +) + +_FRAMEMESSAGE.fields_by_name['id'].message_type = _FRAMEREF +_STEERINGMESSAGE.fields_by_name['frame_ref'].message_type = _FRAMEREF +_THROTTLEMESSAGE.fields_by_name['frame_ref'].message_type = _FRAMEREF +_OBJECTSMESSAGE.fields_by_name['objects'].message_type = _OBJECT +_OBJECTSMESSAGE.fields_by_name['frame_ref'].message_type = _FRAMEREF +_OBJECT.fields_by_name['type'].enum_type = _TYPEOBJECT +DESCRIPTOR.message_types_by_name['FrameRef'] = _FRAMEREF +DESCRIPTOR.message_types_by_name['FrameMessage'] = _FRAMEMESSAGE +DESCRIPTOR.message_types_by_name['SteeringMessage'] = _STEERINGMESSAGE +DESCRIPTOR.message_types_by_name['ThrottleMessage'] = _THROTTLEMESSAGE +DESCRIPTOR.message_types_by_name['ObjectsMessage'] = _OBJECTSMESSAGE +DESCRIPTOR.message_types_by_name['Object'] = _OBJECT +DESCRIPTOR.enum_types_by_name['TypeObject'] = _TYPEOBJECT +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +FrameRef = _reflection.GeneratedProtocolMessageType('FrameRef', (_message.Message,), dict( + DESCRIPTOR = _FRAMEREF, + __module__ = 'events.events_pb2' + # @@protoc_insertion_point(class_scope:robocar.events.FrameRef) + )) +_sym_db.RegisterMessage(FrameRef) + +FrameMessage = _reflection.GeneratedProtocolMessageType('FrameMessage', (_message.Message,), dict( + DESCRIPTOR = _FRAMEMESSAGE, + __module__ = 'events.events_pb2' + # @@protoc_insertion_point(class_scope:robocar.events.FrameMessage) + )) +_sym_db.RegisterMessage(FrameMessage) + +SteeringMessage = _reflection.GeneratedProtocolMessageType('SteeringMessage', (_message.Message,), dict( + DESCRIPTOR = _STEERINGMESSAGE, + __module__ = 'events.events_pb2' + # @@protoc_insertion_point(class_scope:robocar.events.SteeringMessage) + )) +_sym_db.RegisterMessage(SteeringMessage) + +ThrottleMessage = _reflection.GeneratedProtocolMessageType('ThrottleMessage', (_message.Message,), dict( + DESCRIPTOR = _THROTTLEMESSAGE, + __module__ = 'events.events_pb2' + # @@protoc_insertion_point(class_scope:robocar.events.ThrottleMessage) + )) +_sym_db.RegisterMessage(ThrottleMessage) + +ObjectsMessage = _reflection.GeneratedProtocolMessageType('ObjectsMessage', (_message.Message,), dict( + DESCRIPTOR = _OBJECTSMESSAGE, + __module__ = 'events.events_pb2' + # @@protoc_insertion_point(class_scope:robocar.events.ObjectsMessage) + )) +_sym_db.RegisterMessage(ObjectsMessage) + +Object = _reflection.GeneratedProtocolMessageType('Object', (_message.Message,), dict( + DESCRIPTOR = _OBJECT, + __module__ = 'events.events_pb2' + # @@protoc_insertion_point(class_scope:robocar.events.Object) + )) +_sym_db.RegisterMessage(Object) + + +# @@protoc_insertion_point(module_scope)