├── .github └── workflows │ └── release.yaml ├── .gitignore ├── .gitmodules ├── .vscode └── launch.json ├── README.md ├── buf.gen.yaml ├── config.json ├── gen └── go │ └── proto │ ├── approach │ └── v1 │ │ ├── approach.pb.go │ │ └── approach_grpc.pb.go │ ├── mastermind │ └── v1 │ │ ├── mastermind.pb.go │ │ └── mastermind_grpc.pb.go │ └── proxy │ └── v1 │ ├── proxy.pb.go │ └── proxy_grpc.pb.go ├── go.mod ├── go.sum ├── main └── main.go ├── server ├── commands.go ├── server.go ├── state.go └── telemetry.go ├── state ├── state.go └── state_test.go ├── telemetry └── telemetry.go └── utils └── log.go /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | # .github/workflows/release.yaml 2 | 3 | on: 4 | release: 5 | types: [created] 6 | 7 | jobs: 8 | releases-matrix: 9 | name: Release Go Binary 10 | runs-on: ubuntu-latest 11 | strategy: 12 | matrix: 13 | # build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64 14 | goos: [linux, windows, darwin] 15 | goarch: ["386", amd64, arm64] 16 | exclude: 17 | - goarch: "386" 18 | goos: darwin 19 | - goarch: arm64 20 | goos: windows 21 | steps: 22 | - uses: actions/checkout@v3 23 | - uses: wangyoucao577/go-release-action@v1.30 24 | with: 25 | github_token: ${{ secrets.GITHUB_TOKEN }} 26 | goos: ${{ matrix.goos }} 27 | goarch: ${{ matrix.goarch }} 28 | goversion: "https://dl.google.com/go/go1.18.4.linux-amd64.tar.gz" 29 | project_path: "./main/" 30 | binary_name: "mastermind" 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories (remove the comment below to include it) 15 | # vendor/ 16 | 17 | 18 | # log file 19 | *log.json 20 | 21 | .idea/ -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "proto"] 2 | path = proto 3 | url = https://github.com/koustech/proto 4 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Launch Package", 9 | "type": "go", 10 | "request": "launch", 11 | "mode": "debug", 12 | "program": "${workspaceFolder}/main/main.go", 13 | }, 14 | { 15 | "name": "Test Package", 16 | "type": "go", 17 | "request": "launch", 18 | "mode": "test", 19 | "program": "${workspaceFolder}", 20 | }, 21 | 22 | ] 23 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Mastermind 2 | Savaşan 22 Yarışmasının sisteminde mesajları yönlendirmek ve sistem durumunu tutmaktan sorumlu Yönetici servis 3 | 4 | ## Tasarım 5 | Bu program, farklı gRPC bağlantıları açarak diğer servislerle konuşabilecektir. Resimdeki iki taraflı yayınlama (bidirectional streaming) ile bağlantılar açık tutulacaktır. 6 | 7 | ![image](https://user-images.githubusercontent.com/53450844/177382414-6e5f8ecc-e955-4d49-9c04-8818763de7a3.png) 8 | 9 | Mastermind, yönetici servis olup diyagramdaki diğer servislerle haberleşecektir. 10 | ![Sistem Mimarisi](https://user-images.githubusercontent.com/53450844/181495511-c5dd93b5-4f80-4de2-9b1e-53146efb052d.png) 11 | 12 | 13 | ## Sistem Durumu 14 | Bağlı olan servislerin sistemin hangi aşamada olduğundan haberdar olabilmeleri için, Mastermind bütün servislerle bu sistem durumu paylaşmak zorunda. Sistemi bir sonlu durum makinesi (finite-state machine) olarak modelleyerek, belirli kurallara göre hangi aşamada olması gerektiğini hesaplayıp, X geçiş fonksiyonu için Y durumuna geçileceğini elde edilebilir. 2022 Savaşan İHA Yarışması'nın isterlerini yerine getirmek için kullanılacak sistem durumları ve geçiş fonksiyonları aşağıdaki durum diyagramında gösterilir: 15 | ![Durum Makinesi](https://user-images.githubusercontent.com/53450844/181495372-cb0da3ee-6a44-41cb-b599-208a7b66471c.png) 16 | 17 | 18 | 19 | ### Endpointlar / RPCler 20 | 21 | #### UpdateState(stream UpdateStateRequest) returns (stream UpdateStateResponse) 22 | UpdateState bi-directional RPC üzerinden istemci servislerden durum geçişleri alırken, onlara yeni hesaplanan durumu da gönderecektir. Unary yerine bi-directional olmasının nedeni, durum güncellemesinin sadece gönderen servis değil, diğer servislerden de kaynaklı olabilmesinden dolayıdır. 23 | 24 | Örnek olarak 4 servisin bağlı olduğu bir sistemde, Servis A bir UpdateStateRequest'ı gönderdiği zaman, Servis A, Servis B, ve Servis C'ye yeni durumu içeren bir UpdateStateResponse gönderilecek. 25 | 26 | 27 | ## Quickstart 28 | 29 | ```sh 30 | git clone https://github.com/koustech/mastermind.git 31 | cd mastermind 32 | go run main/main.go -a 127.0.0.1:5678 33 | ``` 34 | 35 | 36 | -------------------------------------------------------------------------------- /buf.gen.yaml: -------------------------------------------------------------------------------- 1 | version: v1 2 | managed: 3 | enabled: true 4 | go_package_prefix: 5 | default: github.com/koustech/mastermind/gen/proto/go 6 | plugins: 7 | - plugin: buf.build/protocolbuffers/go 8 | out: gen/go 9 | opt: 10 | - paths=source_relative 11 | - plugin: buf.build/grpc/go 12 | out: gen/go 13 | opt: 14 | - paths=source_relative 15 | - require_unimplemented_servers=false 16 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "connections": { 3 | "mastermind": "127.0.0.1:5678", 4 | "approach": "127.0.0.1:7890", 5 | "competition_server": "127.0.0.1:8000" 6 | }, 7 | "credentials": { 8 | "competition_server": { 9 | "kadi": "koustech", 10 | "sifre": "d9a1b26qft" 11 | } 12 | }, 13 | "koustech_team_id": 13, 14 | "telem_send_period_ms": 700 15 | } 16 | -------------------------------------------------------------------------------- /gen/go/proto/approach/v1/approach.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.34.2 4 | // protoc (unknown) 5 | // source: proto/approach/v1/approach.proto 6 | 7 | package approachv1 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | ) 15 | 16 | const ( 17 | // Verify that this generated code is sufficiently up-to-date. 18 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 19 | // Verify that runtime/protoimpl is sufficiently up-to-date. 20 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 21 | ) 22 | 23 | type AgilityLevel int32 24 | 25 | const ( 26 | AgilityLevel_AGILITY_LEVEL_UNSPECIFIED AgilityLevel = 0 27 | AgilityLevel_AGILITY_LEVEL_HIGH AgilityLevel = 1 28 | AgilityLevel_AGILITY_LEVEL_MEDIUM AgilityLevel = 2 29 | AgilityLevel_AGILITY_LEVEL_LOW AgilityLevel = 3 30 | ) 31 | 32 | // Enum value maps for AgilityLevel. 33 | var ( 34 | AgilityLevel_name = map[int32]string{ 35 | 0: "AGILITY_LEVEL_UNSPECIFIED", 36 | 1: "AGILITY_LEVEL_HIGH", 37 | 2: "AGILITY_LEVEL_MEDIUM", 38 | 3: "AGILITY_LEVEL_LOW", 39 | } 40 | AgilityLevel_value = map[string]int32{ 41 | "AGILITY_LEVEL_UNSPECIFIED": 0, 42 | "AGILITY_LEVEL_HIGH": 1, 43 | "AGILITY_LEVEL_MEDIUM": 2, 44 | "AGILITY_LEVEL_LOW": 3, 45 | } 46 | ) 47 | 48 | func (x AgilityLevel) Enum() *AgilityLevel { 49 | p := new(AgilityLevel) 50 | *p = x 51 | return p 52 | } 53 | 54 | func (x AgilityLevel) String() string { 55 | return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) 56 | } 57 | 58 | func (AgilityLevel) Descriptor() protoreflect.EnumDescriptor { 59 | return file_proto_approach_v1_approach_proto_enumTypes[0].Descriptor() 60 | } 61 | 62 | func (AgilityLevel) Type() protoreflect.EnumType { 63 | return &file_proto_approach_v1_approach_proto_enumTypes[0] 64 | } 65 | 66 | func (x AgilityLevel) Number() protoreflect.EnumNumber { 67 | return protoreflect.EnumNumber(x) 68 | } 69 | 70 | // Deprecated: Use AgilityLevel.Descriptor instead. 71 | func (AgilityLevel) EnumDescriptor() ([]byte, []int) { 72 | return file_proto_approach_v1_approach_proto_rawDescGZIP(), []int{0} 73 | } 74 | 75 | // Plane is a UAV participating in the round. Can be the sender's own UAV 76 | type Plane struct { 77 | state protoimpl.MessageState 78 | sizeCache protoimpl.SizeCache 79 | unknownFields protoimpl.UnknownFields 80 | 81 | PlaneId int32 `protobuf:"varint,1,opt,name=plane_id,json=planeId,proto3" json:"plane_id,omitempty"` // Plane's ID in competition server. Exception is sender's 82 | // UAV, which is changed to a negative int 83 | Lat float64 `protobuf:"fixed64,2,opt,name=lat,proto3" json:"lat,omitempty"` // Plane's latitude in degrees 84 | Lon float64 `protobuf:"fixed64,3,opt,name=lon,proto3" json:"lon,omitempty"` // Plane's longitude in degrees 85 | Alt float64 `protobuf:"fixed64,4,opt,name=alt,proto3" json:"alt,omitempty"` // Plane's altitude in metres 86 | Heading float64 `protobuf:"fixed64,5,opt,name=heading,proto3" json:"heading,omitempty"` // Plane's heading in degrees from North 87 | Groundspeed float64 `protobuf:"fixed64,6,opt,name=groundspeed,proto3" json:"groundspeed,omitempty"` // Plane's groundspeend in m/s 88 | AgilityLevel AgilityLevel `protobuf:"varint,7,opt,name=agility_level,json=agilityLevel,proto3,enum=approach.v1.AgilityLevel" json:"agility_level,omitempty"` // Plane's agility level. High or 1 is most 89 | // agile, low or 3 is least agile 90 | Score float64 `protobuf:"fixed64,8,opt,name=score,proto3" json:"score,omitempty"` // Probability of locking on plane, between 0 and 100. 100 91 | // is easiest to lock on 92 | IsInFov bool `protobuf:"varint,9,opt,name=is_in_fov,json=isInFov,proto3" json:"is_in_fov,omitempty"` // Shows if the plane is in FOV angle 93 | TargetDistance float64 `protobuf:"fixed64,10,opt,name=target_distance,json=targetDistance,proto3" json:"target_distance,omitempty"` //The distance of the approaching plane 94 | Airspeed float64 `protobuf:"fixed64,11,opt,name=airspeed,proto3" json:"airspeed,omitempty"` 95 | } 96 | 97 | func (x *Plane) Reset() { 98 | *x = Plane{} 99 | if protoimpl.UnsafeEnabled { 100 | mi := &file_proto_approach_v1_approach_proto_msgTypes[0] 101 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 102 | ms.StoreMessageInfo(mi) 103 | } 104 | } 105 | 106 | func (x *Plane) String() string { 107 | return protoimpl.X.MessageStringOf(x) 108 | } 109 | 110 | func (*Plane) ProtoMessage() {} 111 | 112 | func (x *Plane) ProtoReflect() protoreflect.Message { 113 | mi := &file_proto_approach_v1_approach_proto_msgTypes[0] 114 | if protoimpl.UnsafeEnabled && x != nil { 115 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 116 | if ms.LoadMessageInfo() == nil { 117 | ms.StoreMessageInfo(mi) 118 | } 119 | return ms 120 | } 121 | return mi.MessageOf(x) 122 | } 123 | 124 | // Deprecated: Use Plane.ProtoReflect.Descriptor instead. 125 | func (*Plane) Descriptor() ([]byte, []int) { 126 | return file_proto_approach_v1_approach_proto_rawDescGZIP(), []int{0} 127 | } 128 | 129 | func (x *Plane) GetPlaneId() int32 { 130 | if x != nil { 131 | return x.PlaneId 132 | } 133 | return 0 134 | } 135 | 136 | func (x *Plane) GetLat() float64 { 137 | if x != nil { 138 | return x.Lat 139 | } 140 | return 0 141 | } 142 | 143 | func (x *Plane) GetLon() float64 { 144 | if x != nil { 145 | return x.Lon 146 | } 147 | return 0 148 | } 149 | 150 | func (x *Plane) GetAlt() float64 { 151 | if x != nil { 152 | return x.Alt 153 | } 154 | return 0 155 | } 156 | 157 | func (x *Plane) GetHeading() float64 { 158 | if x != nil { 159 | return x.Heading 160 | } 161 | return 0 162 | } 163 | 164 | func (x *Plane) GetGroundspeed() float64 { 165 | if x != nil { 166 | return x.Groundspeed 167 | } 168 | return 0 169 | } 170 | 171 | func (x *Plane) GetAgilityLevel() AgilityLevel { 172 | if x != nil { 173 | return x.AgilityLevel 174 | } 175 | return AgilityLevel_AGILITY_LEVEL_UNSPECIFIED 176 | } 177 | 178 | func (x *Plane) GetScore() float64 { 179 | if x != nil { 180 | return x.Score 181 | } 182 | return 0 183 | } 184 | 185 | func (x *Plane) GetIsInFov() bool { 186 | if x != nil { 187 | return x.IsInFov 188 | } 189 | return false 190 | } 191 | 192 | func (x *Plane) GetTargetDistance() float64 { 193 | if x != nil { 194 | return x.TargetDistance 195 | } 196 | return 0 197 | } 198 | 199 | func (x *Plane) GetAirspeed() float64 { 200 | if x != nil { 201 | return x.Airspeed 202 | } 203 | return 0 204 | } 205 | 206 | // GetPlanesRequest is the request that initializes a stream of 207 | // GetPlanesResponses 208 | type GetPlanesRequest struct { 209 | state protoimpl.MessageState 210 | sizeCache protoimpl.SizeCache 211 | unknownFields protoimpl.UnknownFields 212 | } 213 | 214 | func (x *GetPlanesRequest) Reset() { 215 | *x = GetPlanesRequest{} 216 | if protoimpl.UnsafeEnabled { 217 | mi := &file_proto_approach_v1_approach_proto_msgTypes[1] 218 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 219 | ms.StoreMessageInfo(mi) 220 | } 221 | } 222 | 223 | func (x *GetPlanesRequest) String() string { 224 | return protoimpl.X.MessageStringOf(x) 225 | } 226 | 227 | func (*GetPlanesRequest) ProtoMessage() {} 228 | 229 | func (x *GetPlanesRequest) ProtoReflect() protoreflect.Message { 230 | mi := &file_proto_approach_v1_approach_proto_msgTypes[1] 231 | if protoimpl.UnsafeEnabled && x != nil { 232 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 233 | if ms.LoadMessageInfo() == nil { 234 | ms.StoreMessageInfo(mi) 235 | } 236 | return ms 237 | } 238 | return mi.MessageOf(x) 239 | } 240 | 241 | // Deprecated: Use GetPlanesRequest.ProtoReflect.Descriptor instead. 242 | func (*GetPlanesRequest) Descriptor() ([]byte, []int) { 243 | return file_proto_approach_v1_approach_proto_rawDescGZIP(), []int{1} 244 | } 245 | 246 | // GetPlanesResponse has a list of planes and the selected plane id for any 247 | // point in time 248 | type GetPlanesResponse struct { 249 | state protoimpl.MessageState 250 | sizeCache protoimpl.SizeCache 251 | unknownFields protoimpl.UnknownFields 252 | 253 | Planes []*Plane `protobuf:"bytes,1,rep,name=planes,proto3" json:"planes,omitempty"` 254 | } 255 | 256 | func (x *GetPlanesResponse) Reset() { 257 | *x = GetPlanesResponse{} 258 | if protoimpl.UnsafeEnabled { 259 | mi := &file_proto_approach_v1_approach_proto_msgTypes[2] 260 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 261 | ms.StoreMessageInfo(mi) 262 | } 263 | } 264 | 265 | func (x *GetPlanesResponse) String() string { 266 | return protoimpl.X.MessageStringOf(x) 267 | } 268 | 269 | func (*GetPlanesResponse) ProtoMessage() {} 270 | 271 | func (x *GetPlanesResponse) ProtoReflect() protoreflect.Message { 272 | mi := &file_proto_approach_v1_approach_proto_msgTypes[2] 273 | if protoimpl.UnsafeEnabled && x != nil { 274 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 275 | if ms.LoadMessageInfo() == nil { 276 | ms.StoreMessageInfo(mi) 277 | } 278 | return ms 279 | } 280 | return mi.MessageOf(x) 281 | } 282 | 283 | // Deprecated: Use GetPlanesResponse.ProtoReflect.Descriptor instead. 284 | func (*GetPlanesResponse) Descriptor() ([]byte, []int) { 285 | return file_proto_approach_v1_approach_proto_rawDescGZIP(), []int{2} 286 | } 287 | 288 | func (x *GetPlanesResponse) GetPlanes() []*Plane { 289 | if x != nil { 290 | return x.Planes 291 | } 292 | return nil 293 | } 294 | 295 | type ApproachPlaneRequest struct { 296 | state protoimpl.MessageState 297 | sizeCache protoimpl.SizeCache 298 | unknownFields protoimpl.UnknownFields 299 | 300 | PlaneId int32 `protobuf:"varint,1,opt,name=plane_id,json=planeId,proto3" json:"plane_id,omitempty"` 301 | LockDistance int32 `protobuf:"varint,2,opt,name=lock_distance,json=lockDistance,proto3" json:"lock_distance,omitempty"` 302 | WillDetectGps bool `protobuf:"varint,3,opt,name=will_detect_gps,json=willDetectGps,proto3" json:"will_detect_gps,omitempty"` 303 | } 304 | 305 | func (x *ApproachPlaneRequest) Reset() { 306 | *x = ApproachPlaneRequest{} 307 | if protoimpl.UnsafeEnabled { 308 | mi := &file_proto_approach_v1_approach_proto_msgTypes[3] 309 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 310 | ms.StoreMessageInfo(mi) 311 | } 312 | } 313 | 314 | func (x *ApproachPlaneRequest) String() string { 315 | return protoimpl.X.MessageStringOf(x) 316 | } 317 | 318 | func (*ApproachPlaneRequest) ProtoMessage() {} 319 | 320 | func (x *ApproachPlaneRequest) ProtoReflect() protoreflect.Message { 321 | mi := &file_proto_approach_v1_approach_proto_msgTypes[3] 322 | if protoimpl.UnsafeEnabled && x != nil { 323 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 324 | if ms.LoadMessageInfo() == nil { 325 | ms.StoreMessageInfo(mi) 326 | } 327 | return ms 328 | } 329 | return mi.MessageOf(x) 330 | } 331 | 332 | // Deprecated: Use ApproachPlaneRequest.ProtoReflect.Descriptor instead. 333 | func (*ApproachPlaneRequest) Descriptor() ([]byte, []int) { 334 | return file_proto_approach_v1_approach_proto_rawDescGZIP(), []int{3} 335 | } 336 | 337 | func (x *ApproachPlaneRequest) GetPlaneId() int32 { 338 | if x != nil { 339 | return x.PlaneId 340 | } 341 | return 0 342 | } 343 | 344 | func (x *ApproachPlaneRequest) GetLockDistance() int32 { 345 | if x != nil { 346 | return x.LockDistance 347 | } 348 | return 0 349 | } 350 | 351 | func (x *ApproachPlaneRequest) GetWillDetectGps() bool { 352 | if x != nil { 353 | return x.WillDetectGps 354 | } 355 | return false 356 | } 357 | 358 | type ApproachPlaneResponse struct { 359 | state protoimpl.MessageState 360 | sizeCache protoimpl.SizeCache 361 | unknownFields protoimpl.UnknownFields 362 | 363 | CommandSucceeded bool `protobuf:"varint,1,opt,name=command_succeeded,json=commandSucceeded,proto3" json:"command_succeeded,omitempty"` 364 | Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` // Error message if command not succeeded. OK otherwise 365 | } 366 | 367 | func (x *ApproachPlaneResponse) Reset() { 368 | *x = ApproachPlaneResponse{} 369 | if protoimpl.UnsafeEnabled { 370 | mi := &file_proto_approach_v1_approach_proto_msgTypes[4] 371 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 372 | ms.StoreMessageInfo(mi) 373 | } 374 | } 375 | 376 | func (x *ApproachPlaneResponse) String() string { 377 | return protoimpl.X.MessageStringOf(x) 378 | } 379 | 380 | func (*ApproachPlaneResponse) ProtoMessage() {} 381 | 382 | func (x *ApproachPlaneResponse) ProtoReflect() protoreflect.Message { 383 | mi := &file_proto_approach_v1_approach_proto_msgTypes[4] 384 | if protoimpl.UnsafeEnabled && x != nil { 385 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 386 | if ms.LoadMessageInfo() == nil { 387 | ms.StoreMessageInfo(mi) 388 | } 389 | return ms 390 | } 391 | return mi.MessageOf(x) 392 | } 393 | 394 | // Deprecated: Use ApproachPlaneResponse.ProtoReflect.Descriptor instead. 395 | func (*ApproachPlaneResponse) Descriptor() ([]byte, []int) { 396 | return file_proto_approach_v1_approach_proto_rawDescGZIP(), []int{4} 397 | } 398 | 399 | func (x *ApproachPlaneResponse) GetCommandSucceeded() bool { 400 | if x != nil { 401 | return x.CommandSucceeded 402 | } 403 | return false 404 | } 405 | 406 | func (x *ApproachPlaneResponse) GetMsg() string { 407 | if x != nil { 408 | return x.Msg 409 | } 410 | return "" 411 | } 412 | 413 | var File_proto_approach_v1_approach_proto protoreflect.FileDescriptor 414 | 415 | var file_proto_approach_v1_approach_proto_rawDesc = []byte{ 416 | 0x0a, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 0x68, 417 | 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 0x68, 0x2e, 0x70, 0x72, 0x6f, 418 | 0x74, 0x6f, 0x12, 0x0b, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x22, 419 | 0xcb, 0x02, 0x0a, 0x05, 0x50, 0x6c, 0x61, 0x6e, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6c, 0x61, 420 | 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x6c, 0x61, 421 | 0x6e, 0x65, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 422 | 0x01, 0x52, 0x03, 0x6c, 0x61, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, 0x6e, 0x18, 0x03, 0x20, 423 | 0x01, 0x28, 0x01, 0x52, 0x03, 0x6c, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x74, 0x18, 424 | 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x61, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x65, 425 | 0x61, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x68, 0x65, 0x61, 426 | 0x64, 0x69, 0x6e, 0x67, 0x12, 0x20, 0x0a, 0x0b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x70, 427 | 0x65, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 428 | 0x64, 0x73, 0x70, 0x65, 0x65, 0x64, 0x12, 0x3e, 0x0a, 0x0d, 0x61, 0x67, 0x69, 0x6c, 0x69, 0x74, 429 | 0x79, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 430 | 0x61, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x67, 0x69, 0x6c, 431 | 0x69, 0x74, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0c, 0x61, 0x67, 0x69, 0x6c, 0x69, 0x74, 432 | 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 433 | 0x08, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x1a, 0x0a, 0x09, 434 | 0x69, 0x73, 0x5f, 0x69, 0x6e, 0x5f, 0x66, 0x6f, 0x76, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 435 | 0x07, 0x69, 0x73, 0x49, 0x6e, 0x46, 0x6f, 0x76, 0x12, 0x27, 0x0a, 0x0f, 0x74, 0x61, 0x72, 0x67, 436 | 0x65, 0x74, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 437 | 0x01, 0x52, 0x0e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 438 | 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x69, 0x72, 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, 0x0b, 0x20, 439 | 0x01, 0x28, 0x01, 0x52, 0x08, 0x61, 0x69, 0x72, 0x73, 0x70, 0x65, 0x65, 0x64, 0x22, 0x12, 0x0a, 440 | 0x10, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x61, 0x6e, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 441 | 0x74, 0x22, 0x3f, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x61, 0x6e, 0x65, 0x73, 0x52, 0x65, 442 | 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x73, 443 | 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 444 | 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x65, 0x52, 0x06, 0x70, 0x6c, 0x61, 0x6e, 445 | 0x65, 0x73, 0x22, 0x7e, 0x0a, 0x14, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 0x68, 0x50, 0x6c, 446 | 0x61, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6c, 447 | 0x61, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x6c, 448 | 0x61, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x64, 0x69, 449 | 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6c, 0x6f, 450 | 0x63, 0x6b, 0x44, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x77, 0x69, 451 | 0x6c, 0x6c, 0x5f, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x5f, 0x67, 0x70, 0x73, 0x18, 0x03, 0x20, 452 | 0x01, 0x28, 0x08, 0x52, 0x0d, 0x77, 0x69, 0x6c, 0x6c, 0x44, 0x65, 0x74, 0x65, 0x63, 0x74, 0x47, 453 | 0x70, 0x73, 0x22, 0x56, 0x0a, 0x15, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 0x68, 0x50, 0x6c, 454 | 0x61, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x63, 455 | 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x73, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 456 | 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x53, 457 | 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 458 | 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x2a, 0x76, 0x0a, 0x0c, 0x41, 0x67, 459 | 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1d, 0x0a, 0x19, 0x41, 0x47, 460 | 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 461 | 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x47, 0x49, 462 | 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x48, 0x49, 0x47, 0x48, 0x10, 463 | 0x01, 0x12, 0x18, 0x0a, 0x14, 0x41, 0x47, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x4c, 0x45, 0x56, 464 | 0x45, 0x4c, 0x5f, 0x4d, 0x45, 0x44, 0x49, 0x55, 0x4d, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x41, 465 | 0x47, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x4c, 0x4f, 0x57, 466 | 0x10, 0x03, 0x32, 0xb7, 0x01, 0x0a, 0x0f, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 0x68, 0x53, 467 | 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4c, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x61, 468 | 0x6e, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 0x68, 0x2e, 0x76, 469 | 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x61, 0x6e, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 470 | 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 0x68, 0x2e, 0x76, 0x31, 471 | 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x61, 0x6e, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 472 | 0x73, 0x65, 0x30, 0x01, 0x12, 0x56, 0x0a, 0x0d, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 0x68, 473 | 0x50, 0x6c, 0x61, 0x6e, 0x65, 0x12, 0x21, 0x2e, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 0x68, 474 | 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 0x68, 0x50, 0x6c, 0x61, 0x6e, 475 | 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x61, 0x70, 0x70, 0x72, 0x6f, 476 | 0x61, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 0x68, 0x50, 477 | 0x6c, 0x61, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xb7, 0x01, 0x0a, 478 | 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 0x68, 0x2e, 0x76, 0x31, 479 | 0x42, 0x0d, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 480 | 0x01, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x6f, 481 | 0x75, 0x73, 0x74, 0x65, 0x63, 0x68, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 482 | 0x64, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 483 | 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 0x68, 0x2f, 0x76, 0x31, 484 | 0x3b, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 0x68, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x58, 485 | 0x58, 0xaa, 0x02, 0x0b, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 0x68, 0x2e, 0x56, 0x31, 0xca, 486 | 0x02, 0x0b, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 0x68, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x17, 487 | 0x41, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 0x68, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 488 | 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x61, 489 | 0x63, 0x68, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 490 | } 491 | 492 | var ( 493 | file_proto_approach_v1_approach_proto_rawDescOnce sync.Once 494 | file_proto_approach_v1_approach_proto_rawDescData = file_proto_approach_v1_approach_proto_rawDesc 495 | ) 496 | 497 | func file_proto_approach_v1_approach_proto_rawDescGZIP() []byte { 498 | file_proto_approach_v1_approach_proto_rawDescOnce.Do(func() { 499 | file_proto_approach_v1_approach_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_approach_v1_approach_proto_rawDescData) 500 | }) 501 | return file_proto_approach_v1_approach_proto_rawDescData 502 | } 503 | 504 | var file_proto_approach_v1_approach_proto_enumTypes = make([]protoimpl.EnumInfo, 1) 505 | var file_proto_approach_v1_approach_proto_msgTypes = make([]protoimpl.MessageInfo, 5) 506 | var file_proto_approach_v1_approach_proto_goTypes = []any{ 507 | (AgilityLevel)(0), // 0: approach.v1.AgilityLevel 508 | (*Plane)(nil), // 1: approach.v1.Plane 509 | (*GetPlanesRequest)(nil), // 2: approach.v1.GetPlanesRequest 510 | (*GetPlanesResponse)(nil), // 3: approach.v1.GetPlanesResponse 511 | (*ApproachPlaneRequest)(nil), // 4: approach.v1.ApproachPlaneRequest 512 | (*ApproachPlaneResponse)(nil), // 5: approach.v1.ApproachPlaneResponse 513 | } 514 | var file_proto_approach_v1_approach_proto_depIdxs = []int32{ 515 | 0, // 0: approach.v1.Plane.agility_level:type_name -> approach.v1.AgilityLevel 516 | 1, // 1: approach.v1.GetPlanesResponse.planes:type_name -> approach.v1.Plane 517 | 2, // 2: approach.v1.ApproachService.GetPlanes:input_type -> approach.v1.GetPlanesRequest 518 | 4, // 3: approach.v1.ApproachService.ApproachPlane:input_type -> approach.v1.ApproachPlaneRequest 519 | 3, // 4: approach.v1.ApproachService.GetPlanes:output_type -> approach.v1.GetPlanesResponse 520 | 5, // 5: approach.v1.ApproachService.ApproachPlane:output_type -> approach.v1.ApproachPlaneResponse 521 | 4, // [4:6] is the sub-list for method output_type 522 | 2, // [2:4] is the sub-list for method input_type 523 | 2, // [2:2] is the sub-list for extension type_name 524 | 2, // [2:2] is the sub-list for extension extendee 525 | 0, // [0:2] is the sub-list for field type_name 526 | } 527 | 528 | func init() { file_proto_approach_v1_approach_proto_init() } 529 | func file_proto_approach_v1_approach_proto_init() { 530 | if File_proto_approach_v1_approach_proto != nil { 531 | return 532 | } 533 | if !protoimpl.UnsafeEnabled { 534 | file_proto_approach_v1_approach_proto_msgTypes[0].Exporter = func(v any, i int) any { 535 | switch v := v.(*Plane); i { 536 | case 0: 537 | return &v.state 538 | case 1: 539 | return &v.sizeCache 540 | case 2: 541 | return &v.unknownFields 542 | default: 543 | return nil 544 | } 545 | } 546 | file_proto_approach_v1_approach_proto_msgTypes[1].Exporter = func(v any, i int) any { 547 | switch v := v.(*GetPlanesRequest); i { 548 | case 0: 549 | return &v.state 550 | case 1: 551 | return &v.sizeCache 552 | case 2: 553 | return &v.unknownFields 554 | default: 555 | return nil 556 | } 557 | } 558 | file_proto_approach_v1_approach_proto_msgTypes[2].Exporter = func(v any, i int) any { 559 | switch v := v.(*GetPlanesResponse); i { 560 | case 0: 561 | return &v.state 562 | case 1: 563 | return &v.sizeCache 564 | case 2: 565 | return &v.unknownFields 566 | default: 567 | return nil 568 | } 569 | } 570 | file_proto_approach_v1_approach_proto_msgTypes[3].Exporter = func(v any, i int) any { 571 | switch v := v.(*ApproachPlaneRequest); i { 572 | case 0: 573 | return &v.state 574 | case 1: 575 | return &v.sizeCache 576 | case 2: 577 | return &v.unknownFields 578 | default: 579 | return nil 580 | } 581 | } 582 | file_proto_approach_v1_approach_proto_msgTypes[4].Exporter = func(v any, i int) any { 583 | switch v := v.(*ApproachPlaneResponse); i { 584 | case 0: 585 | return &v.state 586 | case 1: 587 | return &v.sizeCache 588 | case 2: 589 | return &v.unknownFields 590 | default: 591 | return nil 592 | } 593 | } 594 | } 595 | type x struct{} 596 | out := protoimpl.TypeBuilder{ 597 | File: protoimpl.DescBuilder{ 598 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 599 | RawDescriptor: file_proto_approach_v1_approach_proto_rawDesc, 600 | NumEnums: 1, 601 | NumMessages: 5, 602 | NumExtensions: 0, 603 | NumServices: 1, 604 | }, 605 | GoTypes: file_proto_approach_v1_approach_proto_goTypes, 606 | DependencyIndexes: file_proto_approach_v1_approach_proto_depIdxs, 607 | EnumInfos: file_proto_approach_v1_approach_proto_enumTypes, 608 | MessageInfos: file_proto_approach_v1_approach_proto_msgTypes, 609 | }.Build() 610 | File_proto_approach_v1_approach_proto = out.File 611 | file_proto_approach_v1_approach_proto_rawDesc = nil 612 | file_proto_approach_v1_approach_proto_goTypes = nil 613 | file_proto_approach_v1_approach_proto_depIdxs = nil 614 | } 615 | -------------------------------------------------------------------------------- /gen/go/proto/approach/v1/approach_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.5.1 4 | // - protoc (unknown) 5 | // source: proto/approach/v1/approach.proto 6 | 7 | package approachv1 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.64.0 or later. 19 | const _ = grpc.SupportPackageIsVersion9 20 | 21 | const ( 22 | ApproachService_GetPlanes_FullMethodName = "/approach.v1.ApproachService/GetPlanes" 23 | ApproachService_ApproachPlane_FullMethodName = "/approach.v1.ApproachService/ApproachPlane" 24 | ) 25 | 26 | // ApproachServiceClient is the client API for ApproachService service. 27 | // 28 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 29 | // 30 | // ApproachService is responsible for calculating and giving commands to 31 | // KOUSTECH's UAV to approach a target enemy UAV 32 | type ApproachServiceClient interface { 33 | // A server-streaming endpoint 34 | // Accepts a GetPlanesRequest and returns a stream of airplanes and their 35 | // properties, and the selected plane id if it exists 36 | GetPlanes(ctx context.Context, in *GetPlanesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetPlanesResponse], error) 37 | // ApproachPlane sends a command to approach the plane with specified ID 38 | ApproachPlane(ctx context.Context, in *ApproachPlaneRequest, opts ...grpc.CallOption) (*ApproachPlaneResponse, error) 39 | } 40 | 41 | type approachServiceClient struct { 42 | cc grpc.ClientConnInterface 43 | } 44 | 45 | func NewApproachServiceClient(cc grpc.ClientConnInterface) ApproachServiceClient { 46 | return &approachServiceClient{cc} 47 | } 48 | 49 | func (c *approachServiceClient) GetPlanes(ctx context.Context, in *GetPlanesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetPlanesResponse], error) { 50 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 51 | stream, err := c.cc.NewStream(ctx, &ApproachService_ServiceDesc.Streams[0], ApproachService_GetPlanes_FullMethodName, cOpts...) 52 | if err != nil { 53 | return nil, err 54 | } 55 | x := &grpc.GenericClientStream[GetPlanesRequest, GetPlanesResponse]{ClientStream: stream} 56 | if err := x.ClientStream.SendMsg(in); err != nil { 57 | return nil, err 58 | } 59 | if err := x.ClientStream.CloseSend(); err != nil { 60 | return nil, err 61 | } 62 | return x, nil 63 | } 64 | 65 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 66 | type ApproachService_GetPlanesClient = grpc.ServerStreamingClient[GetPlanesResponse] 67 | 68 | func (c *approachServiceClient) ApproachPlane(ctx context.Context, in *ApproachPlaneRequest, opts ...grpc.CallOption) (*ApproachPlaneResponse, error) { 69 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 70 | out := new(ApproachPlaneResponse) 71 | err := c.cc.Invoke(ctx, ApproachService_ApproachPlane_FullMethodName, in, out, cOpts...) 72 | if err != nil { 73 | return nil, err 74 | } 75 | return out, nil 76 | } 77 | 78 | // ApproachServiceServer is the server API for ApproachService service. 79 | // All implementations should embed UnimplementedApproachServiceServer 80 | // for forward compatibility. 81 | // 82 | // ApproachService is responsible for calculating and giving commands to 83 | // KOUSTECH's UAV to approach a target enemy UAV 84 | type ApproachServiceServer interface { 85 | // A server-streaming endpoint 86 | // Accepts a GetPlanesRequest and returns a stream of airplanes and their 87 | // properties, and the selected plane id if it exists 88 | GetPlanes(*GetPlanesRequest, grpc.ServerStreamingServer[GetPlanesResponse]) error 89 | // ApproachPlane sends a command to approach the plane with specified ID 90 | ApproachPlane(context.Context, *ApproachPlaneRequest) (*ApproachPlaneResponse, error) 91 | } 92 | 93 | // UnimplementedApproachServiceServer should be embedded to have 94 | // forward compatible implementations. 95 | // 96 | // NOTE: this should be embedded by value instead of pointer to avoid a nil 97 | // pointer dereference when methods are called. 98 | type UnimplementedApproachServiceServer struct{} 99 | 100 | func (UnimplementedApproachServiceServer) GetPlanes(*GetPlanesRequest, grpc.ServerStreamingServer[GetPlanesResponse]) error { 101 | return status.Errorf(codes.Unimplemented, "method GetPlanes not implemented") 102 | } 103 | func (UnimplementedApproachServiceServer) ApproachPlane(context.Context, *ApproachPlaneRequest) (*ApproachPlaneResponse, error) { 104 | return nil, status.Errorf(codes.Unimplemented, "method ApproachPlane not implemented") 105 | } 106 | func (UnimplementedApproachServiceServer) testEmbeddedByValue() {} 107 | 108 | // UnsafeApproachServiceServer may be embedded to opt out of forward compatibility for this service. 109 | // Use of this interface is not recommended, as added methods to ApproachServiceServer will 110 | // result in compilation errors. 111 | type UnsafeApproachServiceServer interface { 112 | mustEmbedUnimplementedApproachServiceServer() 113 | } 114 | 115 | func RegisterApproachServiceServer(s grpc.ServiceRegistrar, srv ApproachServiceServer) { 116 | // If the following call pancis, it indicates UnimplementedApproachServiceServer was 117 | // embedded by pointer and is nil. This will cause panics if an 118 | // unimplemented method is ever invoked, so we test this at initialization 119 | // time to prevent it from happening at runtime later due to I/O. 120 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 121 | t.testEmbeddedByValue() 122 | } 123 | s.RegisterService(&ApproachService_ServiceDesc, srv) 124 | } 125 | 126 | func _ApproachService_GetPlanes_Handler(srv interface{}, stream grpc.ServerStream) error { 127 | m := new(GetPlanesRequest) 128 | if err := stream.RecvMsg(m); err != nil { 129 | return err 130 | } 131 | return srv.(ApproachServiceServer).GetPlanes(m, &grpc.GenericServerStream[GetPlanesRequest, GetPlanesResponse]{ServerStream: stream}) 132 | } 133 | 134 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 135 | type ApproachService_GetPlanesServer = grpc.ServerStreamingServer[GetPlanesResponse] 136 | 137 | func _ApproachService_ApproachPlane_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 138 | in := new(ApproachPlaneRequest) 139 | if err := dec(in); err != nil { 140 | return nil, err 141 | } 142 | if interceptor == nil { 143 | return srv.(ApproachServiceServer).ApproachPlane(ctx, in) 144 | } 145 | info := &grpc.UnaryServerInfo{ 146 | Server: srv, 147 | FullMethod: ApproachService_ApproachPlane_FullMethodName, 148 | } 149 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 150 | return srv.(ApproachServiceServer).ApproachPlane(ctx, req.(*ApproachPlaneRequest)) 151 | } 152 | return interceptor(ctx, in, info, handler) 153 | } 154 | 155 | // ApproachService_ServiceDesc is the grpc.ServiceDesc for ApproachService service. 156 | // It's only intended for direct use with grpc.RegisterService, 157 | // and not to be introspected or modified (even as a copy) 158 | var ApproachService_ServiceDesc = grpc.ServiceDesc{ 159 | ServiceName: "approach.v1.ApproachService", 160 | HandlerType: (*ApproachServiceServer)(nil), 161 | Methods: []grpc.MethodDesc{ 162 | { 163 | MethodName: "ApproachPlane", 164 | Handler: _ApproachService_ApproachPlane_Handler, 165 | }, 166 | }, 167 | Streams: []grpc.StreamDesc{ 168 | { 169 | StreamName: "GetPlanes", 170 | Handler: _ApproachService_GetPlanes_Handler, 171 | ServerStreams: true, 172 | }, 173 | }, 174 | Metadata: "proto/approach/v1/approach.proto", 175 | } 176 | -------------------------------------------------------------------------------- /gen/go/proto/mastermind/v1/mastermind_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.5.1 4 | // - protoc (unknown) 5 | // source: proto/mastermind/v1/mastermind.proto 6 | 7 | package mastermindv1 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.64.0 or later. 19 | const _ = grpc.SupportPackageIsVersion9 20 | 21 | const ( 22 | MastermindService_UpdateState_FullMethodName = "/mastermind.v1.MastermindService/UpdateState" 23 | MastermindService_GetTelemetry_FullMethodName = "/mastermind.v1.MastermindService/GetTelemetry" 24 | MastermindService_GetDetailedTelemetry_FullMethodName = "/mastermind.v1.MastermindService/GetDetailedTelemetry" 25 | MastermindService_SetPIDLevel_FullMethodName = "/mastermind.v1.MastermindService/SetPIDLevel" 26 | MastermindService_SetSpeed_FullMethodName = "/mastermind.v1.MastermindService/SetSpeed" 27 | MastermindService_GotoWaypoint_FullMethodName = "/mastermind.v1.MastermindService/GotoWaypoint" 28 | MastermindService_SetAttitude_FullMethodName = "/mastermind.v1.MastermindService/SetAttitude" 29 | MastermindService_GetKamikazeStartTime_FullMethodName = "/mastermind.v1.MastermindService/GetKamikazeStartTime" 30 | MastermindService_DoKamikaze_FullMethodName = "/mastermind.v1.MastermindService/DoKamikaze" 31 | ) 32 | 33 | // MastermindServiceClient is the client API for MastermindService service. 34 | // 35 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 36 | type MastermindServiceClient interface { 37 | // A bidirectional stream 38 | // Accepts a stream of UpdateStateRequests during the competition, while 39 | // sending UpdateStateResponses whenever a valid StateTransition is submitted 40 | // by any client 41 | UpdateState(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[UpdateStateRequest, UpdateStateResponse], error) 42 | GetTelemetry(ctx context.Context, in *GetTelemetryRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetTelemetryResponse], error) 43 | // Returns a detailed telemetry response. SHOULD be used by services that 44 | // interact with the competiiton server 45 | GetDetailedTelemetry(ctx context.Context, in *GetDetailedTelemetryRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetDetailedTelemetryResponse], error) 46 | // SetPIDLevel sets the PID level for the plane 47 | SetPIDLevel(ctx context.Context, in *SetPIDLevelRequest, opts ...grpc.CallOption) (*SetPIDLevelResponse, error) 48 | // SetSpeed sets the plane's airspeed in m/s 49 | SetSpeed(ctx context.Context, in *SetSpeedRequest, opts ...grpc.CallOption) (*SetSpeedResponse, error) 50 | // GotoWaypoint commands the plane to go to specified waypoint 51 | GotoWaypoint(ctx context.Context, in *GotoWaypointRequest, opts ...grpc.CallOption) (*GotoWaypointResponse, error) 52 | // SetAttitude comannds the plane to change its attitude 53 | SetAttitude(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[SetAttitudeRequest, SetAttitudeResponse], error) 54 | GetKamikazeStartTime(ctx context.Context, in *GetKamikazeStartTimeRequest, opts ...grpc.CallOption) (*GetKamikazeStartTimeResponse, error) 55 | DoKamikaze(ctx context.Context, in *DoKamikazeRequest, opts ...grpc.CallOption) (*DoKamikazeResponse, error) 56 | } 57 | 58 | type mastermindServiceClient struct { 59 | cc grpc.ClientConnInterface 60 | } 61 | 62 | func NewMastermindServiceClient(cc grpc.ClientConnInterface) MastermindServiceClient { 63 | return &mastermindServiceClient{cc} 64 | } 65 | 66 | func (c *mastermindServiceClient) UpdateState(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[UpdateStateRequest, UpdateStateResponse], error) { 67 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 68 | stream, err := c.cc.NewStream(ctx, &MastermindService_ServiceDesc.Streams[0], MastermindService_UpdateState_FullMethodName, cOpts...) 69 | if err != nil { 70 | return nil, err 71 | } 72 | x := &grpc.GenericClientStream[UpdateStateRequest, UpdateStateResponse]{ClientStream: stream} 73 | return x, nil 74 | } 75 | 76 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 77 | type MastermindService_UpdateStateClient = grpc.BidiStreamingClient[UpdateStateRequest, UpdateStateResponse] 78 | 79 | func (c *mastermindServiceClient) GetTelemetry(ctx context.Context, in *GetTelemetryRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetTelemetryResponse], error) { 80 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 81 | stream, err := c.cc.NewStream(ctx, &MastermindService_ServiceDesc.Streams[1], MastermindService_GetTelemetry_FullMethodName, cOpts...) 82 | if err != nil { 83 | return nil, err 84 | } 85 | x := &grpc.GenericClientStream[GetTelemetryRequest, GetTelemetryResponse]{ClientStream: stream} 86 | if err := x.ClientStream.SendMsg(in); err != nil { 87 | return nil, err 88 | } 89 | if err := x.ClientStream.CloseSend(); err != nil { 90 | return nil, err 91 | } 92 | return x, nil 93 | } 94 | 95 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 96 | type MastermindService_GetTelemetryClient = grpc.ServerStreamingClient[GetTelemetryResponse] 97 | 98 | func (c *mastermindServiceClient) GetDetailedTelemetry(ctx context.Context, in *GetDetailedTelemetryRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetDetailedTelemetryResponse], error) { 99 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 100 | stream, err := c.cc.NewStream(ctx, &MastermindService_ServiceDesc.Streams[2], MastermindService_GetDetailedTelemetry_FullMethodName, cOpts...) 101 | if err != nil { 102 | return nil, err 103 | } 104 | x := &grpc.GenericClientStream[GetDetailedTelemetryRequest, GetDetailedTelemetryResponse]{ClientStream: stream} 105 | if err := x.ClientStream.SendMsg(in); err != nil { 106 | return nil, err 107 | } 108 | if err := x.ClientStream.CloseSend(); err != nil { 109 | return nil, err 110 | } 111 | return x, nil 112 | } 113 | 114 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 115 | type MastermindService_GetDetailedTelemetryClient = grpc.ServerStreamingClient[GetDetailedTelemetryResponse] 116 | 117 | func (c *mastermindServiceClient) SetPIDLevel(ctx context.Context, in *SetPIDLevelRequest, opts ...grpc.CallOption) (*SetPIDLevelResponse, error) { 118 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 119 | out := new(SetPIDLevelResponse) 120 | err := c.cc.Invoke(ctx, MastermindService_SetPIDLevel_FullMethodName, in, out, cOpts...) 121 | if err != nil { 122 | return nil, err 123 | } 124 | return out, nil 125 | } 126 | 127 | func (c *mastermindServiceClient) SetSpeed(ctx context.Context, in *SetSpeedRequest, opts ...grpc.CallOption) (*SetSpeedResponse, error) { 128 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 129 | out := new(SetSpeedResponse) 130 | err := c.cc.Invoke(ctx, MastermindService_SetSpeed_FullMethodName, in, out, cOpts...) 131 | if err != nil { 132 | return nil, err 133 | } 134 | return out, nil 135 | } 136 | 137 | func (c *mastermindServiceClient) GotoWaypoint(ctx context.Context, in *GotoWaypointRequest, opts ...grpc.CallOption) (*GotoWaypointResponse, error) { 138 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 139 | out := new(GotoWaypointResponse) 140 | err := c.cc.Invoke(ctx, MastermindService_GotoWaypoint_FullMethodName, in, out, cOpts...) 141 | if err != nil { 142 | return nil, err 143 | } 144 | return out, nil 145 | } 146 | 147 | func (c *mastermindServiceClient) SetAttitude(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[SetAttitudeRequest, SetAttitudeResponse], error) { 148 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 149 | stream, err := c.cc.NewStream(ctx, &MastermindService_ServiceDesc.Streams[3], MastermindService_SetAttitude_FullMethodName, cOpts...) 150 | if err != nil { 151 | return nil, err 152 | } 153 | x := &grpc.GenericClientStream[SetAttitudeRequest, SetAttitudeResponse]{ClientStream: stream} 154 | return x, nil 155 | } 156 | 157 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 158 | type MastermindService_SetAttitudeClient = grpc.ClientStreamingClient[SetAttitudeRequest, SetAttitudeResponse] 159 | 160 | func (c *mastermindServiceClient) GetKamikazeStartTime(ctx context.Context, in *GetKamikazeStartTimeRequest, opts ...grpc.CallOption) (*GetKamikazeStartTimeResponse, error) { 161 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 162 | out := new(GetKamikazeStartTimeResponse) 163 | err := c.cc.Invoke(ctx, MastermindService_GetKamikazeStartTime_FullMethodName, in, out, cOpts...) 164 | if err != nil { 165 | return nil, err 166 | } 167 | return out, nil 168 | } 169 | 170 | func (c *mastermindServiceClient) DoKamikaze(ctx context.Context, in *DoKamikazeRequest, opts ...grpc.CallOption) (*DoKamikazeResponse, error) { 171 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 172 | out := new(DoKamikazeResponse) 173 | err := c.cc.Invoke(ctx, MastermindService_DoKamikaze_FullMethodName, in, out, cOpts...) 174 | if err != nil { 175 | return nil, err 176 | } 177 | return out, nil 178 | } 179 | 180 | // MastermindServiceServer is the server API for MastermindService service. 181 | // All implementations should embed UnimplementedMastermindServiceServer 182 | // for forward compatibility. 183 | type MastermindServiceServer interface { 184 | // A bidirectional stream 185 | // Accepts a stream of UpdateStateRequests during the competition, while 186 | // sending UpdateStateResponses whenever a valid StateTransition is submitted 187 | // by any client 188 | UpdateState(grpc.BidiStreamingServer[UpdateStateRequest, UpdateStateResponse]) error 189 | GetTelemetry(*GetTelemetryRequest, grpc.ServerStreamingServer[GetTelemetryResponse]) error 190 | // Returns a detailed telemetry response. SHOULD be used by services that 191 | // interact with the competiiton server 192 | GetDetailedTelemetry(*GetDetailedTelemetryRequest, grpc.ServerStreamingServer[GetDetailedTelemetryResponse]) error 193 | // SetPIDLevel sets the PID level for the plane 194 | SetPIDLevel(context.Context, *SetPIDLevelRequest) (*SetPIDLevelResponse, error) 195 | // SetSpeed sets the plane's airspeed in m/s 196 | SetSpeed(context.Context, *SetSpeedRequest) (*SetSpeedResponse, error) 197 | // GotoWaypoint commands the plane to go to specified waypoint 198 | GotoWaypoint(context.Context, *GotoWaypointRequest) (*GotoWaypointResponse, error) 199 | // SetAttitude comannds the plane to change its attitude 200 | SetAttitude(grpc.ClientStreamingServer[SetAttitudeRequest, SetAttitudeResponse]) error 201 | GetKamikazeStartTime(context.Context, *GetKamikazeStartTimeRequest) (*GetKamikazeStartTimeResponse, error) 202 | DoKamikaze(context.Context, *DoKamikazeRequest) (*DoKamikazeResponse, error) 203 | } 204 | 205 | // UnimplementedMastermindServiceServer should be embedded to have 206 | // forward compatible implementations. 207 | // 208 | // NOTE: this should be embedded by value instead of pointer to avoid a nil 209 | // pointer dereference when methods are called. 210 | type UnimplementedMastermindServiceServer struct{} 211 | 212 | func (UnimplementedMastermindServiceServer) UpdateState(grpc.BidiStreamingServer[UpdateStateRequest, UpdateStateResponse]) error { 213 | return status.Errorf(codes.Unimplemented, "method UpdateState not implemented") 214 | } 215 | func (UnimplementedMastermindServiceServer) GetTelemetry(*GetTelemetryRequest, grpc.ServerStreamingServer[GetTelemetryResponse]) error { 216 | return status.Errorf(codes.Unimplemented, "method GetTelemetry not implemented") 217 | } 218 | func (UnimplementedMastermindServiceServer) GetDetailedTelemetry(*GetDetailedTelemetryRequest, grpc.ServerStreamingServer[GetDetailedTelemetryResponse]) error { 219 | return status.Errorf(codes.Unimplemented, "method GetDetailedTelemetry not implemented") 220 | } 221 | func (UnimplementedMastermindServiceServer) SetPIDLevel(context.Context, *SetPIDLevelRequest) (*SetPIDLevelResponse, error) { 222 | return nil, status.Errorf(codes.Unimplemented, "method SetPIDLevel not implemented") 223 | } 224 | func (UnimplementedMastermindServiceServer) SetSpeed(context.Context, *SetSpeedRequest) (*SetSpeedResponse, error) { 225 | return nil, status.Errorf(codes.Unimplemented, "method SetSpeed not implemented") 226 | } 227 | func (UnimplementedMastermindServiceServer) GotoWaypoint(context.Context, *GotoWaypointRequest) (*GotoWaypointResponse, error) { 228 | return nil, status.Errorf(codes.Unimplemented, "method GotoWaypoint not implemented") 229 | } 230 | func (UnimplementedMastermindServiceServer) SetAttitude(grpc.ClientStreamingServer[SetAttitudeRequest, SetAttitudeResponse]) error { 231 | return status.Errorf(codes.Unimplemented, "method SetAttitude not implemented") 232 | } 233 | func (UnimplementedMastermindServiceServer) GetKamikazeStartTime(context.Context, *GetKamikazeStartTimeRequest) (*GetKamikazeStartTimeResponse, error) { 234 | return nil, status.Errorf(codes.Unimplemented, "method GetKamikazeStartTime not implemented") 235 | } 236 | func (UnimplementedMastermindServiceServer) DoKamikaze(context.Context, *DoKamikazeRequest) (*DoKamikazeResponse, error) { 237 | return nil, status.Errorf(codes.Unimplemented, "method DoKamikaze not implemented") 238 | } 239 | func (UnimplementedMastermindServiceServer) testEmbeddedByValue() {} 240 | 241 | // UnsafeMastermindServiceServer may be embedded to opt out of forward compatibility for this service. 242 | // Use of this interface is not recommended, as added methods to MastermindServiceServer will 243 | // result in compilation errors. 244 | type UnsafeMastermindServiceServer interface { 245 | mustEmbedUnimplementedMastermindServiceServer() 246 | } 247 | 248 | func RegisterMastermindServiceServer(s grpc.ServiceRegistrar, srv MastermindServiceServer) { 249 | // If the following call pancis, it indicates UnimplementedMastermindServiceServer was 250 | // embedded by pointer and is nil. This will cause panics if an 251 | // unimplemented method is ever invoked, so we test this at initialization 252 | // time to prevent it from happening at runtime later due to I/O. 253 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 254 | t.testEmbeddedByValue() 255 | } 256 | s.RegisterService(&MastermindService_ServiceDesc, srv) 257 | } 258 | 259 | func _MastermindService_UpdateState_Handler(srv interface{}, stream grpc.ServerStream) error { 260 | return srv.(MastermindServiceServer).UpdateState(&grpc.GenericServerStream[UpdateStateRequest, UpdateStateResponse]{ServerStream: stream}) 261 | } 262 | 263 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 264 | type MastermindService_UpdateStateServer = grpc.BidiStreamingServer[UpdateStateRequest, UpdateStateResponse] 265 | 266 | func _MastermindService_GetTelemetry_Handler(srv interface{}, stream grpc.ServerStream) error { 267 | m := new(GetTelemetryRequest) 268 | if err := stream.RecvMsg(m); err != nil { 269 | return err 270 | } 271 | return srv.(MastermindServiceServer).GetTelemetry(m, &grpc.GenericServerStream[GetTelemetryRequest, GetTelemetryResponse]{ServerStream: stream}) 272 | } 273 | 274 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 275 | type MastermindService_GetTelemetryServer = grpc.ServerStreamingServer[GetTelemetryResponse] 276 | 277 | func _MastermindService_GetDetailedTelemetry_Handler(srv interface{}, stream grpc.ServerStream) error { 278 | m := new(GetDetailedTelemetryRequest) 279 | if err := stream.RecvMsg(m); err != nil { 280 | return err 281 | } 282 | return srv.(MastermindServiceServer).GetDetailedTelemetry(m, &grpc.GenericServerStream[GetDetailedTelemetryRequest, GetDetailedTelemetryResponse]{ServerStream: stream}) 283 | } 284 | 285 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 286 | type MastermindService_GetDetailedTelemetryServer = grpc.ServerStreamingServer[GetDetailedTelemetryResponse] 287 | 288 | func _MastermindService_SetPIDLevel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 289 | in := new(SetPIDLevelRequest) 290 | if err := dec(in); err != nil { 291 | return nil, err 292 | } 293 | if interceptor == nil { 294 | return srv.(MastermindServiceServer).SetPIDLevel(ctx, in) 295 | } 296 | info := &grpc.UnaryServerInfo{ 297 | Server: srv, 298 | FullMethod: MastermindService_SetPIDLevel_FullMethodName, 299 | } 300 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 301 | return srv.(MastermindServiceServer).SetPIDLevel(ctx, req.(*SetPIDLevelRequest)) 302 | } 303 | return interceptor(ctx, in, info, handler) 304 | } 305 | 306 | func _MastermindService_SetSpeed_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 307 | in := new(SetSpeedRequest) 308 | if err := dec(in); err != nil { 309 | return nil, err 310 | } 311 | if interceptor == nil { 312 | return srv.(MastermindServiceServer).SetSpeed(ctx, in) 313 | } 314 | info := &grpc.UnaryServerInfo{ 315 | Server: srv, 316 | FullMethod: MastermindService_SetSpeed_FullMethodName, 317 | } 318 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 319 | return srv.(MastermindServiceServer).SetSpeed(ctx, req.(*SetSpeedRequest)) 320 | } 321 | return interceptor(ctx, in, info, handler) 322 | } 323 | 324 | func _MastermindService_GotoWaypoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 325 | in := new(GotoWaypointRequest) 326 | if err := dec(in); err != nil { 327 | return nil, err 328 | } 329 | if interceptor == nil { 330 | return srv.(MastermindServiceServer).GotoWaypoint(ctx, in) 331 | } 332 | info := &grpc.UnaryServerInfo{ 333 | Server: srv, 334 | FullMethod: MastermindService_GotoWaypoint_FullMethodName, 335 | } 336 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 337 | return srv.(MastermindServiceServer).GotoWaypoint(ctx, req.(*GotoWaypointRequest)) 338 | } 339 | return interceptor(ctx, in, info, handler) 340 | } 341 | 342 | func _MastermindService_SetAttitude_Handler(srv interface{}, stream grpc.ServerStream) error { 343 | return srv.(MastermindServiceServer).SetAttitude(&grpc.GenericServerStream[SetAttitudeRequest, SetAttitudeResponse]{ServerStream: stream}) 344 | } 345 | 346 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 347 | type MastermindService_SetAttitudeServer = grpc.ClientStreamingServer[SetAttitudeRequest, SetAttitudeResponse] 348 | 349 | func _MastermindService_GetKamikazeStartTime_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 350 | in := new(GetKamikazeStartTimeRequest) 351 | if err := dec(in); err != nil { 352 | return nil, err 353 | } 354 | if interceptor == nil { 355 | return srv.(MastermindServiceServer).GetKamikazeStartTime(ctx, in) 356 | } 357 | info := &grpc.UnaryServerInfo{ 358 | Server: srv, 359 | FullMethod: MastermindService_GetKamikazeStartTime_FullMethodName, 360 | } 361 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 362 | return srv.(MastermindServiceServer).GetKamikazeStartTime(ctx, req.(*GetKamikazeStartTimeRequest)) 363 | } 364 | return interceptor(ctx, in, info, handler) 365 | } 366 | 367 | func _MastermindService_DoKamikaze_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 368 | in := new(DoKamikazeRequest) 369 | if err := dec(in); err != nil { 370 | return nil, err 371 | } 372 | if interceptor == nil { 373 | return srv.(MastermindServiceServer).DoKamikaze(ctx, in) 374 | } 375 | info := &grpc.UnaryServerInfo{ 376 | Server: srv, 377 | FullMethod: MastermindService_DoKamikaze_FullMethodName, 378 | } 379 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 380 | return srv.(MastermindServiceServer).DoKamikaze(ctx, req.(*DoKamikazeRequest)) 381 | } 382 | return interceptor(ctx, in, info, handler) 383 | } 384 | 385 | // MastermindService_ServiceDesc is the grpc.ServiceDesc for MastermindService service. 386 | // It's only intended for direct use with grpc.RegisterService, 387 | // and not to be introspected or modified (even as a copy) 388 | var MastermindService_ServiceDesc = grpc.ServiceDesc{ 389 | ServiceName: "mastermind.v1.MastermindService", 390 | HandlerType: (*MastermindServiceServer)(nil), 391 | Methods: []grpc.MethodDesc{ 392 | { 393 | MethodName: "SetPIDLevel", 394 | Handler: _MastermindService_SetPIDLevel_Handler, 395 | }, 396 | { 397 | MethodName: "SetSpeed", 398 | Handler: _MastermindService_SetSpeed_Handler, 399 | }, 400 | { 401 | MethodName: "GotoWaypoint", 402 | Handler: _MastermindService_GotoWaypoint_Handler, 403 | }, 404 | { 405 | MethodName: "GetKamikazeStartTime", 406 | Handler: _MastermindService_GetKamikazeStartTime_Handler, 407 | }, 408 | { 409 | MethodName: "DoKamikaze", 410 | Handler: _MastermindService_DoKamikaze_Handler, 411 | }, 412 | }, 413 | Streams: []grpc.StreamDesc{ 414 | { 415 | StreamName: "UpdateState", 416 | Handler: _MastermindService_UpdateState_Handler, 417 | ServerStreams: true, 418 | ClientStreams: true, 419 | }, 420 | { 421 | StreamName: "GetTelemetry", 422 | Handler: _MastermindService_GetTelemetry_Handler, 423 | ServerStreams: true, 424 | }, 425 | { 426 | StreamName: "GetDetailedTelemetry", 427 | Handler: _MastermindService_GetDetailedTelemetry_Handler, 428 | ServerStreams: true, 429 | }, 430 | { 431 | StreamName: "SetAttitude", 432 | Handler: _MastermindService_SetAttitude_Handler, 433 | ClientStreams: true, 434 | }, 435 | }, 436 | Metadata: "proto/mastermind/v1/mastermind.proto", 437 | } 438 | -------------------------------------------------------------------------------- /gen/go/proto/proxy/v1/proxy.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.34.2 4 | // protoc (unknown) 5 | // source: proto/proxy/v1/proxy.proto 6 | 7 | package proxyv1 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | ) 15 | 16 | const ( 17 | // Verify that this generated code is sufficiently up-to-date. 18 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 19 | // Verify that runtime/protoimpl is sufficiently up-to-date. 20 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 21 | ) 22 | 23 | type GetTelemetryRequest struct { 24 | state protoimpl.MessageState 25 | sizeCache protoimpl.SizeCache 26 | unknownFields protoimpl.UnknownFields 27 | } 28 | 29 | func (x *GetTelemetryRequest) Reset() { 30 | *x = GetTelemetryRequest{} 31 | if protoimpl.UnsafeEnabled { 32 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[0] 33 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 34 | ms.StoreMessageInfo(mi) 35 | } 36 | } 37 | 38 | func (x *GetTelemetryRequest) String() string { 39 | return protoimpl.X.MessageStringOf(x) 40 | } 41 | 42 | func (*GetTelemetryRequest) ProtoMessage() {} 43 | 44 | func (x *GetTelemetryRequest) ProtoReflect() protoreflect.Message { 45 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[0] 46 | if protoimpl.UnsafeEnabled && x != nil { 47 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 48 | if ms.LoadMessageInfo() == nil { 49 | ms.StoreMessageInfo(mi) 50 | } 51 | return ms 52 | } 53 | return mi.MessageOf(x) 54 | } 55 | 56 | // Deprecated: Use GetTelemetryRequest.ProtoReflect.Descriptor instead. 57 | func (*GetTelemetryRequest) Descriptor() ([]byte, []int) { 58 | return file_proto_proxy_v1_proxy_proto_rawDescGZIP(), []int{0} 59 | } 60 | 61 | type GetTelemetryResponse struct { 62 | state protoimpl.MessageState 63 | sizeCache protoimpl.SizeCache 64 | unknownFields protoimpl.UnknownFields 65 | 66 | TimeBootMs uint64 `protobuf:"varint,1,opt,name=time_boot_ms,json=timeBootMs,proto3" json:"time_boot_ms,omitempty"` // Timestamp of last message in milliseconds 67 | Lat int32 `protobuf:"varint,2,opt,name=lat,proto3" json:"lat,omitempty"` // Latitude in degrees * 10^7 68 | Lon int32 `protobuf:"varint,3,opt,name=lon,proto3" json:"lon,omitempty"` // Longitude in degrees * 10^7 69 | RelativeAlt int32 `protobuf:"varint,4,opt,name=relative_alt,json=relativeAlt,proto3" json:"relative_alt,omitempty"` // Altitude above ground in millimeters 70 | Roll float32 `protobuf:"fixed32,5,opt,name=roll,proto3" json:"roll,omitempty"` // Roll angle (-pi..+pi) 71 | Pitch float32 `protobuf:"fixed32,6,opt,name=pitch,proto3" json:"pitch,omitempty"` // Pitch angle (-pi..+pi) 72 | Yaw float32 `protobuf:"fixed32,7,opt,name=yaw,proto3" json:"yaw,omitempty"` // Yaw / heading angle from north (-pi..+pi) 73 | Airspeed float32 `protobuf:"fixed32,8,opt,name=airspeed,proto3" json:"airspeed,omitempty"` // Airspeed in m/s 74 | Groundspeed float32 `protobuf:"fixed32,9,opt,name=groundspeed,proto3" json:"groundspeed,omitempty"` // Groundspeed in m/s 75 | WpDist uint32 `protobuf:"varint,10,opt,name=wp_dist,json=wpDist,proto3" json:"wp_dist,omitempty"` // Distance to active waypoint in meters. 0 if no waypoint 76 | WindSpeed float32 `protobuf:"fixed32,11,opt,name=wind_speed,json=windSpeed,proto3" json:"wind_speed,omitempty"` // Wind speed in m/s 77 | WindDirection float32 `protobuf:"fixed32,12,opt,name=wind_direction,json=windDirection,proto3" json:"wind_direction,omitempty"` // Wind direction in degrees 78 | } 79 | 80 | func (x *GetTelemetryResponse) Reset() { 81 | *x = GetTelemetryResponse{} 82 | if protoimpl.UnsafeEnabled { 83 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[1] 84 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 85 | ms.StoreMessageInfo(mi) 86 | } 87 | } 88 | 89 | func (x *GetTelemetryResponse) String() string { 90 | return protoimpl.X.MessageStringOf(x) 91 | } 92 | 93 | func (*GetTelemetryResponse) ProtoMessage() {} 94 | 95 | func (x *GetTelemetryResponse) ProtoReflect() protoreflect.Message { 96 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[1] 97 | if protoimpl.UnsafeEnabled && x != nil { 98 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 99 | if ms.LoadMessageInfo() == nil { 100 | ms.StoreMessageInfo(mi) 101 | } 102 | return ms 103 | } 104 | return mi.MessageOf(x) 105 | } 106 | 107 | // Deprecated: Use GetTelemetryResponse.ProtoReflect.Descriptor instead. 108 | func (*GetTelemetryResponse) Descriptor() ([]byte, []int) { 109 | return file_proto_proxy_v1_proxy_proto_rawDescGZIP(), []int{1} 110 | } 111 | 112 | func (x *GetTelemetryResponse) GetTimeBootMs() uint64 { 113 | if x != nil { 114 | return x.TimeBootMs 115 | } 116 | return 0 117 | } 118 | 119 | func (x *GetTelemetryResponse) GetLat() int32 { 120 | if x != nil { 121 | return x.Lat 122 | } 123 | return 0 124 | } 125 | 126 | func (x *GetTelemetryResponse) GetLon() int32 { 127 | if x != nil { 128 | return x.Lon 129 | } 130 | return 0 131 | } 132 | 133 | func (x *GetTelemetryResponse) GetRelativeAlt() int32 { 134 | if x != nil { 135 | return x.RelativeAlt 136 | } 137 | return 0 138 | } 139 | 140 | func (x *GetTelemetryResponse) GetRoll() float32 { 141 | if x != nil { 142 | return x.Roll 143 | } 144 | return 0 145 | } 146 | 147 | func (x *GetTelemetryResponse) GetPitch() float32 { 148 | if x != nil { 149 | return x.Pitch 150 | } 151 | return 0 152 | } 153 | 154 | func (x *GetTelemetryResponse) GetYaw() float32 { 155 | if x != nil { 156 | return x.Yaw 157 | } 158 | return 0 159 | } 160 | 161 | func (x *GetTelemetryResponse) GetAirspeed() float32 { 162 | if x != nil { 163 | return x.Airspeed 164 | } 165 | return 0 166 | } 167 | 168 | func (x *GetTelemetryResponse) GetGroundspeed() float32 { 169 | if x != nil { 170 | return x.Groundspeed 171 | } 172 | return 0 173 | } 174 | 175 | func (x *GetTelemetryResponse) GetWpDist() uint32 { 176 | if x != nil { 177 | return x.WpDist 178 | } 179 | return 0 180 | } 181 | 182 | func (x *GetTelemetryResponse) GetWindSpeed() float32 { 183 | if x != nil { 184 | return x.WindSpeed 185 | } 186 | return 0 187 | } 188 | 189 | func (x *GetTelemetryResponse) GetWindDirection() float32 { 190 | if x != nil { 191 | return x.WindDirection 192 | } 193 | return 0 194 | } 195 | 196 | // Target is a target being locked onto by the UAV 197 | type Target struct { 198 | state protoimpl.MessageState 199 | sizeCache protoimpl.SizeCache 200 | unknownFields protoimpl.UnknownFields 201 | 202 | X uint32 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` // x coordinate of center of bounding box in pixels 203 | Y uint32 `protobuf:"varint,2,opt,name=y,proto3" json:"y,omitempty"` // y coordinate of center of bounding box in pixels 204 | Width uint32 `protobuf:"varint,3,opt,name=width,proto3" json:"width,omitempty"` // width of target bounding box in pixels 205 | Height uint32 `protobuf:"varint,4,opt,name=height,proto3" json:"height,omitempty"` // height of target bounding box in pixels 206 | } 207 | 208 | func (x *Target) Reset() { 209 | *x = Target{} 210 | if protoimpl.UnsafeEnabled { 211 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[2] 212 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 213 | ms.StoreMessageInfo(mi) 214 | } 215 | } 216 | 217 | func (x *Target) String() string { 218 | return protoimpl.X.MessageStringOf(x) 219 | } 220 | 221 | func (*Target) ProtoMessage() {} 222 | 223 | func (x *Target) ProtoReflect() protoreflect.Message { 224 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[2] 225 | if protoimpl.UnsafeEnabled && x != nil { 226 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 227 | if ms.LoadMessageInfo() == nil { 228 | ms.StoreMessageInfo(mi) 229 | } 230 | return ms 231 | } 232 | return mi.MessageOf(x) 233 | } 234 | 235 | // Deprecated: Use Target.ProtoReflect.Descriptor instead. 236 | func (*Target) Descriptor() ([]byte, []int) { 237 | return file_proto_proxy_v1_proxy_proto_rawDescGZIP(), []int{2} 238 | } 239 | 240 | func (x *Target) GetX() uint32 { 241 | if x != nil { 242 | return x.X 243 | } 244 | return 0 245 | } 246 | 247 | func (x *Target) GetY() uint32 { 248 | if x != nil { 249 | return x.Y 250 | } 251 | return 0 252 | } 253 | 254 | func (x *Target) GetWidth() uint32 { 255 | if x != nil { 256 | return x.Width 257 | } 258 | return 0 259 | } 260 | 261 | func (x *Target) GetHeight() uint32 { 262 | if x != nil { 263 | return x.Height 264 | } 265 | return 0 266 | } 267 | 268 | type GetDetailedTelemetryRequest struct { 269 | state protoimpl.MessageState 270 | sizeCache protoimpl.SizeCache 271 | unknownFields protoimpl.UnknownFields 272 | } 273 | 274 | func (x *GetDetailedTelemetryRequest) Reset() { 275 | *x = GetDetailedTelemetryRequest{} 276 | if protoimpl.UnsafeEnabled { 277 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[3] 278 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 279 | ms.StoreMessageInfo(mi) 280 | } 281 | } 282 | 283 | func (x *GetDetailedTelemetryRequest) String() string { 284 | return protoimpl.X.MessageStringOf(x) 285 | } 286 | 287 | func (*GetDetailedTelemetryRequest) ProtoMessage() {} 288 | 289 | func (x *GetDetailedTelemetryRequest) ProtoReflect() protoreflect.Message { 290 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[3] 291 | if protoimpl.UnsafeEnabled && x != nil { 292 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 293 | if ms.LoadMessageInfo() == nil { 294 | ms.StoreMessageInfo(mi) 295 | } 296 | return ms 297 | } 298 | return mi.MessageOf(x) 299 | } 300 | 301 | // Deprecated: Use GetDetailedTelemetryRequest.ProtoReflect.Descriptor instead. 302 | func (*GetDetailedTelemetryRequest) Descriptor() ([]byte, []int) { 303 | return file_proto_proxy_v1_proxy_proto_rawDescGZIP(), []int{3} 304 | } 305 | 306 | type GetDetailedTelemetryResponse struct { 307 | state protoimpl.MessageState 308 | sizeCache protoimpl.SizeCache 309 | unknownFields protoimpl.UnknownFields 310 | 311 | TimeBootMs uint64 `protobuf:"varint,1,opt,name=time_boot_ms,json=timeBootMs,proto3" json:"time_boot_ms,omitempty"` // Timestamp of last message in milliseconds 312 | Lat int32 `protobuf:"varint,2,opt,name=lat,proto3" json:"lat,omitempty"` // Latitude in degrees * 10^7 313 | Lon int32 `protobuf:"varint,3,opt,name=lon,proto3" json:"lon,omitempty"` // Longitude in degrees * 10^7 314 | RelativeAlt int32 `protobuf:"varint,4,opt,name=relative_alt,json=relativeAlt,proto3" json:"relative_alt,omitempty"` // Altitude above ground in millimeters 315 | Roll float32 `protobuf:"fixed32,5,opt,name=roll,proto3" json:"roll,omitempty"` // Roll angle (-pi..+pi) 316 | Pitch float32 `protobuf:"fixed32,6,opt,name=pitch,proto3" json:"pitch,omitempty"` // Pitch angle (-pi..+pi) 317 | Yaw float32 `protobuf:"fixed32,7,opt,name=yaw,proto3" json:"yaw,omitempty"` // Yaw / heading angle from north (-pi..+pi) 318 | Airspeed float32 `protobuf:"fixed32,8,opt,name=airspeed,proto3" json:"airspeed,omitempty"` // Airspeed in m/s 319 | Groundspeed float32 `protobuf:"fixed32,9,opt,name=groundspeed,proto3" json:"groundspeed,omitempty"` // Groundspeed in m/s 320 | WpDist uint32 `protobuf:"varint,10,opt,name=wp_dist,json=wpDist,proto3" json:"wp_dist,omitempty"` // Distance to active waypoint in meters. 0 if no waypoint 321 | Battery int32 `protobuf:"varint,11,opt,name=battery,proto3" json:"battery,omitempty"` // Remaining battery energy. Values: [0-100], -1: 322 | // autopilot does not estimate the remaining battery. 323 | Autonomous bool `protobuf:"varint,12,opt,name=autonomous,proto3" json:"autonomous,omitempty"` // True if the UAV is in a mode being controlled 324 | // autonomously, False otherwise 325 | Target *Target `protobuf:"bytes,13,opt,name=target,proto3,oneof" json:"target,omitempty"` // Target being locked on by the UAV 326 | WindSpeed float32 `protobuf:"fixed32,14,opt,name=wind_speed,json=windSpeed,proto3" json:"wind_speed,omitempty"` // Wind speed in m/s 327 | WindDirection float32 `protobuf:"fixed32,15,opt,name=wind_direction,json=windDirection,proto3" json:"wind_direction,omitempty"` // Wind direction in degrees 328 | } 329 | 330 | func (x *GetDetailedTelemetryResponse) Reset() { 331 | *x = GetDetailedTelemetryResponse{} 332 | if protoimpl.UnsafeEnabled { 333 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[4] 334 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 335 | ms.StoreMessageInfo(mi) 336 | } 337 | } 338 | 339 | func (x *GetDetailedTelemetryResponse) String() string { 340 | return protoimpl.X.MessageStringOf(x) 341 | } 342 | 343 | func (*GetDetailedTelemetryResponse) ProtoMessage() {} 344 | 345 | func (x *GetDetailedTelemetryResponse) ProtoReflect() protoreflect.Message { 346 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[4] 347 | if protoimpl.UnsafeEnabled && x != nil { 348 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 349 | if ms.LoadMessageInfo() == nil { 350 | ms.StoreMessageInfo(mi) 351 | } 352 | return ms 353 | } 354 | return mi.MessageOf(x) 355 | } 356 | 357 | // Deprecated: Use GetDetailedTelemetryResponse.ProtoReflect.Descriptor instead. 358 | func (*GetDetailedTelemetryResponse) Descriptor() ([]byte, []int) { 359 | return file_proto_proxy_v1_proxy_proto_rawDescGZIP(), []int{4} 360 | } 361 | 362 | func (x *GetDetailedTelemetryResponse) GetTimeBootMs() uint64 { 363 | if x != nil { 364 | return x.TimeBootMs 365 | } 366 | return 0 367 | } 368 | 369 | func (x *GetDetailedTelemetryResponse) GetLat() int32 { 370 | if x != nil { 371 | return x.Lat 372 | } 373 | return 0 374 | } 375 | 376 | func (x *GetDetailedTelemetryResponse) GetLon() int32 { 377 | if x != nil { 378 | return x.Lon 379 | } 380 | return 0 381 | } 382 | 383 | func (x *GetDetailedTelemetryResponse) GetRelativeAlt() int32 { 384 | if x != nil { 385 | return x.RelativeAlt 386 | } 387 | return 0 388 | } 389 | 390 | func (x *GetDetailedTelemetryResponse) GetRoll() float32 { 391 | if x != nil { 392 | return x.Roll 393 | } 394 | return 0 395 | } 396 | 397 | func (x *GetDetailedTelemetryResponse) GetPitch() float32 { 398 | if x != nil { 399 | return x.Pitch 400 | } 401 | return 0 402 | } 403 | 404 | func (x *GetDetailedTelemetryResponse) GetYaw() float32 { 405 | if x != nil { 406 | return x.Yaw 407 | } 408 | return 0 409 | } 410 | 411 | func (x *GetDetailedTelemetryResponse) GetAirspeed() float32 { 412 | if x != nil { 413 | return x.Airspeed 414 | } 415 | return 0 416 | } 417 | 418 | func (x *GetDetailedTelemetryResponse) GetGroundspeed() float32 { 419 | if x != nil { 420 | return x.Groundspeed 421 | } 422 | return 0 423 | } 424 | 425 | func (x *GetDetailedTelemetryResponse) GetWpDist() uint32 { 426 | if x != nil { 427 | return x.WpDist 428 | } 429 | return 0 430 | } 431 | 432 | func (x *GetDetailedTelemetryResponse) GetBattery() int32 { 433 | if x != nil { 434 | return x.Battery 435 | } 436 | return 0 437 | } 438 | 439 | func (x *GetDetailedTelemetryResponse) GetAutonomous() bool { 440 | if x != nil { 441 | return x.Autonomous 442 | } 443 | return false 444 | } 445 | 446 | func (x *GetDetailedTelemetryResponse) GetTarget() *Target { 447 | if x != nil { 448 | return x.Target 449 | } 450 | return nil 451 | } 452 | 453 | func (x *GetDetailedTelemetryResponse) GetWindSpeed() float32 { 454 | if x != nil { 455 | return x.WindSpeed 456 | } 457 | return 0 458 | } 459 | 460 | func (x *GetDetailedTelemetryResponse) GetWindDirection() float32 { 461 | if x != nil { 462 | return x.WindDirection 463 | } 464 | return 0 465 | } 466 | 467 | // EnemyPlane represents an enemy plane's telemetry obtained from the 468 | // competition server 469 | type EnemyPlane struct { 470 | state protoimpl.MessageState 471 | sizeCache protoimpl.SizeCache 472 | unknownFields protoimpl.UnknownFields 473 | 474 | TeamId int32 `protobuf:"zigzag32,1,opt,name=team_id,json=teamId,proto3" json:"team_id,omitempty"` // Team ID of the enemy plane 475 | Lat float64 `protobuf:"fixed64,2,opt,name=lat,proto3" json:"lat,omitempty"` // Latitude of the enemy plane in degrees 476 | Lon float64 `protobuf:"fixed64,3,opt,name=lon,proto3" json:"lon,omitempty"` // Longitude of the enemy plane in degrees 477 | Alt float64 `protobuf:"fixed64,4,opt,name=alt,proto3" json:"alt,omitempty"` // Altitude of the enemy plane in meters relative to ground 478 | Pitch float64 `protobuf:"fixed64,5,opt,name=pitch,proto3" json:"pitch,omitempty"` // Pitch angle of the enemy plane in degrees 479 | Roll float64 `protobuf:"fixed64,6,opt,name=roll,proto3" json:"roll,omitempty"` // Roll angle of the enemy plane in degrees 480 | Yaw float64 `protobuf:"fixed64,7,opt,name=yaw,proto3" json:"yaw,omitempty"` // Yaw angle of the enemy plane in degrees 481 | TimeDiff int32 `protobuf:"varint,8,opt,name=time_diff,json=timeDiff,proto3" json:"time_diff,omitempty"` // Time difference between the UAV and the enemy plane 482 | Groundspeed float64 `protobuf:"fixed64,9,opt,name=groundspeed,proto3" json:"groundspeed,omitempty"` // Groundspeed in m/s 483 | } 484 | 485 | func (x *EnemyPlane) Reset() { 486 | *x = EnemyPlane{} 487 | if protoimpl.UnsafeEnabled { 488 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[5] 489 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 490 | ms.StoreMessageInfo(mi) 491 | } 492 | } 493 | 494 | func (x *EnemyPlane) String() string { 495 | return protoimpl.X.MessageStringOf(x) 496 | } 497 | 498 | func (*EnemyPlane) ProtoMessage() {} 499 | 500 | func (x *EnemyPlane) ProtoReflect() protoreflect.Message { 501 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[5] 502 | if protoimpl.UnsafeEnabled && x != nil { 503 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 504 | if ms.LoadMessageInfo() == nil { 505 | ms.StoreMessageInfo(mi) 506 | } 507 | return ms 508 | } 509 | return mi.MessageOf(x) 510 | } 511 | 512 | // Deprecated: Use EnemyPlane.ProtoReflect.Descriptor instead. 513 | func (*EnemyPlane) Descriptor() ([]byte, []int) { 514 | return file_proto_proxy_v1_proxy_proto_rawDescGZIP(), []int{5} 515 | } 516 | 517 | func (x *EnemyPlane) GetTeamId() int32 { 518 | if x != nil { 519 | return x.TeamId 520 | } 521 | return 0 522 | } 523 | 524 | func (x *EnemyPlane) GetLat() float64 { 525 | if x != nil { 526 | return x.Lat 527 | } 528 | return 0 529 | } 530 | 531 | func (x *EnemyPlane) GetLon() float64 { 532 | if x != nil { 533 | return x.Lon 534 | } 535 | return 0 536 | } 537 | 538 | func (x *EnemyPlane) GetAlt() float64 { 539 | if x != nil { 540 | return x.Alt 541 | } 542 | return 0 543 | } 544 | 545 | func (x *EnemyPlane) GetPitch() float64 { 546 | if x != nil { 547 | return x.Pitch 548 | } 549 | return 0 550 | } 551 | 552 | func (x *EnemyPlane) GetRoll() float64 { 553 | if x != nil { 554 | return x.Roll 555 | } 556 | return 0 557 | } 558 | 559 | func (x *EnemyPlane) GetYaw() float64 { 560 | if x != nil { 561 | return x.Yaw 562 | } 563 | return 0 564 | } 565 | 566 | func (x *EnemyPlane) GetTimeDiff() int32 { 567 | if x != nil { 568 | return x.TimeDiff 569 | } 570 | return 0 571 | } 572 | 573 | func (x *EnemyPlane) GetGroundspeed() float64 { 574 | if x != nil { 575 | return x.Groundspeed 576 | } 577 | return 0 578 | } 579 | 580 | type Time struct { 581 | state protoimpl.MessageState 582 | sizeCache protoimpl.SizeCache 583 | unknownFields protoimpl.UnknownFields 584 | 585 | Hour uint32 `protobuf:"varint,1,opt,name=hour,proto3" json:"hour,omitempty"` 586 | Minute uint32 `protobuf:"varint,2,opt,name=minute,proto3" json:"minute,omitempty"` 587 | Second uint32 `protobuf:"varint,3,opt,name=second,proto3" json:"second,omitempty"` 588 | Millisecond uint32 `protobuf:"varint,4,opt,name=millisecond,proto3" json:"millisecond,omitempty"` 589 | } 590 | 591 | func (x *Time) Reset() { 592 | *x = Time{} 593 | if protoimpl.UnsafeEnabled { 594 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[6] 595 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 596 | ms.StoreMessageInfo(mi) 597 | } 598 | } 599 | 600 | func (x *Time) String() string { 601 | return protoimpl.X.MessageStringOf(x) 602 | } 603 | 604 | func (*Time) ProtoMessage() {} 605 | 606 | func (x *Time) ProtoReflect() protoreflect.Message { 607 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[6] 608 | if protoimpl.UnsafeEnabled && x != nil { 609 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 610 | if ms.LoadMessageInfo() == nil { 611 | ms.StoreMessageInfo(mi) 612 | } 613 | return ms 614 | } 615 | return mi.MessageOf(x) 616 | } 617 | 618 | // Deprecated: Use Time.ProtoReflect.Descriptor instead. 619 | func (*Time) Descriptor() ([]byte, []int) { 620 | return file_proto_proxy_v1_proxy_proto_rawDescGZIP(), []int{6} 621 | } 622 | 623 | func (x *Time) GetHour() uint32 { 624 | if x != nil { 625 | return x.Hour 626 | } 627 | return 0 628 | } 629 | 630 | func (x *Time) GetMinute() uint32 { 631 | if x != nil { 632 | return x.Minute 633 | } 634 | return 0 635 | } 636 | 637 | func (x *Time) GetSecond() uint32 { 638 | if x != nil { 639 | return x.Second 640 | } 641 | return 0 642 | } 643 | 644 | func (x *Time) GetMillisecond() uint32 { 645 | if x != nil { 646 | return x.Millisecond 647 | } 648 | return 0 649 | } 650 | 651 | type GetEnemyTelemetryRequest struct { 652 | state protoimpl.MessageState 653 | sizeCache protoimpl.SizeCache 654 | unknownFields protoimpl.UnknownFields 655 | } 656 | 657 | func (x *GetEnemyTelemetryRequest) Reset() { 658 | *x = GetEnemyTelemetryRequest{} 659 | if protoimpl.UnsafeEnabled { 660 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[7] 661 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 662 | ms.StoreMessageInfo(mi) 663 | } 664 | } 665 | 666 | func (x *GetEnemyTelemetryRequest) String() string { 667 | return protoimpl.X.MessageStringOf(x) 668 | } 669 | 670 | func (*GetEnemyTelemetryRequest) ProtoMessage() {} 671 | 672 | func (x *GetEnemyTelemetryRequest) ProtoReflect() protoreflect.Message { 673 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[7] 674 | if protoimpl.UnsafeEnabled && x != nil { 675 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 676 | if ms.LoadMessageInfo() == nil { 677 | ms.StoreMessageInfo(mi) 678 | } 679 | return ms 680 | } 681 | return mi.MessageOf(x) 682 | } 683 | 684 | // Deprecated: Use GetEnemyTelemetryRequest.ProtoReflect.Descriptor instead. 685 | func (*GetEnemyTelemetryRequest) Descriptor() ([]byte, []int) { 686 | return file_proto_proxy_v1_proxy_proto_rawDescGZIP(), []int{7} 687 | } 688 | 689 | type GetEnemyTelemetryResponse struct { 690 | state protoimpl.MessageState 691 | sizeCache protoimpl.SizeCache 692 | unknownFields protoimpl.UnknownFields 693 | 694 | ServerTime *Time `protobuf:"bytes,1,opt,name=server_time,json=serverTime,proto3" json:"server_time,omitempty"` 695 | EnemyPlanes []*EnemyPlane `protobuf:"bytes,2,rep,name=enemy_planes,json=enemyPlanes,proto3" json:"enemy_planes,omitempty"` 696 | } 697 | 698 | func (x *GetEnemyTelemetryResponse) Reset() { 699 | *x = GetEnemyTelemetryResponse{} 700 | if protoimpl.UnsafeEnabled { 701 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[8] 702 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 703 | ms.StoreMessageInfo(mi) 704 | } 705 | } 706 | 707 | func (x *GetEnemyTelemetryResponse) String() string { 708 | return protoimpl.X.MessageStringOf(x) 709 | } 710 | 711 | func (*GetEnemyTelemetryResponse) ProtoMessage() {} 712 | 713 | func (x *GetEnemyTelemetryResponse) ProtoReflect() protoreflect.Message { 714 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[8] 715 | if protoimpl.UnsafeEnabled && x != nil { 716 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 717 | if ms.LoadMessageInfo() == nil { 718 | ms.StoreMessageInfo(mi) 719 | } 720 | return ms 721 | } 722 | return mi.MessageOf(x) 723 | } 724 | 725 | // Deprecated: Use GetEnemyTelemetryResponse.ProtoReflect.Descriptor instead. 726 | func (*GetEnemyTelemetryResponse) Descriptor() ([]byte, []int) { 727 | return file_proto_proxy_v1_proxy_proto_rawDescGZIP(), []int{8} 728 | } 729 | 730 | func (x *GetEnemyTelemetryResponse) GetServerTime() *Time { 731 | if x != nil { 732 | return x.ServerTime 733 | } 734 | return nil 735 | } 736 | 737 | func (x *GetEnemyTelemetryResponse) GetEnemyPlanes() []*EnemyPlane { 738 | if x != nil { 739 | return x.EnemyPlanes 740 | } 741 | return nil 742 | } 743 | 744 | // SendLockPacketRequest includes the data to be sent to the competition server on successful lock 745 | type SendLockPacketRequest struct { 746 | state protoimpl.MessageState 747 | sizeCache protoimpl.SizeCache 748 | unknownFields protoimpl.UnknownFields 749 | 750 | LockStartTime *Time `protobuf:"bytes,1,opt,name=lock_start_time,json=lockStartTime,proto3" json:"lock_start_time,omitempty"` 751 | LockEndTime *Time `protobuf:"bytes,2,opt,name=lock_end_time,json=lockEndTime,proto3" json:"lock_end_time,omitempty"` 752 | IsAutonomous bool `protobuf:"varint,3,opt,name=is_autonomous,json=isAutonomous,proto3" json:"is_autonomous,omitempty"` 753 | } 754 | 755 | func (x *SendLockPacketRequest) Reset() { 756 | *x = SendLockPacketRequest{} 757 | if protoimpl.UnsafeEnabled { 758 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[9] 759 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 760 | ms.StoreMessageInfo(mi) 761 | } 762 | } 763 | 764 | func (x *SendLockPacketRequest) String() string { 765 | return protoimpl.X.MessageStringOf(x) 766 | } 767 | 768 | func (*SendLockPacketRequest) ProtoMessage() {} 769 | 770 | func (x *SendLockPacketRequest) ProtoReflect() protoreflect.Message { 771 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[9] 772 | if protoimpl.UnsafeEnabled && x != nil { 773 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 774 | if ms.LoadMessageInfo() == nil { 775 | ms.StoreMessageInfo(mi) 776 | } 777 | return ms 778 | } 779 | return mi.MessageOf(x) 780 | } 781 | 782 | // Deprecated: Use SendLockPacketRequest.ProtoReflect.Descriptor instead. 783 | func (*SendLockPacketRequest) Descriptor() ([]byte, []int) { 784 | return file_proto_proxy_v1_proxy_proto_rawDescGZIP(), []int{9} 785 | } 786 | 787 | func (x *SendLockPacketRequest) GetLockStartTime() *Time { 788 | if x != nil { 789 | return x.LockStartTime 790 | } 791 | return nil 792 | } 793 | 794 | func (x *SendLockPacketRequest) GetLockEndTime() *Time { 795 | if x != nil { 796 | return x.LockEndTime 797 | } 798 | return nil 799 | } 800 | 801 | func (x *SendLockPacketRequest) GetIsAutonomous() bool { 802 | if x != nil { 803 | return x.IsAutonomous 804 | } 805 | return false 806 | } 807 | 808 | type SendLockPacketResponse struct { 809 | state protoimpl.MessageState 810 | sizeCache protoimpl.SizeCache 811 | unknownFields protoimpl.UnknownFields 812 | } 813 | 814 | func (x *SendLockPacketResponse) Reset() { 815 | *x = SendLockPacketResponse{} 816 | if protoimpl.UnsafeEnabled { 817 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[10] 818 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 819 | ms.StoreMessageInfo(mi) 820 | } 821 | } 822 | 823 | func (x *SendLockPacketResponse) String() string { 824 | return protoimpl.X.MessageStringOf(x) 825 | } 826 | 827 | func (*SendLockPacketResponse) ProtoMessage() {} 828 | 829 | func (x *SendLockPacketResponse) ProtoReflect() protoreflect.Message { 830 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[10] 831 | if protoimpl.UnsafeEnabled && x != nil { 832 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 833 | if ms.LoadMessageInfo() == nil { 834 | ms.StoreMessageInfo(mi) 835 | } 836 | return ms 837 | } 838 | return mi.MessageOf(x) 839 | } 840 | 841 | // Deprecated: Use SendLockPacketResponse.ProtoReflect.Descriptor instead. 842 | func (*SendLockPacketResponse) Descriptor() ([]byte, []int) { 843 | return file_proto_proxy_v1_proxy_proto_rawDescGZIP(), []int{10} 844 | } 845 | 846 | // SendKamikazePacketRequest includes the data to be sent to the competition server on succesful QR code detection 847 | type SendKamikazePacketRequest struct { 848 | state protoimpl.MessageState 849 | sizeCache protoimpl.SizeCache 850 | unknownFields protoimpl.UnknownFields 851 | 852 | KamikazeStartTime *Time `protobuf:"bytes,1,opt,name=kamikaze_start_time,json=kamikazeStartTime,proto3" json:"kamikaze_start_time,omitempty"` 853 | KamikazeEndTime *Time `protobuf:"bytes,2,opt,name=kamikaze_end_time,json=kamikazeEndTime,proto3" json:"kamikaze_end_time,omitempty"` 854 | QrText string `protobuf:"bytes,3,opt,name=qr_text,json=qrText,proto3" json:"qr_text,omitempty"` 855 | } 856 | 857 | func (x *SendKamikazePacketRequest) Reset() { 858 | *x = SendKamikazePacketRequest{} 859 | if protoimpl.UnsafeEnabled { 860 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[11] 861 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 862 | ms.StoreMessageInfo(mi) 863 | } 864 | } 865 | 866 | func (x *SendKamikazePacketRequest) String() string { 867 | return protoimpl.X.MessageStringOf(x) 868 | } 869 | 870 | func (*SendKamikazePacketRequest) ProtoMessage() {} 871 | 872 | func (x *SendKamikazePacketRequest) ProtoReflect() protoreflect.Message { 873 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[11] 874 | if protoimpl.UnsafeEnabled && x != nil { 875 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 876 | if ms.LoadMessageInfo() == nil { 877 | ms.StoreMessageInfo(mi) 878 | } 879 | return ms 880 | } 881 | return mi.MessageOf(x) 882 | } 883 | 884 | // Deprecated: Use SendKamikazePacketRequest.ProtoReflect.Descriptor instead. 885 | func (*SendKamikazePacketRequest) Descriptor() ([]byte, []int) { 886 | return file_proto_proxy_v1_proxy_proto_rawDescGZIP(), []int{11} 887 | } 888 | 889 | func (x *SendKamikazePacketRequest) GetKamikazeStartTime() *Time { 890 | if x != nil { 891 | return x.KamikazeStartTime 892 | } 893 | return nil 894 | } 895 | 896 | func (x *SendKamikazePacketRequest) GetKamikazeEndTime() *Time { 897 | if x != nil { 898 | return x.KamikazeEndTime 899 | } 900 | return nil 901 | } 902 | 903 | func (x *SendKamikazePacketRequest) GetQrText() string { 904 | if x != nil { 905 | return x.QrText 906 | } 907 | return "" 908 | } 909 | 910 | type SendKamikazePacketResponse struct { 911 | state protoimpl.MessageState 912 | sizeCache protoimpl.SizeCache 913 | unknownFields protoimpl.UnknownFields 914 | } 915 | 916 | func (x *SendKamikazePacketResponse) Reset() { 917 | *x = SendKamikazePacketResponse{} 918 | if protoimpl.UnsafeEnabled { 919 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[12] 920 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 921 | ms.StoreMessageInfo(mi) 922 | } 923 | } 924 | 925 | func (x *SendKamikazePacketResponse) String() string { 926 | return protoimpl.X.MessageStringOf(x) 927 | } 928 | 929 | func (*SendKamikazePacketResponse) ProtoMessage() {} 930 | 931 | func (x *SendKamikazePacketResponse) ProtoReflect() protoreflect.Message { 932 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[12] 933 | if protoimpl.UnsafeEnabled && x != nil { 934 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 935 | if ms.LoadMessageInfo() == nil { 936 | ms.StoreMessageInfo(mi) 937 | } 938 | return ms 939 | } 940 | return mi.MessageOf(x) 941 | } 942 | 943 | // Deprecated: Use SendKamikazePacketResponse.ProtoReflect.Descriptor instead. 944 | func (*SendKamikazePacketResponse) Descriptor() ([]byte, []int) { 945 | return file_proto_proxy_v1_proxy_proto_rawDescGZIP(), []int{12} 946 | } 947 | 948 | type RedZonePacket struct { 949 | state protoimpl.MessageState 950 | sizeCache protoimpl.SizeCache 951 | unknownFields protoimpl.UnknownFields 952 | 953 | Lat float32 `protobuf:"fixed32,1,opt,name=lat,proto3" json:"lat,omitempty"` 954 | Lon float32 `protobuf:"fixed32,2,opt,name=lon,proto3" json:"lon,omitempty"` 955 | Rad float32 `protobuf:"fixed32,3,opt,name=rad,proto3" json:"rad,omitempty"` 956 | } 957 | 958 | func (x *RedZonePacket) Reset() { 959 | *x = RedZonePacket{} 960 | if protoimpl.UnsafeEnabled { 961 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[13] 962 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 963 | ms.StoreMessageInfo(mi) 964 | } 965 | } 966 | 967 | func (x *RedZonePacket) String() string { 968 | return protoimpl.X.MessageStringOf(x) 969 | } 970 | 971 | func (*RedZonePacket) ProtoMessage() {} 972 | 973 | func (x *RedZonePacket) ProtoReflect() protoreflect.Message { 974 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[13] 975 | if protoimpl.UnsafeEnabled && x != nil { 976 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 977 | if ms.LoadMessageInfo() == nil { 978 | ms.StoreMessageInfo(mi) 979 | } 980 | return ms 981 | } 982 | return mi.MessageOf(x) 983 | } 984 | 985 | // Deprecated: Use RedZonePacket.ProtoReflect.Descriptor instead. 986 | func (*RedZonePacket) Descriptor() ([]byte, []int) { 987 | return file_proto_proxy_v1_proxy_proto_rawDescGZIP(), []int{13} 988 | } 989 | 990 | func (x *RedZonePacket) GetLat() float32 { 991 | if x != nil { 992 | return x.Lat 993 | } 994 | return 0 995 | } 996 | 997 | func (x *RedZonePacket) GetLon() float32 { 998 | if x != nil { 999 | return x.Lon 1000 | } 1001 | return 0 1002 | } 1003 | 1004 | func (x *RedZonePacket) GetRad() float32 { 1005 | if x != nil { 1006 | return x.Rad 1007 | } 1008 | return 0 1009 | } 1010 | 1011 | type GetRedZonePacketRequest struct { 1012 | state protoimpl.MessageState 1013 | sizeCache protoimpl.SizeCache 1014 | unknownFields protoimpl.UnknownFields 1015 | } 1016 | 1017 | func (x *GetRedZonePacketRequest) Reset() { 1018 | *x = GetRedZonePacketRequest{} 1019 | if protoimpl.UnsafeEnabled { 1020 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[14] 1021 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1022 | ms.StoreMessageInfo(mi) 1023 | } 1024 | } 1025 | 1026 | func (x *GetRedZonePacketRequest) String() string { 1027 | return protoimpl.X.MessageStringOf(x) 1028 | } 1029 | 1030 | func (*GetRedZonePacketRequest) ProtoMessage() {} 1031 | 1032 | func (x *GetRedZonePacketRequest) ProtoReflect() protoreflect.Message { 1033 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[14] 1034 | if protoimpl.UnsafeEnabled && x != nil { 1035 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1036 | if ms.LoadMessageInfo() == nil { 1037 | ms.StoreMessageInfo(mi) 1038 | } 1039 | return ms 1040 | } 1041 | return mi.MessageOf(x) 1042 | } 1043 | 1044 | // Deprecated: Use GetRedZonePacketRequest.ProtoReflect.Descriptor instead. 1045 | func (*GetRedZonePacketRequest) Descriptor() ([]byte, []int) { 1046 | return file_proto_proxy_v1_proxy_proto_rawDescGZIP(), []int{14} 1047 | } 1048 | 1049 | type GetRedZonePacketResponse struct { 1050 | state protoimpl.MessageState 1051 | sizeCache protoimpl.SizeCache 1052 | unknownFields protoimpl.UnknownFields 1053 | 1054 | RedZones []*RedZonePacket `protobuf:"bytes,1,rep,name=redZones,proto3" json:"redZones,omitempty"` 1055 | } 1056 | 1057 | func (x *GetRedZonePacketResponse) Reset() { 1058 | *x = GetRedZonePacketResponse{} 1059 | if protoimpl.UnsafeEnabled { 1060 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[15] 1061 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1062 | ms.StoreMessageInfo(mi) 1063 | } 1064 | } 1065 | 1066 | func (x *GetRedZonePacketResponse) String() string { 1067 | return protoimpl.X.MessageStringOf(x) 1068 | } 1069 | 1070 | func (*GetRedZonePacketResponse) ProtoMessage() {} 1071 | 1072 | func (x *GetRedZonePacketResponse) ProtoReflect() protoreflect.Message { 1073 | mi := &file_proto_proxy_v1_proxy_proto_msgTypes[15] 1074 | if protoimpl.UnsafeEnabled && x != nil { 1075 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1076 | if ms.LoadMessageInfo() == nil { 1077 | ms.StoreMessageInfo(mi) 1078 | } 1079 | return ms 1080 | } 1081 | return mi.MessageOf(x) 1082 | } 1083 | 1084 | // Deprecated: Use GetRedZonePacketResponse.ProtoReflect.Descriptor instead. 1085 | func (*GetRedZonePacketResponse) Descriptor() ([]byte, []int) { 1086 | return file_proto_proxy_v1_proxy_proto_rawDescGZIP(), []int{15} 1087 | } 1088 | 1089 | func (x *GetRedZonePacketResponse) GetRedZones() []*RedZonePacket { 1090 | if x != nil { 1091 | return x.RedZones 1092 | } 1093 | return nil 1094 | } 1095 | 1096 | var File_proto_proxy_v1_proxy_proto protoreflect.FileDescriptor 1097 | 1098 | var file_proto_proxy_v1_proxy_proto_rawDesc = []byte{ 1099 | 0x0a, 0x1a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x31, 1100 | 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x70, 0x72, 1101 | 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x22, 0x15, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x54, 0x65, 0x6c, 1102 | 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xd8, 0x02, 1103 | 0x0a, 0x14, 0x47, 0x65, 0x74, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x52, 0x65, 1104 | 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x62, 1105 | 0x6f, 0x6f, 0x74, 0x5f, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x74, 0x69, 1106 | 0x6d, 0x65, 0x42, 0x6f, 0x6f, 0x74, 0x4d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x61, 0x74, 0x18, 1107 | 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6c, 0x61, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, 1108 | 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6c, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 1109 | 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x61, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 1110 | 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x41, 0x6c, 0x74, 0x12, 1111 | 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02, 0x52, 0x04, 0x72, 1112 | 0x6f, 0x6c, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x69, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 1113 | 0x28, 0x02, 0x52, 0x05, 0x70, 0x69, 0x74, 0x63, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x79, 0x61, 0x77, 1114 | 0x18, 0x07, 0x20, 0x01, 0x28, 0x02, 0x52, 0x03, 0x79, 0x61, 0x77, 0x12, 0x1a, 0x0a, 0x08, 0x61, 1115 | 0x69, 0x72, 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x61, 1116 | 0x69, 0x72, 0x73, 0x70, 0x65, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 1117 | 0x64, 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x67, 0x72, 1118 | 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x70, 0x65, 0x65, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x70, 0x5f, 1119 | 0x64, 0x69, 0x73, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x77, 0x70, 0x44, 0x69, 1120 | 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x77, 0x69, 0x6e, 0x64, 0x5f, 0x73, 0x70, 0x65, 0x65, 0x64, 1121 | 0x18, 0x0b, 0x20, 0x01, 0x28, 0x02, 0x52, 0x09, 0x77, 0x69, 0x6e, 0x64, 0x53, 0x70, 0x65, 0x65, 1122 | 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x77, 0x69, 0x6e, 0x64, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 1123 | 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0d, 0x77, 0x69, 0x6e, 0x64, 0x44, 1124 | 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x52, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, 1125 | 0x65, 0x74, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x01, 0x78, 1126 | 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x01, 0x79, 0x12, 0x14, 1127 | 0x0a, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x77, 1128 | 0x69, 0x64, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 1129 | 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x1d, 0x0a, 0x1b, 1130 | 0x47, 0x65, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x54, 0x65, 0x6c, 0x65, 0x6d, 1131 | 0x65, 0x74, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xd4, 0x03, 0x0a, 0x1c, 1132 | 0x47, 0x65, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x54, 0x65, 0x6c, 0x65, 0x6d, 1133 | 0x65, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0c, 1134 | 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x5f, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 1135 | 0x28, 0x04, 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x6f, 0x6f, 0x74, 0x4d, 0x73, 0x12, 0x10, 1136 | 0x0a, 0x03, 0x6c, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6c, 0x61, 0x74, 1137 | 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6c, 1138 | 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x61, 1139 | 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 1140 | 0x76, 0x65, 0x41, 0x6c, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x6c, 0x18, 0x05, 0x20, 1141 | 0x01, 0x28, 0x02, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x69, 0x74, 1142 | 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x70, 0x69, 0x74, 0x63, 0x68, 0x12, 1143 | 0x10, 0x0a, 0x03, 0x79, 0x61, 0x77, 0x18, 0x07, 0x20, 0x01, 0x28, 0x02, 0x52, 0x03, 0x79, 0x61, 1144 | 0x77, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x69, 0x72, 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, 0x08, 0x20, 1145 | 0x01, 0x28, 0x02, 0x52, 0x08, 0x61, 0x69, 0x72, 0x73, 0x70, 0x65, 0x65, 0x64, 0x12, 0x20, 0x0a, 1146 | 0x0b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 1147 | 0x28, 0x02, 0x52, 0x0b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x70, 0x65, 0x65, 0x64, 0x12, 1148 | 0x17, 0x0a, 0x07, 0x77, 0x70, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 1149 | 0x52, 0x06, 0x77, 0x70, 0x44, 0x69, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x74, 0x74, 1150 | 0x65, 0x72, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x62, 0x61, 0x74, 0x74, 0x65, 1151 | 0x72, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x75, 0x74, 0x6f, 0x6e, 0x6f, 0x6d, 0x6f, 0x75, 0x73, 1152 | 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, 0x75, 0x74, 0x6f, 0x6e, 0x6f, 0x6d, 0x6f, 1153 | 0x75, 0x73, 0x12, 0x2d, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x0d, 0x20, 0x01, 1154 | 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 1155 | 0x72, 0x67, 0x65, 0x74, 0x48, 0x00, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x88, 0x01, 1156 | 0x01, 0x12, 0x1d, 0x0a, 0x0a, 0x77, 0x69, 0x6e, 0x64, 0x5f, 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, 1157 | 0x0e, 0x20, 0x01, 0x28, 0x02, 0x52, 0x09, 0x77, 0x69, 0x6e, 0x64, 0x53, 0x70, 0x65, 0x65, 0x64, 1158 | 0x12, 0x25, 0x0a, 0x0e, 0x77, 0x69, 0x6e, 0x64, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 1159 | 0x6f, 0x6e, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0d, 0x77, 0x69, 0x6e, 0x64, 0x44, 0x69, 1160 | 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x74, 0x61, 0x72, 0x67, 1161 | 0x65, 0x74, 0x22, 0xd6, 0x01, 0x0a, 0x0a, 0x45, 0x6e, 0x65, 0x6d, 0x79, 0x50, 0x6c, 0x61, 0x6e, 1162 | 0x65, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 1163 | 0x28, 0x11, 0x52, 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x61, 1164 | 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x6c, 0x61, 0x74, 0x12, 0x10, 0x0a, 0x03, 1165 | 0x6c, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x6c, 0x6f, 0x6e, 0x12, 0x10, 1166 | 0x0a, 0x03, 0x61, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x61, 0x6c, 0x74, 1167 | 0x12, 0x14, 0x0a, 0x05, 0x70, 0x69, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 1168 | 0x05, 0x70, 0x69, 0x74, 0x63, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x6c, 0x18, 0x06, 1169 | 0x20, 0x01, 0x28, 0x01, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x79, 0x61, 1170 | 0x77, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x79, 0x61, 0x77, 0x12, 0x1b, 0x0a, 0x09, 1171 | 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 1172 | 0x08, 0x74, 0x69, 0x6d, 0x65, 0x44, 0x69, 0x66, 0x66, 0x12, 0x20, 0x0a, 0x0b, 0x67, 0x72, 0x6f, 1173 | 0x75, 0x6e, 0x64, 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 1174 | 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x70, 0x65, 0x65, 0x64, 0x22, 0x6c, 0x0a, 0x04, 0x54, 1175 | 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x75, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 1176 | 0x0d, 0x52, 0x04, 0x68, 0x6f, 0x75, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x69, 0x6e, 0x75, 0x74, 1177 | 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x12, 1178 | 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 1179 | 0x06, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 1180 | 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x6d, 0x69, 1181 | 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x1a, 0x0a, 0x18, 0x47, 0x65, 0x74, 1182 | 0x45, 0x6e, 0x65, 0x6d, 0x79, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x52, 0x65, 1183 | 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x85, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x65, 1184 | 0x6d, 0x79, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 1185 | 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x74, 0x69, 1186 | 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 1187 | 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 1188 | 0x54, 0x69, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x0c, 0x65, 0x6e, 0x65, 0x6d, 0x79, 0x5f, 0x70, 0x6c, 1189 | 0x61, 0x6e, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x72, 0x6f, 1190 | 0x78, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x65, 0x6d, 0x79, 0x50, 0x6c, 0x61, 0x6e, 0x65, 1191 | 0x52, 0x0b, 0x65, 0x6e, 0x65, 0x6d, 0x79, 0x50, 0x6c, 0x61, 0x6e, 0x65, 0x73, 0x22, 0xa8, 0x01, 1192 | 0x0a, 0x15, 0x53, 0x65, 0x6e, 0x64, 0x4c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 1193 | 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x0f, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 1194 | 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 1195 | 0x32, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 1196 | 0x52, 0x0d, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 1197 | 0x32, 0x0a, 0x0d, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 1198 | 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 1199 | 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x0b, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6e, 0x64, 0x54, 1200 | 0x69, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x73, 0x5f, 0x61, 0x75, 0x74, 0x6f, 0x6e, 0x6f, 1201 | 0x6d, 0x6f, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x73, 0x41, 0x75, 1202 | 0x74, 0x6f, 0x6e, 0x6f, 0x6d, 0x6f, 0x75, 0x73, 0x22, 0x18, 0x0a, 0x16, 0x53, 0x65, 0x6e, 0x64, 1203 | 0x4c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 1204 | 0x73, 0x65, 0x22, 0xb0, 0x01, 0x0a, 0x19, 0x53, 0x65, 0x6e, 0x64, 0x4b, 0x61, 0x6d, 0x69, 0x6b, 1205 | 0x61, 0x7a, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 1206 | 0x12, 0x3e, 0x0a, 0x13, 0x6b, 0x61, 0x6d, 0x69, 0x6b, 0x61, 0x7a, 0x65, 0x5f, 0x73, 0x74, 0x61, 1207 | 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 1208 | 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x11, 0x6b, 1209 | 0x61, 0x6d, 0x69, 0x6b, 0x61, 0x7a, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 1210 | 0x12, 0x3a, 0x0a, 0x11, 0x6b, 0x61, 0x6d, 0x69, 0x6b, 0x61, 0x7a, 0x65, 0x5f, 0x65, 0x6e, 0x64, 1211 | 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x72, 1212 | 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x0f, 0x6b, 0x61, 0x6d, 1213 | 0x69, 0x6b, 0x61, 0x7a, 0x65, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 1214 | 0x71, 0x72, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x71, 1215 | 0x72, 0x54, 0x65, 0x78, 0x74, 0x22, 0x1c, 0x0a, 0x1a, 0x53, 0x65, 0x6e, 0x64, 0x4b, 0x61, 0x6d, 1216 | 0x69, 0x6b, 0x61, 0x7a, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 1217 | 0x6e, 0x73, 0x65, 0x22, 0x45, 0x0a, 0x0d, 0x52, 0x65, 0x64, 0x5a, 0x6f, 0x6e, 0x65, 0x50, 0x61, 1218 | 0x63, 0x6b, 0x65, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 1219 | 0x02, 0x52, 0x03, 0x6c, 0x61, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, 0x6e, 0x18, 0x02, 0x20, 1220 | 0x01, 0x28, 0x02, 0x52, 0x03, 0x6c, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x61, 0x64, 0x18, 1221 | 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x03, 0x72, 0x61, 0x64, 0x22, 0x19, 0x0a, 0x17, 0x47, 0x65, 1222 | 0x74, 0x52, 0x65, 0x64, 0x5a, 0x6f, 0x6e, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 1223 | 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4f, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x52, 0x65, 0x64, 0x5a, 1224 | 0x6f, 0x6e, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 1225 | 0x65, 0x12, 0x33, 0x0a, 0x08, 0x72, 0x65, 0x64, 0x5a, 0x6f, 0x6e, 0x65, 0x73, 0x18, 0x01, 0x20, 1226 | 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x52, 1227 | 0x65, 0x64, 0x5a, 0x6f, 0x6e, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x08, 0x72, 0x65, 1228 | 0x64, 0x5a, 0x6f, 0x6e, 0x65, 0x73, 0x32, 0xd0, 0x03, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x78, 0x79, 1229 | 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4f, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x54, 0x65, 1230 | 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 1231 | 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x52, 1232 | 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 1233 | 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x52, 0x65, 1234 | 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x5e, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x45, 1235 | 0x6e, 0x65, 0x6d, 0x79, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x12, 0x22, 0x2e, 1236 | 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x65, 0x6d, 1237 | 0x79, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 1238 | 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 1239 | 0x45, 0x6e, 0x65, 0x6d, 0x79, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x52, 0x65, 1240 | 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x53, 0x0a, 0x0e, 0x53, 0x65, 0x6e, 0x64, 1241 | 0x4c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 1242 | 0x78, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x4c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 1243 | 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x72, 1244 | 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x4c, 0x6f, 0x63, 0x6b, 0x50, 1245 | 0x61, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 1246 | 0x12, 0x53, 0x65, 0x6e, 0x64, 0x4b, 0x61, 0x6d, 0x69, 0x6b, 0x61, 0x7a, 0x65, 0x50, 0x61, 0x63, 1247 | 0x6b, 0x65, 0x74, 0x12, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x53, 1248 | 0x65, 0x6e, 0x64, 0x4b, 0x61, 0x6d, 0x69, 0x6b, 0x61, 0x7a, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 1249 | 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 1250 | 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x4b, 0x61, 0x6d, 0x69, 0x6b, 0x61, 0x7a, 0x65, 1251 | 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 1252 | 0x0a, 0x10, 0x47, 0x65, 0x74, 0x52, 0x65, 0x64, 0x5a, 0x6f, 0x6e, 0x65, 0x50, 0x61, 0x63, 0x6b, 1253 | 0x65, 0x74, 0x12, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 1254 | 0x74, 0x52, 0x65, 0x64, 0x5a, 0x6f, 0x6e, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 1255 | 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 1256 | 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x64, 0x5a, 0x6f, 0x6e, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 1257 | 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x9f, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 1258 | 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x50, 0x72, 0x6f, 0x78, 1259 | 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 1260 | 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x6f, 0x75, 0x73, 0x74, 0x65, 0x63, 0x68, 0x2f, 0x6d, 0x61, 1261 | 0x73, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x64, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 1262 | 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x78, 1263 | 0x79, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x50, 1264 | 0x58, 0x58, 0xaa, 0x02, 0x08, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 1265 | 0x50, 0x72, 0x6f, 0x78, 0x79, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x50, 0x72, 0x6f, 0x78, 0x79, 1266 | 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 1267 | 0x02, 0x09, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 1268 | 0x74, 0x6f, 0x33, 1269 | } 1270 | 1271 | var ( 1272 | file_proto_proxy_v1_proxy_proto_rawDescOnce sync.Once 1273 | file_proto_proxy_v1_proxy_proto_rawDescData = file_proto_proxy_v1_proxy_proto_rawDesc 1274 | ) 1275 | 1276 | func file_proto_proxy_v1_proxy_proto_rawDescGZIP() []byte { 1277 | file_proto_proxy_v1_proxy_proto_rawDescOnce.Do(func() { 1278 | file_proto_proxy_v1_proxy_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_proxy_v1_proxy_proto_rawDescData) 1279 | }) 1280 | return file_proto_proxy_v1_proxy_proto_rawDescData 1281 | } 1282 | 1283 | var file_proto_proxy_v1_proxy_proto_msgTypes = make([]protoimpl.MessageInfo, 16) 1284 | var file_proto_proxy_v1_proxy_proto_goTypes = []any{ 1285 | (*GetTelemetryRequest)(nil), // 0: proxy.v1.GetTelemetryRequest 1286 | (*GetTelemetryResponse)(nil), // 1: proxy.v1.GetTelemetryResponse 1287 | (*Target)(nil), // 2: proxy.v1.Target 1288 | (*GetDetailedTelemetryRequest)(nil), // 3: proxy.v1.GetDetailedTelemetryRequest 1289 | (*GetDetailedTelemetryResponse)(nil), // 4: proxy.v1.GetDetailedTelemetryResponse 1290 | (*EnemyPlane)(nil), // 5: proxy.v1.EnemyPlane 1291 | (*Time)(nil), // 6: proxy.v1.Time 1292 | (*GetEnemyTelemetryRequest)(nil), // 7: proxy.v1.GetEnemyTelemetryRequest 1293 | (*GetEnemyTelemetryResponse)(nil), // 8: proxy.v1.GetEnemyTelemetryResponse 1294 | (*SendLockPacketRequest)(nil), // 9: proxy.v1.SendLockPacketRequest 1295 | (*SendLockPacketResponse)(nil), // 10: proxy.v1.SendLockPacketResponse 1296 | (*SendKamikazePacketRequest)(nil), // 11: proxy.v1.SendKamikazePacketRequest 1297 | (*SendKamikazePacketResponse)(nil), // 12: proxy.v1.SendKamikazePacketResponse 1298 | (*RedZonePacket)(nil), // 13: proxy.v1.RedZonePacket 1299 | (*GetRedZonePacketRequest)(nil), // 14: proxy.v1.GetRedZonePacketRequest 1300 | (*GetRedZonePacketResponse)(nil), // 15: proxy.v1.GetRedZonePacketResponse 1301 | } 1302 | var file_proto_proxy_v1_proxy_proto_depIdxs = []int32{ 1303 | 2, // 0: proxy.v1.GetDetailedTelemetryResponse.target:type_name -> proxy.v1.Target 1304 | 6, // 1: proxy.v1.GetEnemyTelemetryResponse.server_time:type_name -> proxy.v1.Time 1305 | 5, // 2: proxy.v1.GetEnemyTelemetryResponse.enemy_planes:type_name -> proxy.v1.EnemyPlane 1306 | 6, // 3: proxy.v1.SendLockPacketRequest.lock_start_time:type_name -> proxy.v1.Time 1307 | 6, // 4: proxy.v1.SendLockPacketRequest.lock_end_time:type_name -> proxy.v1.Time 1308 | 6, // 5: proxy.v1.SendKamikazePacketRequest.kamikaze_start_time:type_name -> proxy.v1.Time 1309 | 6, // 6: proxy.v1.SendKamikazePacketRequest.kamikaze_end_time:type_name -> proxy.v1.Time 1310 | 13, // 7: proxy.v1.GetRedZonePacketResponse.redZones:type_name -> proxy.v1.RedZonePacket 1311 | 0, // 8: proxy.v1.ProxyService.GetTelemetry:input_type -> proxy.v1.GetTelemetryRequest 1312 | 7, // 9: proxy.v1.ProxyService.GetEnemyTelemetry:input_type -> proxy.v1.GetEnemyTelemetryRequest 1313 | 9, // 10: proxy.v1.ProxyService.SendLockPacket:input_type -> proxy.v1.SendLockPacketRequest 1314 | 11, // 11: proxy.v1.ProxyService.SendKamikazePacket:input_type -> proxy.v1.SendKamikazePacketRequest 1315 | 14, // 12: proxy.v1.ProxyService.GetRedZonePacket:input_type -> proxy.v1.GetRedZonePacketRequest 1316 | 1, // 13: proxy.v1.ProxyService.GetTelemetry:output_type -> proxy.v1.GetTelemetryResponse 1317 | 8, // 14: proxy.v1.ProxyService.GetEnemyTelemetry:output_type -> proxy.v1.GetEnemyTelemetryResponse 1318 | 10, // 15: proxy.v1.ProxyService.SendLockPacket:output_type -> proxy.v1.SendLockPacketResponse 1319 | 12, // 16: proxy.v1.ProxyService.SendKamikazePacket:output_type -> proxy.v1.SendKamikazePacketResponse 1320 | 15, // 17: proxy.v1.ProxyService.GetRedZonePacket:output_type -> proxy.v1.GetRedZonePacketResponse 1321 | 13, // [13:18] is the sub-list for method output_type 1322 | 8, // [8:13] is the sub-list for method input_type 1323 | 8, // [8:8] is the sub-list for extension type_name 1324 | 8, // [8:8] is the sub-list for extension extendee 1325 | 0, // [0:8] is the sub-list for field type_name 1326 | } 1327 | 1328 | func init() { file_proto_proxy_v1_proxy_proto_init() } 1329 | func file_proto_proxy_v1_proxy_proto_init() { 1330 | if File_proto_proxy_v1_proxy_proto != nil { 1331 | return 1332 | } 1333 | if !protoimpl.UnsafeEnabled { 1334 | file_proto_proxy_v1_proxy_proto_msgTypes[0].Exporter = func(v any, i int) any { 1335 | switch v := v.(*GetTelemetryRequest); i { 1336 | case 0: 1337 | return &v.state 1338 | case 1: 1339 | return &v.sizeCache 1340 | case 2: 1341 | return &v.unknownFields 1342 | default: 1343 | return nil 1344 | } 1345 | } 1346 | file_proto_proxy_v1_proxy_proto_msgTypes[1].Exporter = func(v any, i int) any { 1347 | switch v := v.(*GetTelemetryResponse); i { 1348 | case 0: 1349 | return &v.state 1350 | case 1: 1351 | return &v.sizeCache 1352 | case 2: 1353 | return &v.unknownFields 1354 | default: 1355 | return nil 1356 | } 1357 | } 1358 | file_proto_proxy_v1_proxy_proto_msgTypes[2].Exporter = func(v any, i int) any { 1359 | switch v := v.(*Target); i { 1360 | case 0: 1361 | return &v.state 1362 | case 1: 1363 | return &v.sizeCache 1364 | case 2: 1365 | return &v.unknownFields 1366 | default: 1367 | return nil 1368 | } 1369 | } 1370 | file_proto_proxy_v1_proxy_proto_msgTypes[3].Exporter = func(v any, i int) any { 1371 | switch v := v.(*GetDetailedTelemetryRequest); i { 1372 | case 0: 1373 | return &v.state 1374 | case 1: 1375 | return &v.sizeCache 1376 | case 2: 1377 | return &v.unknownFields 1378 | default: 1379 | return nil 1380 | } 1381 | } 1382 | file_proto_proxy_v1_proxy_proto_msgTypes[4].Exporter = func(v any, i int) any { 1383 | switch v := v.(*GetDetailedTelemetryResponse); i { 1384 | case 0: 1385 | return &v.state 1386 | case 1: 1387 | return &v.sizeCache 1388 | case 2: 1389 | return &v.unknownFields 1390 | default: 1391 | return nil 1392 | } 1393 | } 1394 | file_proto_proxy_v1_proxy_proto_msgTypes[5].Exporter = func(v any, i int) any { 1395 | switch v := v.(*EnemyPlane); i { 1396 | case 0: 1397 | return &v.state 1398 | case 1: 1399 | return &v.sizeCache 1400 | case 2: 1401 | return &v.unknownFields 1402 | default: 1403 | return nil 1404 | } 1405 | } 1406 | file_proto_proxy_v1_proxy_proto_msgTypes[6].Exporter = func(v any, i int) any { 1407 | switch v := v.(*Time); i { 1408 | case 0: 1409 | return &v.state 1410 | case 1: 1411 | return &v.sizeCache 1412 | case 2: 1413 | return &v.unknownFields 1414 | default: 1415 | return nil 1416 | } 1417 | } 1418 | file_proto_proxy_v1_proxy_proto_msgTypes[7].Exporter = func(v any, i int) any { 1419 | switch v := v.(*GetEnemyTelemetryRequest); i { 1420 | case 0: 1421 | return &v.state 1422 | case 1: 1423 | return &v.sizeCache 1424 | case 2: 1425 | return &v.unknownFields 1426 | default: 1427 | return nil 1428 | } 1429 | } 1430 | file_proto_proxy_v1_proxy_proto_msgTypes[8].Exporter = func(v any, i int) any { 1431 | switch v := v.(*GetEnemyTelemetryResponse); i { 1432 | case 0: 1433 | return &v.state 1434 | case 1: 1435 | return &v.sizeCache 1436 | case 2: 1437 | return &v.unknownFields 1438 | default: 1439 | return nil 1440 | } 1441 | } 1442 | file_proto_proxy_v1_proxy_proto_msgTypes[9].Exporter = func(v any, i int) any { 1443 | switch v := v.(*SendLockPacketRequest); i { 1444 | case 0: 1445 | return &v.state 1446 | case 1: 1447 | return &v.sizeCache 1448 | case 2: 1449 | return &v.unknownFields 1450 | default: 1451 | return nil 1452 | } 1453 | } 1454 | file_proto_proxy_v1_proxy_proto_msgTypes[10].Exporter = func(v any, i int) any { 1455 | switch v := v.(*SendLockPacketResponse); i { 1456 | case 0: 1457 | return &v.state 1458 | case 1: 1459 | return &v.sizeCache 1460 | case 2: 1461 | return &v.unknownFields 1462 | default: 1463 | return nil 1464 | } 1465 | } 1466 | file_proto_proxy_v1_proxy_proto_msgTypes[11].Exporter = func(v any, i int) any { 1467 | switch v := v.(*SendKamikazePacketRequest); i { 1468 | case 0: 1469 | return &v.state 1470 | case 1: 1471 | return &v.sizeCache 1472 | case 2: 1473 | return &v.unknownFields 1474 | default: 1475 | return nil 1476 | } 1477 | } 1478 | file_proto_proxy_v1_proxy_proto_msgTypes[12].Exporter = func(v any, i int) any { 1479 | switch v := v.(*SendKamikazePacketResponse); i { 1480 | case 0: 1481 | return &v.state 1482 | case 1: 1483 | return &v.sizeCache 1484 | case 2: 1485 | return &v.unknownFields 1486 | default: 1487 | return nil 1488 | } 1489 | } 1490 | file_proto_proxy_v1_proxy_proto_msgTypes[13].Exporter = func(v any, i int) any { 1491 | switch v := v.(*RedZonePacket); i { 1492 | case 0: 1493 | return &v.state 1494 | case 1: 1495 | return &v.sizeCache 1496 | case 2: 1497 | return &v.unknownFields 1498 | default: 1499 | return nil 1500 | } 1501 | } 1502 | file_proto_proxy_v1_proxy_proto_msgTypes[14].Exporter = func(v any, i int) any { 1503 | switch v := v.(*GetRedZonePacketRequest); i { 1504 | case 0: 1505 | return &v.state 1506 | case 1: 1507 | return &v.sizeCache 1508 | case 2: 1509 | return &v.unknownFields 1510 | default: 1511 | return nil 1512 | } 1513 | } 1514 | file_proto_proxy_v1_proxy_proto_msgTypes[15].Exporter = func(v any, i int) any { 1515 | switch v := v.(*GetRedZonePacketResponse); i { 1516 | case 0: 1517 | return &v.state 1518 | case 1: 1519 | return &v.sizeCache 1520 | case 2: 1521 | return &v.unknownFields 1522 | default: 1523 | return nil 1524 | } 1525 | } 1526 | } 1527 | file_proto_proxy_v1_proxy_proto_msgTypes[4].OneofWrappers = []any{} 1528 | type x struct{} 1529 | out := protoimpl.TypeBuilder{ 1530 | File: protoimpl.DescBuilder{ 1531 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 1532 | RawDescriptor: file_proto_proxy_v1_proxy_proto_rawDesc, 1533 | NumEnums: 0, 1534 | NumMessages: 16, 1535 | NumExtensions: 0, 1536 | NumServices: 1, 1537 | }, 1538 | GoTypes: file_proto_proxy_v1_proxy_proto_goTypes, 1539 | DependencyIndexes: file_proto_proxy_v1_proxy_proto_depIdxs, 1540 | MessageInfos: file_proto_proxy_v1_proxy_proto_msgTypes, 1541 | }.Build() 1542 | File_proto_proxy_v1_proxy_proto = out.File 1543 | file_proto_proxy_v1_proxy_proto_rawDesc = nil 1544 | file_proto_proxy_v1_proxy_proto_goTypes = nil 1545 | file_proto_proxy_v1_proxy_proto_depIdxs = nil 1546 | } 1547 | -------------------------------------------------------------------------------- /gen/go/proto/proxy/v1/proxy_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.5.1 4 | // - protoc (unknown) 5 | // source: proto/proxy/v1/proxy.proto 6 | 7 | package proxyv1 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.64.0 or later. 19 | const _ = grpc.SupportPackageIsVersion9 20 | 21 | const ( 22 | ProxyService_GetTelemetry_FullMethodName = "/proxy.v1.ProxyService/GetTelemetry" 23 | ProxyService_GetEnemyTelemetry_FullMethodName = "/proxy.v1.ProxyService/GetEnemyTelemetry" 24 | ProxyService_SendLockPacket_FullMethodName = "/proxy.v1.ProxyService/SendLockPacket" 25 | ProxyService_SendKamikazePacket_FullMethodName = "/proxy.v1.ProxyService/SendKamikazePacket" 26 | ProxyService_GetRedZonePacket_FullMethodName = "/proxy.v1.ProxyService/GetRedZonePacket" 27 | ) 28 | 29 | // ProxyServiceClient is the client API for ProxyService service. 30 | // 31 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 32 | type ProxyServiceClient interface { 33 | // Returns a normal telemetry stream when activated. Should be used by 34 | // services that don't interact with the competition server 35 | GetTelemetry(ctx context.Context, in *GetTelemetryRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetTelemetryResponse], error) 36 | // GetEnemyTelemetry returns the enemy's telemetry stream when 37 | // activated 38 | GetEnemyTelemetry(ctx context.Context, in *GetEnemyTelemetryRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetEnemyTelemetryResponse], error) 39 | // SendLockPacket sends a successful lock notification to the competition server 40 | SendLockPacket(ctx context.Context, in *SendLockPacketRequest, opts ...grpc.CallOption) (*SendLockPacketResponse, error) 41 | // SendKamikazePacket sends a successful kamikaze QR code reading to the competition server 42 | SendKamikazePacket(ctx context.Context, in *SendKamikazePacketRequest, opts ...grpc.CallOption) (*SendKamikazePacketResponse, error) 43 | GetRedZonePacket(ctx context.Context, in *GetRedZonePacketRequest, opts ...grpc.CallOption) (*GetRedZonePacketResponse, error) 44 | } 45 | 46 | type proxyServiceClient struct { 47 | cc grpc.ClientConnInterface 48 | } 49 | 50 | func NewProxyServiceClient(cc grpc.ClientConnInterface) ProxyServiceClient { 51 | return &proxyServiceClient{cc} 52 | } 53 | 54 | func (c *proxyServiceClient) GetTelemetry(ctx context.Context, in *GetTelemetryRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetTelemetryResponse], error) { 55 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 56 | stream, err := c.cc.NewStream(ctx, &ProxyService_ServiceDesc.Streams[0], ProxyService_GetTelemetry_FullMethodName, cOpts...) 57 | if err != nil { 58 | return nil, err 59 | } 60 | x := &grpc.GenericClientStream[GetTelemetryRequest, GetTelemetryResponse]{ClientStream: stream} 61 | if err := x.ClientStream.SendMsg(in); err != nil { 62 | return nil, err 63 | } 64 | if err := x.ClientStream.CloseSend(); err != nil { 65 | return nil, err 66 | } 67 | return x, nil 68 | } 69 | 70 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 71 | type ProxyService_GetTelemetryClient = grpc.ServerStreamingClient[GetTelemetryResponse] 72 | 73 | func (c *proxyServiceClient) GetEnemyTelemetry(ctx context.Context, in *GetEnemyTelemetryRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetEnemyTelemetryResponse], error) { 74 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 75 | stream, err := c.cc.NewStream(ctx, &ProxyService_ServiceDesc.Streams[1], ProxyService_GetEnemyTelemetry_FullMethodName, cOpts...) 76 | if err != nil { 77 | return nil, err 78 | } 79 | x := &grpc.GenericClientStream[GetEnemyTelemetryRequest, GetEnemyTelemetryResponse]{ClientStream: stream} 80 | if err := x.ClientStream.SendMsg(in); err != nil { 81 | return nil, err 82 | } 83 | if err := x.ClientStream.CloseSend(); err != nil { 84 | return nil, err 85 | } 86 | return x, nil 87 | } 88 | 89 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 90 | type ProxyService_GetEnemyTelemetryClient = grpc.ServerStreamingClient[GetEnemyTelemetryResponse] 91 | 92 | func (c *proxyServiceClient) SendLockPacket(ctx context.Context, in *SendLockPacketRequest, opts ...grpc.CallOption) (*SendLockPacketResponse, error) { 93 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 94 | out := new(SendLockPacketResponse) 95 | err := c.cc.Invoke(ctx, ProxyService_SendLockPacket_FullMethodName, in, out, cOpts...) 96 | if err != nil { 97 | return nil, err 98 | } 99 | return out, nil 100 | } 101 | 102 | func (c *proxyServiceClient) SendKamikazePacket(ctx context.Context, in *SendKamikazePacketRequest, opts ...grpc.CallOption) (*SendKamikazePacketResponse, error) { 103 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 104 | out := new(SendKamikazePacketResponse) 105 | err := c.cc.Invoke(ctx, ProxyService_SendKamikazePacket_FullMethodName, in, out, cOpts...) 106 | if err != nil { 107 | return nil, err 108 | } 109 | return out, nil 110 | } 111 | 112 | func (c *proxyServiceClient) GetRedZonePacket(ctx context.Context, in *GetRedZonePacketRequest, opts ...grpc.CallOption) (*GetRedZonePacketResponse, error) { 113 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 114 | out := new(GetRedZonePacketResponse) 115 | err := c.cc.Invoke(ctx, ProxyService_GetRedZonePacket_FullMethodName, in, out, cOpts...) 116 | if err != nil { 117 | return nil, err 118 | } 119 | return out, nil 120 | } 121 | 122 | // ProxyServiceServer is the server API for ProxyService service. 123 | // All implementations should embed UnimplementedProxyServiceServer 124 | // for forward compatibility. 125 | type ProxyServiceServer interface { 126 | // Returns a normal telemetry stream when activated. Should be used by 127 | // services that don't interact with the competition server 128 | GetTelemetry(*GetTelemetryRequest, grpc.ServerStreamingServer[GetTelemetryResponse]) error 129 | // GetEnemyTelemetry returns the enemy's telemetry stream when 130 | // activated 131 | GetEnemyTelemetry(*GetEnemyTelemetryRequest, grpc.ServerStreamingServer[GetEnemyTelemetryResponse]) error 132 | // SendLockPacket sends a successful lock notification to the competition server 133 | SendLockPacket(context.Context, *SendLockPacketRequest) (*SendLockPacketResponse, error) 134 | // SendKamikazePacket sends a successful kamikaze QR code reading to the competition server 135 | SendKamikazePacket(context.Context, *SendKamikazePacketRequest) (*SendKamikazePacketResponse, error) 136 | GetRedZonePacket(context.Context, *GetRedZonePacketRequest) (*GetRedZonePacketResponse, error) 137 | } 138 | 139 | // UnimplementedProxyServiceServer should be embedded to have 140 | // forward compatible implementations. 141 | // 142 | // NOTE: this should be embedded by value instead of pointer to avoid a nil 143 | // pointer dereference when methods are called. 144 | type UnimplementedProxyServiceServer struct{} 145 | 146 | func (UnimplementedProxyServiceServer) GetTelemetry(*GetTelemetryRequest, grpc.ServerStreamingServer[GetTelemetryResponse]) error { 147 | return status.Errorf(codes.Unimplemented, "method GetTelemetry not implemented") 148 | } 149 | func (UnimplementedProxyServiceServer) GetEnemyTelemetry(*GetEnemyTelemetryRequest, grpc.ServerStreamingServer[GetEnemyTelemetryResponse]) error { 150 | return status.Errorf(codes.Unimplemented, "method GetEnemyTelemetry not implemented") 151 | } 152 | func (UnimplementedProxyServiceServer) SendLockPacket(context.Context, *SendLockPacketRequest) (*SendLockPacketResponse, error) { 153 | return nil, status.Errorf(codes.Unimplemented, "method SendLockPacket not implemented") 154 | } 155 | func (UnimplementedProxyServiceServer) SendKamikazePacket(context.Context, *SendKamikazePacketRequest) (*SendKamikazePacketResponse, error) { 156 | return nil, status.Errorf(codes.Unimplemented, "method SendKamikazePacket not implemented") 157 | } 158 | func (UnimplementedProxyServiceServer) GetRedZonePacket(context.Context, *GetRedZonePacketRequest) (*GetRedZonePacketResponse, error) { 159 | return nil, status.Errorf(codes.Unimplemented, "method GetRedZonePacket not implemented") 160 | } 161 | func (UnimplementedProxyServiceServer) testEmbeddedByValue() {} 162 | 163 | // UnsafeProxyServiceServer may be embedded to opt out of forward compatibility for this service. 164 | // Use of this interface is not recommended, as added methods to ProxyServiceServer will 165 | // result in compilation errors. 166 | type UnsafeProxyServiceServer interface { 167 | mustEmbedUnimplementedProxyServiceServer() 168 | } 169 | 170 | func RegisterProxyServiceServer(s grpc.ServiceRegistrar, srv ProxyServiceServer) { 171 | // If the following call pancis, it indicates UnimplementedProxyServiceServer was 172 | // embedded by pointer and is nil. This will cause panics if an 173 | // unimplemented method is ever invoked, so we test this at initialization 174 | // time to prevent it from happening at runtime later due to I/O. 175 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 176 | t.testEmbeddedByValue() 177 | } 178 | s.RegisterService(&ProxyService_ServiceDesc, srv) 179 | } 180 | 181 | func _ProxyService_GetTelemetry_Handler(srv interface{}, stream grpc.ServerStream) error { 182 | m := new(GetTelemetryRequest) 183 | if err := stream.RecvMsg(m); err != nil { 184 | return err 185 | } 186 | return srv.(ProxyServiceServer).GetTelemetry(m, &grpc.GenericServerStream[GetTelemetryRequest, GetTelemetryResponse]{ServerStream: stream}) 187 | } 188 | 189 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 190 | type ProxyService_GetTelemetryServer = grpc.ServerStreamingServer[GetTelemetryResponse] 191 | 192 | func _ProxyService_GetEnemyTelemetry_Handler(srv interface{}, stream grpc.ServerStream) error { 193 | m := new(GetEnemyTelemetryRequest) 194 | if err := stream.RecvMsg(m); err != nil { 195 | return err 196 | } 197 | return srv.(ProxyServiceServer).GetEnemyTelemetry(m, &grpc.GenericServerStream[GetEnemyTelemetryRequest, GetEnemyTelemetryResponse]{ServerStream: stream}) 198 | } 199 | 200 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 201 | type ProxyService_GetEnemyTelemetryServer = grpc.ServerStreamingServer[GetEnemyTelemetryResponse] 202 | 203 | func _ProxyService_SendLockPacket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 204 | in := new(SendLockPacketRequest) 205 | if err := dec(in); err != nil { 206 | return nil, err 207 | } 208 | if interceptor == nil { 209 | return srv.(ProxyServiceServer).SendLockPacket(ctx, in) 210 | } 211 | info := &grpc.UnaryServerInfo{ 212 | Server: srv, 213 | FullMethod: ProxyService_SendLockPacket_FullMethodName, 214 | } 215 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 216 | return srv.(ProxyServiceServer).SendLockPacket(ctx, req.(*SendLockPacketRequest)) 217 | } 218 | return interceptor(ctx, in, info, handler) 219 | } 220 | 221 | func _ProxyService_SendKamikazePacket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 222 | in := new(SendKamikazePacketRequest) 223 | if err := dec(in); err != nil { 224 | return nil, err 225 | } 226 | if interceptor == nil { 227 | return srv.(ProxyServiceServer).SendKamikazePacket(ctx, in) 228 | } 229 | info := &grpc.UnaryServerInfo{ 230 | Server: srv, 231 | FullMethod: ProxyService_SendKamikazePacket_FullMethodName, 232 | } 233 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 234 | return srv.(ProxyServiceServer).SendKamikazePacket(ctx, req.(*SendKamikazePacketRequest)) 235 | } 236 | return interceptor(ctx, in, info, handler) 237 | } 238 | 239 | func _ProxyService_GetRedZonePacket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 240 | in := new(GetRedZonePacketRequest) 241 | if err := dec(in); err != nil { 242 | return nil, err 243 | } 244 | if interceptor == nil { 245 | return srv.(ProxyServiceServer).GetRedZonePacket(ctx, in) 246 | } 247 | info := &grpc.UnaryServerInfo{ 248 | Server: srv, 249 | FullMethod: ProxyService_GetRedZonePacket_FullMethodName, 250 | } 251 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 252 | return srv.(ProxyServiceServer).GetRedZonePacket(ctx, req.(*GetRedZonePacketRequest)) 253 | } 254 | return interceptor(ctx, in, info, handler) 255 | } 256 | 257 | // ProxyService_ServiceDesc is the grpc.ServiceDesc for ProxyService service. 258 | // It's only intended for direct use with grpc.RegisterService, 259 | // and not to be introspected or modified (even as a copy) 260 | var ProxyService_ServiceDesc = grpc.ServiceDesc{ 261 | ServiceName: "proxy.v1.ProxyService", 262 | HandlerType: (*ProxyServiceServer)(nil), 263 | Methods: []grpc.MethodDesc{ 264 | { 265 | MethodName: "SendLockPacket", 266 | Handler: _ProxyService_SendLockPacket_Handler, 267 | }, 268 | { 269 | MethodName: "SendKamikazePacket", 270 | Handler: _ProxyService_SendKamikazePacket_Handler, 271 | }, 272 | { 273 | MethodName: "GetRedZonePacket", 274 | Handler: _ProxyService_GetRedZonePacket_Handler, 275 | }, 276 | }, 277 | Streams: []grpc.StreamDesc{ 278 | { 279 | StreamName: "GetTelemetry", 280 | Handler: _ProxyService_GetTelemetry_Handler, 281 | ServerStreams: true, 282 | }, 283 | { 284 | StreamName: "GetEnemyTelemetry", 285 | Handler: _ProxyService_GetEnemyTelemetry_Handler, 286 | ServerStreams: true, 287 | }, 288 | }, 289 | Metadata: "proto/proxy/v1/proxy.proto", 290 | } 291 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/koustech/mastermind 2 | 3 | go 1.21 4 | 5 | toolchain go1.22.5 6 | 7 | require ( 8 | github.com/aler9/gomavlib v0.0.0-20220722052739-8f67720006ed 9 | github.com/google/uuid v1.6.0 10 | github.com/ispringtech/eventbus v0.0.0-20190701203509-53c525703608 11 | github.com/stretchr/testify v1.8.0 12 | go.uber.org/zap v1.21.0 13 | google.golang.org/grpc v1.65.0 14 | google.golang.org/protobuf v1.34.1 15 | ) 16 | 17 | require ( 18 | github.com/davecgh/go-spew v1.1.1 // indirect 19 | github.com/golang/protobuf v1.5.4 // indirect 20 | github.com/pmezard/go-difflib v1.0.0 // indirect 21 | github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07 // indirect 22 | go.uber.org/atomic v1.9.0 // indirect 23 | go.uber.org/multierr v1.8.0 // indirect 24 | golang.org/x/net v0.26.0 // indirect 25 | golang.org/x/sys v0.21.0 // indirect 26 | golang.org/x/text v0.16.0 // indirect 27 | google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect 28 | gopkg.in/yaml.v3 v3.0.1 // indirect 29 | ) 30 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | bou.ke/monkey v1.0.2 h1:kWcnsrCNUatbxncxR/ThdYqbytgOIArtYWqcQLQzKLI= 2 | bou.ke/monkey v1.0.2/go.mod h1:OqickVX3tNx6t33n1xvtTtu85YN5s6cKwVug+oHMaIA= 3 | cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 4 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 5 | github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= 6 | github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= 7 | github.com/aler9/gomavlib v0.0.0-20220722052739-8f67720006ed h1:jZbgBGaP+fy2tlkHTUfrJCsqgxdJBx5wPmTUSD3GRUA= 8 | github.com/aler9/gomavlib v0.0.0-20220722052739-8f67720006ed/go.mod h1:Hq4p2+xpBECGP8wgLc7yT9Ng2G8RZFheNWORkZYlSdQ= 9 | github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= 10 | github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= 11 | github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= 12 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 13 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 14 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 15 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 16 | github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 17 | github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= 18 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 19 | github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 20 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 21 | github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 22 | github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= 23 | github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= 24 | github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= 25 | github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= 26 | github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= 27 | github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= 28 | github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= 29 | github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= 30 | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 31 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 32 | github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 33 | github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 34 | github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= 35 | github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 36 | github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= 37 | github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 38 | github.com/ispringtech/eventbus v0.0.0-20190701203509-53c525703608 h1:DhVesl7Z6CEE+h1MdzodcF+4fuczgS1V2Vjt9sz+J0w= 39 | github.com/ispringtech/eventbus v0.0.0-20190701203509-53c525703608/go.mod h1:vndL1FJQzQJgRE8b3re11LeS88Mm6sm/NR+HvUfVb+g= 40 | github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= 41 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 42 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 43 | github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= 44 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 45 | github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= 46 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 47 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 48 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 49 | github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 50 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 51 | github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= 52 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 53 | github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 54 | github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 55 | github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= 56 | github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= 57 | github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07 h1:UyzmZLoiDWMRywV4DUYb9Fbt8uiOSooupjTq10vpvnU= 58 | github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= 59 | github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= 60 | go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= 61 | go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= 62 | go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= 63 | go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= 64 | go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= 65 | go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= 66 | go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= 67 | go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= 68 | go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= 69 | go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= 70 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 71 | golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 72 | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 73 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 74 | golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= 75 | golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 76 | golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 77 | golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 78 | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 79 | golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 80 | golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 81 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 82 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 83 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 84 | golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= 85 | golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= 86 | golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= 87 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 88 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 89 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 90 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 91 | golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 92 | golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 93 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 94 | golang.org/x/sys v0.0.0-20190310054646-10058d7d4faa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 95 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 96 | golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 97 | golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 98 | golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 99 | golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= 100 | golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 101 | golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 102 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 103 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 104 | golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= 105 | golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= 106 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 107 | golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 108 | golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= 109 | golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 110 | golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 111 | golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 112 | golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= 113 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 114 | golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 115 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 116 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 117 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 118 | google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 119 | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= 120 | google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 121 | google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= 122 | google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= 123 | google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= 124 | google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= 125 | google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 126 | google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= 127 | google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= 128 | google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= 129 | google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= 130 | google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= 131 | google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= 132 | google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= 133 | google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 134 | google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 135 | google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= 136 | google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= 137 | gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= 138 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 139 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= 140 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 141 | gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= 142 | gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 143 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 144 | gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 145 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 146 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 147 | honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 148 | honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 149 | -------------------------------------------------------------------------------- /main/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | 6 | "github.com/aler9/gomavlib" 7 | "github.com/koustech/mastermind/telemetry" 8 | 9 | "github.com/koustech/mastermind/server" 10 | u "github.com/koustech/mastermind/utils" 11 | ) 12 | 13 | func main() { 14 | u.InitializeLoggers() 15 | defer u.SyncLogger() 16 | 17 | var grpcAddress string 18 | var mavlinkAddress string 19 | var test bool 20 | flag.StringVar(&grpcAddress, "a", "0.0.0.0:5678", "Mastermind's gRPC server address") 21 | flag.StringVar(&mavlinkAddress, "m", "127.0.0.1:14556", "The source MAVLink vehicle's ip address") 22 | flag.BoolVar(&test, "test", false, "Disables telemetry mode") 23 | flag.Parse() 24 | 25 | var node *gomavlib.Node 26 | 27 | var sysId uint8 = 0 28 | var compId uint8 = 0 29 | 30 | if test { 31 | u.Logger.Info("Running in test mode") 32 | node = &gomavlib.Node{} 33 | } else { 34 | u.Logger.Info("Running in telemetry mode") 35 | node, sysId, compId = telemetry.ConnectToVehicle(mavlinkAddress) 36 | } 37 | defer node.Close() 38 | 39 | if err := server.Run(grpcAddress, node, sysId, compId); err != nil { 40 | u.Logger.Fatal(err) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /server/commands.go: -------------------------------------------------------------------------------- 1 | package server 2 | 3 | import ( 4 | "context" 5 | "time" 6 | 7 | "github.com/aler9/gomavlib" 8 | "github.com/aler9/gomavlib/pkg/dialects/ardupilotmega" 9 | pb "github.com/koustech/mastermind/gen/go/proto/mastermind/v1" 10 | "github.com/koustech/mastermind/utils" 11 | ) 12 | 13 | const MAV_CMD_NAV_LOCK_KSTCH = 151 // command ID of custom command to move plane 14 | const MODE_KOUSTECH_LOCK = 30 15 | const MODE_KOUSTECH_KAMIKAZE = 31 16 | const LOCK_DEFAULT_DISTANCE = 20 17 | 18 | // SetPIDLevel sets the PID of the plane according to predetermined levels in the config 19 | func (s *mastermindServiceServer) SetPIDLevel(_ context.Context, request *pb.SetPIDLevelRequest) (*pb.SetPIDLevelResponse, error) { 20 | // FIXME: add actual command invocation 21 | utils.Logger.Infof("PID Level %v request received", request.Level) 22 | success := true 23 | 24 | switch request.Level { 25 | case pb.PIDLevel_PID_LEVEL_1: 26 | utils.Logger.Info("PID set to ", request.Level) 27 | case pb.PIDLevel_PID_LEVEL_2: 28 | utils.Logger.Info("PID set to ", request.Level) 29 | case pb.PIDLevel_PID_LEVEL_3: 30 | utils.Logger.Info("PID set to ", request.Level) 31 | case pb.PIDLevel_PID_LEVEL_4: 32 | utils.Logger.Info("PID set to ", request.Level) 33 | case pb.PIDLevel_PID_LEVEL_5: 34 | utils.Logger.Info("PID set to ", request.Level) 35 | case pb.PIDLevel_PID_LEVEL_6: 36 | utils.Logger.Info("PID set to ", request.Level) 37 | case pb.PIDLevel_PID_LEVEL_7: 38 | utils.Logger.Info("PID set to ", request.Level) 39 | case pb.PIDLevel_PID_LEVEL_8: 40 | utils.Logger.Info("PID set to ", request.Level) 41 | default: 42 | utils.Logger.Errorf("level %v not supported", request.Level) 43 | success = false 44 | } 45 | 46 | return &pb.SetPIDLevelResponse{CommandSucceeded: success}, nil 47 | } 48 | 49 | func SetModeKamikaze(sysId uint8, compId uint8, node *gomavlib.Node) { 50 | // set mode to KOUSTECH_KAMIKAZE ONE TIME ONLY 51 | node.WriteMessageAll(&ardupilotmega.MessageCommandLong{ 52 | TargetSystem: sysId, 53 | TargetComponent: compId, 54 | Command: ardupilotmega.MAV_CMD_DO_SET_MODE, 55 | Confirmation: 0, 56 | Param1: 1, // PARAM1 MUST BE MAIN MODE (koustech) 57 | Param2: MODE_KOUSTECH_KAMIKAZE, // PARAM2 MUST BE SUBMODE 58 | Param3: 0, 59 | Param4: 0, 60 | Param5: 0, 61 | Param6: 0, 62 | Param7: 0, 63 | }) 64 | 65 | } 66 | 67 | // SetSpeed sets the airspeed of the plane 68 | func (s *mastermindServiceServer) SetSpeed(_ context.Context, request *pb.SetSpeedRequest) (*pb.SetSpeedResponse, error) { 69 | utils.Logger.Infof("Setting speed to %v m/s", request.NewSpeed) 70 | 71 | s.node.WriteMessageAll(&ardupilotmega.MessageCommandLong{ 72 | TargetSystem: s.sysId, 73 | TargetComponent: s.compId, 74 | Command: ardupilotmega.MAV_CMD_DO_CHANGE_SPEED, 75 | Confirmation: 0, // TODO: should this be 0 or 1? 76 | Param1: 0, // Speed Type --> airspeed=0, groundspeed=1, climbspeed=2 77 | Param2: request.NewSpeed, // Speed 78 | Param3: 0, // Throttle 79 | Param4: 0, 80 | Param5: 0, 81 | Param6: 0, 82 | Param7: 0, 83 | }) 84 | utils.Logger.Infof("Set speed to %v m/s", request.NewSpeed) 85 | 86 | return &pb.SetSpeedResponse{CommandSucceeded: true}, nil 87 | } 88 | 89 | // GotoWaypoint tells the plane to go to a specific point 90 | func (s *mastermindServiceServer) GotoWaypoint(_ context.Context, request *pb.GotoWaypointRequest) (*pb.GotoWaypointResponse, error) { 91 | utils.Logger.Infof("GOTO lat:%v lon:%v alt:%v", request.Lat, request.Lon, request.Alt) 92 | 93 | s.node.WriteMessageAll(&ardupilotmega.MessageMissionItem{ 94 | TargetSystem: s.sysId, 95 | TargetComponent: s.compId, 96 | Seq: 0, 97 | Frame: ardupilotmega.MAV_FRAME_GLOBAL_RELATIVE_ALT, 98 | Command: ardupilotmega.MAV_CMD_NAV_WAYPOINT, 99 | Current: 2, 100 | Autocontinue: 1, 101 | Param1: 0, 102 | Param2: 0, 103 | Param3: 0, 104 | Param4: 0, 105 | X: request.Lat, 106 | Y: request.Lon, 107 | Z: request.Alt, 108 | MissionType: ardupilotmega.MAV_MISSION_TYPE_MISSION, 109 | }) 110 | 111 | return &pb.GotoWaypointResponse{CommandSucceeded: true}, nil 112 | 113 | } 114 | 115 | const SET_ATTITUDE_TIMEOUT_SECONDS = 6 116 | 117 | // SetAttitude tells the plane to obtain a specific attitude 118 | func (s *mastermindServiceServer) SetAttitude(stream pb.MastermindService_SetAttitudeServer) error { 119 | // track time for case of timeout 120 | startTime := time.Now() 121 | utils.Logger.Info("SetAttitude() called") 122 | 123 | // Create a new timer with a 1-second duration 124 | noNewTargetTimer := time.NewTimer(1 * time.Second) 125 | 126 | targetUpdated := make(chan struct{}) 127 | 128 | ctx, cancel := context.WithCancel(context.Background()) 129 | 130 | go func() { 131 | for { 132 | select { 133 | case <-ctx.Done(): 134 | return 135 | case <-noNewTargetTimer.C: 136 | s.targetMu.Lock() 137 | s.target = nil 138 | s.targetMu.Unlock() 139 | case <-targetUpdated: 140 | noNewTargetTimer.Reset(2 * time.Second) 141 | } 142 | } 143 | }() 144 | 145 | defer cancel() 146 | 147 | // set mode to KOUSTECH_LOCK ONE TIME ONLY 148 | utils.Logger.Info("Setting mode to KOUSTECH_LOCK") 149 | s.node.WriteMessageAll(&ardupilotmega.MessageCommandLong{ 150 | TargetSystem: s.sysId, 151 | TargetComponent: s.compId, 152 | Command: ardupilotmega.MAV_CMD_DO_SET_MODE, 153 | Confirmation: 0, 154 | Param1: 1, // PARAM1 MUST BE MAIN MODE (koustech) 155 | Param2: MODE_KOUSTECH_LOCK, // PARAM2 MUST BE SUBMODE 156 | Param3: 0, 157 | Param4: 0, 158 | Param5: 0, 159 | Param6: 0, 160 | Param7: 0, 161 | }) 162 | 163 | for { 164 | currentTime := time.Now() 165 | if currentTime.Sub(startTime).Seconds() > 6 { 166 | break 167 | } 168 | 169 | attitudeRequest, err := stream.Recv() 170 | 171 | if err != nil { 172 | break 173 | } 174 | 175 | s.node.WriteMessageAll(&ardupilotmega.MessageCommandLong{ 176 | TargetSystem: s.sysId, 177 | TargetComponent: s.compId, 178 | Command: MAV_CMD_NAV_LOCK_KSTCH, 179 | Confirmation: 0, 180 | Param1: attitudeRequest.Target.XLock, 181 | Param2: attitudeRequest.Target.YLock, 182 | Param3: LOCK_DEFAULT_DISTANCE, 183 | Param4: 0, 184 | Param5: 0, 185 | Param6: 0, 186 | Param7: 0, 187 | }) 188 | 189 | s.targetMu.Lock() 190 | s.target = attitudeRequest.Target 191 | s.targetMu.Unlock() 192 | 193 | // Signal that the target has been updated 194 | targetUpdated <- struct{}{} 195 | } 196 | 197 | // close stream once EOF is received and set target to nil 198 | utils.Logger.Info("SetAttitude() finished") 199 | 200 | s.targetMu.Lock() 201 | s.target = nil 202 | s.targetMu.Unlock() 203 | 204 | return stream.SendAndClose(&pb.SetAttitudeResponse{}) 205 | 206 | } 207 | func (s *mastermindServiceServer) GetKamikazeStartTime(_ context.Context, request *pb.GetKamikazeStartTimeRequest) (*pb.GetKamikazeStartTimeResponse, error) { 208 | var temp time.Time = kamikaze_start_time 209 | utils.Logger.Debugf("retrieving kamikaze start time %v", temp) 210 | kamikaze_start_time = time.Time{} 211 | utils.Logger.Debugf("nereden nereye %v", temp) 212 | 213 | return &pb.GetKamikazeStartTimeResponse{ 214 | Time: &pb.Time{ 215 | Hours: uint32(temp.Hour()), 216 | Minutes: uint32(temp.Minute()), 217 | Seconds: uint32(temp.Second()), 218 | Milliseconds: uint32(temp.Nanosecond() * 1000), 219 | }, 220 | }, nil 221 | } 222 | 223 | func (s *mastermindServiceServer) DoKamikaze(_ context.Context, request *pb.DoKamikazeRequest) (*pb.DoKamikazeResponse, error) { 224 | utils.Logger.Info("DoKamikaze() called") 225 | 226 | // set mode to KOUSTECH_KAMIKAZE ONE TIME ONLY 227 | SetModeKamikaze(s.sysId, s.compId, s.node) 228 | 229 | // set kamikaze start time 230 | kamikaze_start_time = time.Now() 231 | 232 | return &pb.DoKamikazeResponse{}, nil 233 | } 234 | -------------------------------------------------------------------------------- /server/server.go: -------------------------------------------------------------------------------- 1 | package server 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | "sync" 7 | 8 | "google.golang.org/grpc/reflection" 9 | 10 | "github.com/aler9/gomavlib" 11 | "github.com/google/uuid" 12 | evbus "github.com/ispringtech/eventbus" 13 | pb "github.com/koustech/mastermind/gen/go/proto/mastermind/v1" 14 | 15 | u "github.com/koustech/mastermind/utils" 16 | "google.golang.org/grpc" 17 | ) 18 | 19 | func Run(listenOn string, node *gomavlib.Node, sysId uint8, compId uint8) error { 20 | listener, err := net.Listen("tcp", listenOn) 21 | if err != nil { 22 | return fmt.Errorf("failed to listen on %s: %w", listenOn, err) 23 | } 24 | 25 | gRPCServer := grpc.NewServer() 26 | serviceServer := NewMastermindServiceServer(node, sysId, compId) 27 | pb.RegisterMastermindServiceServer(gRPCServer, serviceServer) 28 | reflection.Register(gRPCServer) 29 | 30 | go GetTelem(serviceServer, node) 31 | 32 | u.Logger.Infof("Listening on %v", listenOn) 33 | if err := gRPCServer.Serve(listener); err != nil { 34 | return fmt.Errorf("failed to serve gRPC server: %w", err) 35 | } 36 | 37 | return nil 38 | } 39 | 40 | // mastermindServiceServer implements the MastermindService API. 41 | type mastermindServiceServer struct { 42 | pb.UnimplementedMastermindServiceServer 43 | stateMu sync.Mutex // protects currentState 44 | currentState pb.MissionState 45 | 46 | stateUpdateHandlers map[uuid.UUID]evbus.Subscription // stateUpdateFuncs for all active sessison 47 | telemUpdateHandlers map[uuid.UUID]evbus.Subscription 48 | stateBus evbus.Bus // event notifier for state changes 49 | node *gomavlib.Node // node connected to the plane 50 | sysId uint8 // MAVLink system ID of the plane 51 | compId uint8 // MAVLink component ID of the autopilot 52 | target *pb.Target // Target being followed by tracking service 53 | targetMu sync.Mutex // protects target 54 | } 55 | 56 | func NewMastermindServiceServer(node *gomavlib.Node, sysId uint8, compId uint8) *mastermindServiceServer { 57 | // initializes state and allocates channels into empty channels slice 58 | stateBus := evbus.New() 59 | stateUpdateHandlers := make(map[uuid.UUID]evbus.Subscription) // handlers for every stateupdate func 60 | telemUpdateHandlers := make(map[uuid.UUID]evbus.Subscription) // handlers for every stateupdate func 61 | return &mastermindServiceServer{ 62 | currentState: pb.MissionState_MISSION_STATE_APPROACH, 63 | stateBus: stateBus, 64 | stateUpdateHandlers: stateUpdateHandlers, 65 | telemUpdateHandlers: telemUpdateHandlers, 66 | node: node, 67 | sysId: sysId, 68 | compId: compId, 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /server/state.go: -------------------------------------------------------------------------------- 1 | package server 2 | 3 | import ( 4 | "io" 5 | 6 | "github.com/google/uuid" 7 | evbus "github.com/ispringtech/eventbus" 8 | pb "github.com/koustech/mastermind/gen/go/proto/mastermind/v1" 9 | "github.com/koustech/mastermind/state" 10 | 11 | u "github.com/koustech/mastermind/utils" 12 | 13 | ) 14 | 15 | const ( 16 | EventNewState = evbus.EventID("new_state") 17 | ) 18 | 19 | type NewStateEvent struct { 20 | response *pb.UpdateStateResponse 21 | } 22 | 23 | func (e *NewStateEvent) EventID() evbus.EventID { 24 | return EventNewState 25 | } 26 | 27 | 28 | // UpdateState updates the current state according to the state transition table 29 | func (s *mastermindServiceServer) UpdateState(stream pb.MastermindService_UpdateStateServer) error { 30 | // generate new sessionId and add channel 31 | sessionId := uuid.New() 32 | u.Logger.Info("new connection for session: ", sessionId) 33 | 34 | errChan := make(chan error) 35 | 36 | cleanup := func() { 37 | s.stateBus.Unsubscribe(s.stateUpdateHandlers[sessionId]) 38 | delete(s.stateUpdateHandlers, sessionId) 39 | u.Logger.Infof("unsubscribed session: %v from event bus", sessionId) 40 | } 41 | 42 | defer cleanup() 43 | s.stateUpdateHandlers[sessionId] = s.stateBus.Subscribe(EventNewState, func(e evbus.Event) { 44 | se := e.(*NewStateEvent) 45 | response := se.response 46 | if err := stream.Send(response); err != nil { 47 | u.Logger.Error("stream closed") 48 | errChan <- err 49 | } 50 | u.Logger.Debugf("sent state response through %v channel", sessionId) 51 | }) 52 | 53 | for { 54 | select { 55 | case err := <-errChan: 56 | u.Logger.Errorf("error received: %v", err) 57 | return err 58 | default: 59 | } 60 | 61 | req, err := stream.Recv() 62 | if err == io.EOF { 63 | return nil 64 | } 65 | if err != nil { 66 | return err 67 | } 68 | u.Logger.Debugf("request received on session %v", sessionId) 69 | 70 | s.stateMu.Lock() 71 | u.Logger.Debugf("state mutex locked") 72 | 73 | oldState := s.currentState 74 | 75 | s.currentState, err = state.ResolveState(req.StateTransition, s.currentState) 76 | if err != nil { 77 | u.Logger.Warn(err) 78 | } 79 | if s.currentState == pb.MissionState_MISSION_STATE_KAMIKAZE && Kamikazeflag{ 80 | Kamikazeflag = false 81 | 82 | } 83 | u.Logger.Infof("%v -> %v", oldState, s.currentState) 84 | 85 | s.stateBus.Publish(&NewStateEvent{response: &pb.UpdateStateResponse{OldState: oldState, StateTransition: req.StateTransition, CurrentState: s.currentState}}) 86 | 87 | s.stateMu.Unlock() 88 | u.Logger.Debugf("state mutex unlocked") 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /server/telemetry.go: -------------------------------------------------------------------------------- 1 | package server 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/aler9/gomavlib" 7 | "github.com/aler9/gomavlib/pkg/dialects/ardupilotmega" 8 | "github.com/google/uuid" 9 | evbus "github.com/ispringtech/eventbus" 10 | pb "github.com/koustech/mastermind/gen/go/proto/mastermind/v1" 11 | u "github.com/koustech/mastermind/utils" 12 | ) 13 | 14 | const ( 15 | EventNewTelemetry = evbus.EventID("new_telemetry") 16 | ) 17 | 18 | type NewTelemetryEvent struct { 19 | response *pb.GetDetailedTelemetryResponse 20 | } 21 | 22 | func (e *NewTelemetryEvent) EventID() evbus.EventID { 23 | return EventNewTelemetry 24 | } 25 | 26 | var Kamikazeflag = false 27 | var kamikaze_start_time time.Time 28 | 29 | const KamikazeSequence = 4 30 | const WAIT_KAMIKAZE_TIME_S = 10 31 | 32 | func GetTelem(s *mastermindServiceServer, node *gomavlib.Node) { 33 | vfrHud := ardupilotmega.MessageVfrHud{} 34 | attitude := ardupilotmega.MessageAttitude{} 35 | globalPositionInt := ardupilotmega.MessageGlobalPositionInt{} 36 | navControllerOutput := ardupilotmega.MessageNavControllerOutput{} 37 | batteryStatus := ardupilotmega.MessageBatteryStatus{} 38 | wind := ardupilotmega.MessageWind{} 39 | 40 | isAutonomous := false // plane is autonomous if not in FBWA, MANUAL, or AUTOTUNE modes 41 | 42 | var timeBootMs uint64 43 | 44 | var updateFlag bool 45 | //kamikaze_wait := time.Now() 46 | 47 | // print every message we receive 48 | for evt := range node.Events() { 49 | 50 | updateFlag = true 51 | if frm, ok := evt.(*gomavlib.EventFrame); ok { 52 | if frm.SystemID() != 1 || frm.ComponentID() != 1 { 53 | continue 54 | } 55 | switch msg := frm.Message().(type) { 56 | case *ardupilotmega.MessageAttitude: 57 | attitude = *msg 58 | case *ardupilotmega.MessageVfrHud: 59 | vfrHud = *msg 60 | case *ardupilotmega.MessageGlobalPositionInt: 61 | globalPositionInt = *msg 62 | case *ardupilotmega.MessageNavControllerOutput: 63 | navControllerOutput = *msg 64 | case *ardupilotmega.MessageBatteryStatus: 65 | batteryStatus = *msg 66 | updateFlag = false // Don't want to increase message sending frequency just for battery 67 | case *ardupilotmega.MessageSystemTime: 68 | timeBootMs = msg.TimeUnixUsec / 1000 69 | case *ardupilotmega.MessageMissionAck: 70 | u.Logger.Debugf("received mission ack: %+v", msg) 71 | updateFlag = false 72 | case *ardupilotmega.MessageWind: 73 | wind = *msg 74 | updateFlag = false 75 | case *ardupilotmega.MessageHeartbeat: 76 | switch ardupilotmega.PLANE_MODE(msg.CustomMode) { 77 | case ardupilotmega.PLANE_MODE_MANUAL, 78 | ardupilotmega.PLANE_MODE_FLY_BY_WIRE_A, 79 | ardupilotmega.PLANE_MODE_FLY_BY_WIRE_B, 80 | ardupilotmega.PLANE_MODE_AUTOTUNE: 81 | 82 | isAutonomous = false 83 | default: 84 | isAutonomous = true 85 | } 86 | 87 | case *ardupilotmega.MessageMissionItemReached: 88 | u.Logger.Debugf("received mission item reached: %+v", msg) 89 | recieved := msg.Seq 90 | if recieved == KamikazeSequence { 91 | if s.currentState == pb.MissionState_MISSION_STATE_KAMIKAZE { 92 | kamikaze_start_time = time.Now() 93 | u.Logger.Warnf("Kamikaze waypoint reached UCHAK DALIOGHR!!!") 94 | u.Logger.Warnf("kamikaze started at: %v", kamikaze_start_time) 95 | SetModeKamikaze(frm.SystemID(), frm.ComponentID(), node) 96 | } 97 | } 98 | 99 | // case *ardupilotmega.MessageMissionCurrent: 100 | 101 | // recieved := msg.Seq 102 | // if recieved == KamikazeSequence { 103 | // elapsed_kamikaze_time := time.Now() 104 | // if elapsed_kamikaze_time.Sub(kamikaze_wait) > time.Duration(WAIT_KAMIKAZE_TIME_S)*time.Second { 105 | // Kamikazeflag = false 106 | // } 107 | // if s.currentState == pb.MissionState_MISSION_STATE_KAMIKAZE && !Kamikazeflag { 108 | // u.Logger.Warnf("Kamikaze waypoint reached UCHAK DALIOGHR!!!") 109 | // kamikaze_wait = time.Now() 110 | // Kamikazeflag = true 111 | // SetModeKamikaze(frm.SystemID(), frm.ComponentID(), node) 112 | // } 113 | // } 114 | default: 115 | updateFlag = false 116 | } 117 | 118 | if updateFlag { 119 | s.stateBus.Publish(&NewTelemetryEvent{ 120 | response: &pb.GetDetailedTelemetryResponse{ 121 | TimeBootMs: timeBootMs, 122 | Lat: globalPositionInt.Lat, 123 | Lon: globalPositionInt.Lon, 124 | RelativeAlt: globalPositionInt.RelativeAlt, 125 | Roll: attitude.Roll, 126 | Pitch: attitude.Pitch, 127 | Yaw: attitude.Yaw, 128 | Airspeed: vfrHud.Airspeed, 129 | Groundspeed: vfrHud.Groundspeed, 130 | WpDist: uint32(navControllerOutput.WpDist), 131 | Battery: int32(batteryStatus.BatteryRemaining), 132 | Autonomous: isAutonomous, 133 | Target: nil, 134 | WindSpeed: wind.Speed, 135 | WindDirection: wind.Direction, 136 | }, 137 | }) 138 | } 139 | } 140 | } 141 | } 142 | 143 | // GetTelemetry sends a stream of telemetry to all clients 144 | func (s *mastermindServiceServer) GetTelemetry(_ *pb.GetTelemetryRequest, stream pb.MastermindService_GetTelemetryServer) error { 145 | // generate new sessionId and add channel 146 | sessionId := uuid.New() 147 | u.Logger.Info("new connection for session: ", sessionId) 148 | 149 | errChan := make(chan error) 150 | 151 | s.telemUpdateHandlers[sessionId] = s.stateBus.Subscribe(EventNewTelemetry, func(e evbus.Event) { 152 | se := e.(*NewTelemetryEvent) 153 | 154 | // change detailed telemetry to normal telem response 155 | response := &pb.GetTelemetryResponse{ 156 | TimeBootMs: se.response.TimeBootMs, 157 | Lat: se.response.Lat, 158 | Lon: se.response.Lon, 159 | RelativeAlt: se.response.RelativeAlt, 160 | Roll: se.response.Roll, 161 | Pitch: se.response.Pitch, 162 | Yaw: se.response.Yaw, 163 | Airspeed: se.response.Airspeed, 164 | Groundspeed: se.response.Groundspeed, 165 | WpDist: se.response.WpDist, 166 | WindSpeed: se.response.WindSpeed, 167 | WindDirection: se.response.WindDirection, 168 | } 169 | if err := stream.Send(response); err != nil { 170 | s.stateBus.Unsubscribe(s.telemUpdateHandlers[sessionId]) 171 | delete(s.telemUpdateHandlers, sessionId) 172 | u.Logger.Infof("unsubscribed telem session: %v from event bus", sessionId) 173 | 174 | errChan <- err 175 | } 176 | }) 177 | 178 | <-errChan 179 | return nil 180 | } 181 | 182 | // GetDetailedTelemetry sends a stream of detailed telemetry to all clients 183 | func (s *mastermindServiceServer) GetDetailedTelemetry(_ *pb.GetDetailedTelemetryRequest, stream pb.MastermindService_GetDetailedTelemetryServer) error { 184 | // generate new sessionId and add channel 185 | sessionId := uuid.New() 186 | u.Logger.Info("new connection for session: ", sessionId) 187 | 188 | errChan := make(chan error) 189 | 190 | s.telemUpdateHandlers[sessionId] = s.stateBus.Subscribe(EventNewTelemetry, func(e evbus.Event) { 191 | se := e.(*NewTelemetryEvent) 192 | response := se.response 193 | s.targetMu.Lock() 194 | se.response.Target = s.target 195 | s.targetMu.Unlock() 196 | 197 | if err := stream.Send(response); err != nil { 198 | s.stateBus.Unsubscribe(s.telemUpdateHandlers[sessionId]) 199 | delete(s.telemUpdateHandlers, sessionId) 200 | u.Logger.Infof("unsubscribed telem session: %v from event bus", sessionId) 201 | 202 | errChan <- err 203 | } 204 | }) 205 | 206 | <-errChan 207 | return nil 208 | } 209 | -------------------------------------------------------------------------------- /state/state.go: -------------------------------------------------------------------------------- 1 | package state 2 | 3 | import ( 4 | "errors" 5 | 6 | . "github.com/koustech/mastermind/gen/go/proto/mastermind/v1" 7 | ) 8 | 9 | // ErrInvalidStateTransition is the error returned by ResolveState when an invalid StateTransition happens 10 | var ErrInvalidStateTransition = errors.New("current state has no defined behavior for requested state transition") 11 | 12 | // ResolveState resolves the MissionState according to the current MissionState and StateTransition given as input 13 | func ResolveState(stateTransition StateTransition, currentState MissionState) (MissionState, error) { 14 | 15 | // mode overrides 16 | switch stateTransition { 17 | case StateTransition_STATE_TRANSITION_MODE_KAMIKAZE_SELECTED: 18 | return MissionState_MISSION_STATE_KAMIKAZE, nil 19 | case StateTransition_STATE_TRANSITION_MODE_APPROACH_SELECTED: 20 | return MissionState_MISSION_STATE_APPROACH, nil 21 | case StateTransition_STATE_TRANSITION_MODE_NEUTRAL_SELECTED: 22 | return MissionState_MISSION_STATE_NEUTRAL, nil 23 | } 24 | 25 | switch currentState { 26 | case MissionState_MISSION_STATE_APPROACH: 27 | switch stateTransition { 28 | case StateTransition_STATE_TRANSITION_TARGET_APPROACHED: 29 | return MissionState_MISSION_STATE_DETECTING, nil 30 | case StateTransition_STATE_TRANSITION_TARGET_APPROACHED_GPS: 31 | return MissionState_MISSION_STATE_DETECTING_GPS, nil 32 | case StateTransition_STATE_TRANSITION_MODE_KAMIKAZE_SELECTED: 33 | return MissionState_MISSION_STATE_KAMIKAZE, nil 34 | default: 35 | return MissionState_MISSION_STATE_APPROACH, ErrInvalidStateTransition 36 | } 37 | case MissionState_MISSION_STATE_DETECTING: 38 | switch stateTransition { 39 | case StateTransition_STATE_TRANSITION_TARGET_DETECTED: 40 | return MissionState_MISSION_STATE_LOCK, nil 41 | default: 42 | return MissionState_MISSION_STATE_DETECTING, ErrInvalidStateTransition 43 | } 44 | case MissionState_MISSION_STATE_DETECTING_GPS: 45 | switch stateTransition { 46 | case StateTransition_STATE_TRANSITION_TARGET_DETECTED: 47 | return MissionState_MISSION_STATE_LOCK_GPS, nil 48 | default: 49 | return MissionState_MISSION_STATE_DETECTING_GPS, ErrInvalidStateTransition 50 | } 51 | case MissionState_MISSION_STATE_LOCK: 52 | switch stateTransition { 53 | case StateTransition_STATE_TRANSITION_LOCK_FAILED: 54 | return MissionState_MISSION_STATE_APPROACH, nil 55 | case StateTransition_STATE_TRANSITION_LOCK_SUCCESS: 56 | return MissionState_MISSION_STATE_APPROACH, nil 57 | case StateTransition_STATE_TRANSITION_MODE_KAMIKAZE_SELECTED: 58 | return MissionState_MISSION_STATE_KAMIKAZE, nil 59 | default: 60 | return MissionState_MISSION_STATE_LOCK, ErrInvalidStateTransition 61 | } 62 | case MissionState_MISSION_STATE_LOCK_GPS: 63 | switch stateTransition { 64 | case StateTransition_STATE_TRANSITION_LOCK_FAILED: 65 | return MissionState_MISSION_STATE_APPROACH, nil 66 | case StateTransition_STATE_TRANSITION_LOCK_SUCCESS: 67 | return MissionState_MISSION_STATE_APPROACH, nil 68 | case StateTransition_STATE_TRANSITION_MODE_KAMIKAZE_SELECTED: 69 | return MissionState_MISSION_STATE_KAMIKAZE, nil 70 | default: 71 | return MissionState_MISSION_STATE_LOCK_GPS, ErrInvalidStateTransition 72 | } 73 | case MissionState_MISSION_STATE_KAMIKAZE: 74 | switch stateTransition { 75 | case StateTransition_STATE_TRANSITION_QR_FAILED: 76 | return MissionState_MISSION_STATE_KAMIKAZE, nil 77 | case StateTransition_STATE_TRANSITION_QR_SUCCESS: 78 | return MissionState_MISSION_STATE_APPROACH, nil 79 | case StateTransition_STATE_TRANSITION_MODE_APPROACH_SELECTED: 80 | return MissionState_MISSION_STATE_APPROACH, nil 81 | default: 82 | return MissionState_MISSION_STATE_KAMIKAZE, ErrInvalidStateTransition 83 | } 84 | case MissionState_MISSION_STATE_NEUTRAL: 85 | switch stateTransition { 86 | case StateTransition_STATE_TRANSITION_MODE_APPROACH_SELECTED: 87 | return MissionState_MISSION_STATE_APPROACH, nil 88 | case StateTransition_STATE_TRANSITION_MODE_KAMIKAZE_SELECTED: 89 | return MissionState_MISSION_STATE_KAMIKAZE, nil 90 | default: 91 | return MissionState_MISSION_STATE_NEUTRAL, ErrInvalidStateTransition 92 | } 93 | default: 94 | return MissionState_MISSION_STATE_APPROACH, ErrInvalidStateTransition 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /state/state_test.go: -------------------------------------------------------------------------------- 1 | package state 2 | 3 | import ( 4 | "testing" 5 | 6 | . "github.com/koustech/mastermind/gen/go/proto/mastermind/v1" 7 | "github.com/stretchr/testify/assert" 8 | "github.com/stretchr/testify/require" 9 | ) 10 | 11 | // TestResolveStateValidTransitions checks that transitions are correctly resolved for all defined state transitions 12 | func TestResolveStateValidTransitions(t *testing.T) { 13 | // Setup 14 | testCases := []struct { 15 | desc string 16 | stateTransition StateTransition 17 | inputState MissionState 18 | resultState MissionState 19 | err error 20 | }{ 21 | { 22 | desc: "transition from approach state to detecting state with target_approached", 23 | stateTransition: StateTransition_STATE_TRANSITION_TARGET_APPROACHED, 24 | inputState: MissionState_MISSION_STATE_APPROACH, 25 | resultState: MissionState_MISSION_STATE_DETECTING, 26 | err: nil, 27 | }, 28 | { 29 | desc: "transition from approach state to detecting_gps state with target_approached_gps", 30 | stateTransition: StateTransition_STATE_TRANSITION_TARGET_APPROACHED_GPS, 31 | inputState: MissionState_MISSION_STATE_APPROACH, 32 | resultState: MissionState_MISSION_STATE_DETECTING_GPS, 33 | err: nil, 34 | }, 35 | { 36 | desc: "transition from approach state to kamikaze state with mode kamikaze selected", 37 | stateTransition: StateTransition_STATE_TRANSITION_MODE_KAMIKAZE_SELECTED, 38 | inputState: MissionState_MISSION_STATE_APPROACH, 39 | resultState: MissionState_MISSION_STATE_KAMIKAZE, 40 | err: nil, 41 | }, 42 | { 43 | desc: "transition from detecting_gps state to lock_gps state with target_detected", 44 | stateTransition: StateTransition_STATE_TRANSITION_TARGET_DETECTED, 45 | inputState: MissionState_MISSION_STATE_DETECTING_GPS, 46 | resultState: MissionState_MISSION_STATE_LOCK_GPS, 47 | err: nil, 48 | }, 49 | { 50 | desc: "transition from detecting state to lock state with target_detected", 51 | stateTransition: StateTransition_STATE_TRANSITION_TARGET_DETECTED, 52 | inputState: MissionState_MISSION_STATE_DETECTING, 53 | resultState: MissionState_MISSION_STATE_LOCK, 54 | err: nil, 55 | }, 56 | { 57 | desc: "transition from lock state to approach state with lock_failed", 58 | stateTransition: StateTransition_STATE_TRANSITION_LOCK_FAILED, 59 | inputState: MissionState_MISSION_STATE_LOCK, 60 | resultState: MissionState_MISSION_STATE_APPROACH, 61 | err: nil, 62 | }, 63 | { 64 | desc: "transition from lock_gps state to approach state with lock_failed", 65 | stateTransition: StateTransition_STATE_TRANSITION_LOCK_FAILED, 66 | inputState: MissionState_MISSION_STATE_LOCK_GPS, 67 | resultState: MissionState_MISSION_STATE_APPROACH, 68 | err: nil, 69 | }, 70 | { 71 | desc: "transition from lock state to approach state with lock_success", 72 | stateTransition: StateTransition_STATE_TRANSITION_LOCK_SUCCESS, 73 | inputState: MissionState_MISSION_STATE_LOCK, 74 | resultState: MissionState_MISSION_STATE_APPROACH, 75 | err: nil, 76 | }, 77 | { 78 | desc: "transition from lock_gps state to approach state with lock_success", 79 | stateTransition: StateTransition_STATE_TRANSITION_LOCK_SUCCESS, 80 | inputState: MissionState_MISSION_STATE_LOCK_GPS, 81 | resultState: MissionState_MISSION_STATE_APPROACH, 82 | err: nil, 83 | }, 84 | { 85 | desc: "transition from lock state to kamikaze state with mode kamikaze selected", 86 | stateTransition: StateTransition_STATE_TRANSITION_MODE_KAMIKAZE_SELECTED, 87 | inputState: MissionState_MISSION_STATE_LOCK, 88 | resultState: MissionState_MISSION_STATE_KAMIKAZE, 89 | err: nil, 90 | }, 91 | { 92 | desc: "transition from lock_gps state to kamikaze state with mode kamikaze selected", 93 | stateTransition: StateTransition_STATE_TRANSITION_MODE_KAMIKAZE_SELECTED, 94 | inputState: MissionState_MISSION_STATE_LOCK_GPS, 95 | resultState: MissionState_MISSION_STATE_KAMIKAZE, 96 | err: nil, 97 | }, 98 | { 99 | desc: "transition from kamikaze state to kamikaze state with QR failed", 100 | stateTransition: StateTransition_STATE_TRANSITION_QR_FAILED, 101 | inputState: MissionState_MISSION_STATE_KAMIKAZE, 102 | resultState: MissionState_MISSION_STATE_KAMIKAZE, 103 | err: nil, 104 | }, 105 | { 106 | desc: "transition from kamikaze state to approach state with QR success", 107 | stateTransition: StateTransition_STATE_TRANSITION_QR_SUCCESS, 108 | inputState: MissionState_MISSION_STATE_KAMIKAZE, 109 | resultState: MissionState_MISSION_STATE_APPROACH, 110 | err: nil, 111 | }, 112 | { 113 | desc: "transition from kamikaze state to approach state with mode approach selected", 114 | stateTransition: StateTransition_STATE_TRANSITION_MODE_APPROACH_SELECTED, 115 | inputState: MissionState_MISSION_STATE_KAMIKAZE, 116 | resultState: MissionState_MISSION_STATE_APPROACH, 117 | err: nil, 118 | }, 119 | } 120 | 121 | for _, scenario := range testCases { 122 | t.Run(scenario.desc, func(t *testing.T) { 123 | result, err := ResolveState(scenario.stateTransition, scenario.inputState) 124 | require.NoError(t, err) 125 | assert.Equal(t, scenario.resultState, result) 126 | }) 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /telemetry/telemetry.go: -------------------------------------------------------------------------------- 1 | package telemetry 2 | 3 | import ( 4 | "github.com/aler9/gomavlib" 5 | "github.com/aler9/gomavlib/pkg/dialects/ardupilotmega" 6 | "github.com/koustech/mastermind/utils" 7 | ) 8 | 9 | func ConnectToVehicle(address string) (node *gomavlib.Node, systemId uint8, componentId uint8) { 10 | node, err := gomavlib.NewNode(gomavlib.NodeConf{ 11 | Endpoints: []gomavlib.EndpointConf{ 12 | gomavlib.EndpointUDPServer{Address: address}, 13 | }, 14 | Dialect: ardupilotmega.Dialect, 15 | OutVersion: gomavlib.V2, // change to V1 if you're unable to communicate with the target 16 | OutSystemID: 10, 17 | }) 18 | if err != nil { 19 | utils.Logger.Fatal(err) 20 | } 21 | awaitHeartbeat := func() { 22 | for evt := range node.Events() { 23 | switch evt.(type) { 24 | case *gomavlib.EventChannelOpen: 25 | return 26 | } 27 | } 28 | } 29 | getSysDetails := func() (uint8, uint8) { 30 | var sysId uint8 31 | var compId uint8 32 | for evt := range node.Events() { 33 | if frm, ok := evt.(*gomavlib.EventFrame); ok { 34 | sysId = frm.SystemID() 35 | compId = frm.ComponentID() 36 | break 37 | } 38 | } 39 | return sysId, compId 40 | } 41 | 42 | awaitHeartbeat() 43 | sysId, compId := getSysDetails() 44 | utils.Logger.Infof("received heartbeat from %s sysid: %v cid: %v", address, sysId, compId) 45 | return node, sysId, compId 46 | } 47 | -------------------------------------------------------------------------------- /utils/log.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "os" 5 | 6 | "go.uber.org/zap" 7 | "go.uber.org/zap/zapcore" 8 | ) 9 | 10 | var Logger *zap.SugaredLogger 11 | 12 | // InitializeLoggers creates a new Logger and it's respective Sugar logger for simpler logging. 13 | // Should only be called once 14 | func InitializeLoggers() { 15 | config := zap.NewProductionEncoderConfig() 16 | config.EncodeTime = zapcore.ISO8601TimeEncoder 17 | fileEncoder := zapcore.NewJSONEncoder(config) 18 | consoleEncoder := zapcore.NewConsoleEncoder(config) 19 | logFile, _ := os.OpenFile("log.json", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o644) 20 | writer := zapcore.AddSync(logFile) 21 | defaultLogLevel := zapcore.DebugLevel 22 | core := zapcore.NewTee( 23 | zapcore.NewCore(fileEncoder, writer, defaultLogLevel), 24 | zapcore.NewCore(consoleEncoder, zapcore.AddSync(os.Stdout), defaultLogLevel), 25 | ) 26 | Logger = zap.New(core, zap.AddCaller(), zap.AddStacktrace(zapcore.ErrorLevel)).Sugar() 27 | } 28 | 29 | // SyncLogger synchronizes flushes the buffer if it exists 30 | func SyncLogger() { 31 | err := Logger.Sync() 32 | if err != nil { 33 | return 34 | } 35 | } 36 | --------------------------------------------------------------------------------