Generate frameId from timestamp and add creation date field

This commit is contained in:
2020-01-03 17:41:42 +01:00
parent 4090078bec
commit e6119c0616
10 changed files with 571 additions and 59 deletions

View File

@ -6,6 +6,7 @@ package events
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
timestamp "github.com/golang/protobuf/ptypes/timestamp"
math "math"
)
@ -20,6 +21,34 @@ var _ = math.Inf
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type DriveMode int32
const (
DriveMode_INVALID DriveMode = 0
DriveMode_USER DriveMode = 1
DriveMode_PILOT DriveMode = 2
)
var DriveMode_name = map[int32]string{
0: "INVALID",
1: "USER",
2: "PILOT",
}
var DriveMode_value = map[string]int32{
"INVALID": 0,
"USER": 1,
"PILOT": 2,
}
func (x DriveMode) String() string {
return proto.EnumName(DriveMode_name, int32(x))
}
func (DriveMode) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_8ec31f2d2a3db598, []int{0}
}
type TypeObject int32
const (
@ -48,15 +77,16 @@ func (x TypeObject) String() string {
}
func (TypeObject) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_8ec31f2d2a3db598, []int{0}
return fileDescriptor_8ec31f2d2a3db598, []int{1}
}
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:"-"`
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
CreatedAt *timestamp.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *FrameRef) Reset() { *m = FrameRef{} }
@ -98,6 +128,13 @@ func (m *FrameRef) GetId() string {
return ""
}
func (m *FrameRef) GetCreatedAt() *timestamp.Timestamp {
if m != nil {
return m.CreatedAt
}
return nil
}
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"`
@ -255,6 +292,45 @@ func (m *ThrottleMessage) GetFrameRef() *FrameRef {
return nil
}
type DriveModeMessage struct {
DriveMode DriveMode `protobuf:"varint,1,opt,name=drive_mode,json=driveMode,proto3,enum=robocar.events.DriveMode" json:"drive_mode,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DriveModeMessage) Reset() { *m = DriveModeMessage{} }
func (m *DriveModeMessage) String() string { return proto.CompactTextString(m) }
func (*DriveModeMessage) ProtoMessage() {}
func (*DriveModeMessage) Descriptor() ([]byte, []int) {
return fileDescriptor_8ec31f2d2a3db598, []int{4}
}
func (m *DriveModeMessage) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DriveModeMessage.Unmarshal(m, b)
}
func (m *DriveModeMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DriveModeMessage.Marshal(b, m, deterministic)
}
func (m *DriveModeMessage) XXX_Merge(src proto.Message) {
xxx_messageInfo_DriveModeMessage.Merge(m, src)
}
func (m *DriveModeMessage) XXX_Size() int {
return xxx_messageInfo_DriveModeMessage.Size(m)
}
func (m *DriveModeMessage) XXX_DiscardUnknown() {
xxx_messageInfo_DriveModeMessage.DiscardUnknown(m)
}
var xxx_messageInfo_DriveModeMessage proto.InternalMessageInfo
func (m *DriveModeMessage) GetDriveMode() DriveMode {
if m != nil {
return m.DriveMode
}
return DriveMode_INVALID
}
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"`
@ -267,7 +343,7 @@ 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}
return fileDescriptor_8ec31f2d2a3db598, []int{5}
}
func (m *ObjectsMessage) XXX_Unmarshal(b []byte) error {
@ -302,10 +378,11 @@ func (m *ObjectsMessage) GetFrameRef() *FrameRef {
return nil
}
// BoundingBox that contains an object
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"`
Left int32 `protobuf:"varint,2,opt,name=left,proto3" json:"left,omitempty"`
Top int32 `protobuf:"varint,3,opt,name=top,proto3" json:"top,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"`
@ -318,7 +395,7 @@ 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}
return fileDescriptor_8ec31f2d2a3db598, []int{6}
}
func (m *Object) XXX_Unmarshal(b []byte) error {
@ -346,16 +423,16 @@ func (m *Object) GetType() TypeObject {
return TypeObject_ANY
}
func (m *Object) GetLLeft() int32 {
func (m *Object) GetLeft() int32 {
if m != nil {
return m.LLeft
return m.Left
}
return 0
}
func (m *Object) GetUp() int32 {
func (m *Object) GetTop() int32 {
if m != nil {
return m.Up
return m.Top
}
return 0
}
@ -381,42 +458,93 @@ func (m *Object) GetConfidence() float32 {
return 0
}
type SwitchRecordMessage struct {
Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SwitchRecordMessage) Reset() { *m = SwitchRecordMessage{} }
func (m *SwitchRecordMessage) String() string { return proto.CompactTextString(m) }
func (*SwitchRecordMessage) ProtoMessage() {}
func (*SwitchRecordMessage) Descriptor() ([]byte, []int) {
return fileDescriptor_8ec31f2d2a3db598, []int{7}
}
func (m *SwitchRecordMessage) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SwitchRecordMessage.Unmarshal(m, b)
}
func (m *SwitchRecordMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SwitchRecordMessage.Marshal(b, m, deterministic)
}
func (m *SwitchRecordMessage) XXX_Merge(src proto.Message) {
xxx_messageInfo_SwitchRecordMessage.Merge(m, src)
}
func (m *SwitchRecordMessage) XXX_Size() int {
return xxx_messageInfo_SwitchRecordMessage.Size(m)
}
func (m *SwitchRecordMessage) XXX_DiscardUnknown() {
xxx_messageInfo_SwitchRecordMessage.DiscardUnknown(m)
}
var xxx_messageInfo_SwitchRecordMessage proto.InternalMessageInfo
func (m *SwitchRecordMessage) GetEnabled() bool {
if m != nil {
return m.Enabled
}
return false
}
func init() {
proto.RegisterEnum("robocar.events.DriveMode", DriveMode_name, DriveMode_value)
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((*DriveModeMessage)(nil), "robocar.events.DriveModeMessage")
proto.RegisterType((*ObjectsMessage)(nil), "robocar.events.ObjectsMessage")
proto.RegisterType((*Object)(nil), "robocar.events.Object")
proto.RegisterType((*SwitchRecordMessage)(nil), "robocar.events.SwitchRecordMessage")
}
func init() { proto.RegisterFile("events/events.proto", fileDescriptor_8ec31f2d2a3db598) }
var fileDescriptor_8ec31f2d2a3db598 = []byte{
// 383 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0x4d, 0x6f, 0x9b, 0x40,
0x10, 0x2d, 0xcb, 0x87, 0xf1, 0xd8, 0xa2, 0x68, 0x5b, 0x59, 0xc8, 0x87, 0xca, 0xf2, 0xc9, 0xea,
0x81, 0x56, 0x54, 0xfd, 0x01, 0x76, 0xa5, 0x9e, 0xfc, 0xa5, 0xad, 0x7b, 0x48, 0x2e, 0x11, 0xe0,
0xc5, 0x26, 0xb2, 0x59, 0xb4, 0xac, 0x23, 0xf9, 0x9e, 0x9f, 0x93, 0x1f, 0x19, 0xed, 0x2e, 0x24,
0x36, 0x97, 0xe4, 0x92, 0x13, 0xf3, 0x1e, 0x6f, 0xde, 0xbc, 0x59, 0x58, 0xf8, 0x42, 0x1f, 0x68,
0x21, 0xaa, 0x1f, 0xfa, 0x11, 0x96, 0x9c, 0x09, 0x86, 0x3d, 0xce, 0x12, 0x96, 0xc6, 0x3c, 0xd4,
0xec, 0x38, 0x04, 0xf7, 0x2f, 0x8f, 0x8f, 0x94, 0xd0, 0x0c, 0x63, 0xb0, 0x8a, 0xf8, 0x48, 0x03,
0x63, 0x64, 0x4c, 0xba, 0x44, 0xd5, 0xd8, 0x03, 0x94, 0x6f, 0x03, 0xa4, 0x18, 0x94, 0x6f, 0xc7,
0x4b, 0xe8, 0x2b, 0xfd, 0x82, 0x56, 0x55, 0xbc, 0xa3, 0x78, 0xa2, 0xde, 0xcb, 0x8e, 0x5e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0x47, 0x00, 0xaf, 0x39, 0x70, 0x07, 0xcc, 0xe9,
0xf2, 0xc6, 0xff, 0x24, 0x8b, 0x3f, 0x53, 0xe2, 0x1b, 0xd8, 0x05, 0x6b, 0xf6, 0x7f, 0xb1, 0xf6,
0x91, 0xac, 0xd6, 0xf3, 0xd5, 0xc6, 0x37, 0x67, 0xee, 0xad, 0xa3, 0x57, 0x48, 0x1c, 0x75, 0x19,
0x7e, 0x3d, 0x07, 0x00, 0x00, 0xff, 0xff, 0xb6, 0x83, 0x51, 0xbe, 0x23, 0x03, 0x00, 0x00,
// 522 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0x5d, 0x8b, 0xd3, 0x40,
0x14, 0xdd, 0xa4, 0x5f, 0xc9, 0xed, 0x52, 0xc3, 0xac, 0x2c, 0xb1, 0x0f, 0x5a, 0xfa, 0x54, 0x16,
0x4c, 0xa5, 0x22, 0xe8, 0x63, 0xd7, 0x55, 0x28, 0xb4, 0xdd, 0x32, 0xed, 0x0a, 0xfa, 0x52, 0xf2,
0x71, 0xd3, 0x46, 0x9a, 0x4c, 0x98, 0x8c, 0x2b, 0x7d, 0xf7, 0xe7, 0xf8, 0x23, 0x25, 0x33, 0x99,
0xba, 0x1b, 0x10, 0x7c, 0xd9, 0xa7, 0xde, 0x73, 0x3a, 0xf7, 0x9c, 0x73, 0xef, 0x4c, 0xe0, 0x02,
0xef, 0x31, 0x13, 0xc5, 0x58, 0xfd, 0x78, 0x39, 0x67, 0x82, 0x91, 0x1e, 0x67, 0x01, 0x0b, 0x7d,
0xee, 0x29, 0xb6, 0xff, 0x6a, 0xc7, 0xd8, 0xee, 0x80, 0x63, 0xf9, 0x6f, 0xf0, 0x23, 0x1e, 0x8b,
0x24, 0xc5, 0x42, 0xf8, 0x69, 0xae, 0x1a, 0x86, 0x09, 0x58, 0x9f, 0xb9, 0x9f, 0x22, 0xc5, 0x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