-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcyberdog_app.proto
735 lines (653 loc) · 16.5 KB
/
cyberdog_app.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
// Copyright 2015 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
option java_multiple_files = true;
option java_package = "io.grpc.cyberdogapp";
option java_outer_classname = "CyberdogAppProto";
option objc_class_prefix = "RTG";
package cyberdogapp;
service CyberdogApp {
// app work as client
rpc setMode(CheckoutMode_request) returns (stream CheckoutMode_respond) {}
rpc setPattern(CheckoutPattern_request) returns (stream CheckoutPattern_respond) {}
rpc setFollowRegion(BodyRegion_Request) returns (stream BodyRegion_Respond) {}
rpc requestCamera(CameraService_request) returns (stream CameraService_respond) {}
rpc requestVoice(Voiceprint_Request) returns (stream Voiceprint_Response) {}
rpc requestFaceManager(FaceManager_Request) returns (stream FaceManager_Response) {}
rpc sendAppDecision(Decissage) returns (Result) {}
rpc sendAiToken(TokenPass_Request) returns (stream TokenPass_Response) {}
rpc setNavPosition(Target_Request) returns (stream Target_Response) {}
rpc setExtmonOrder(ExtMonOrder_Request) returns (stream ExtMonOrder_Respond){}
rpc disconnect(Disconnect) returns (stream Result){}
rpc setBtRemoteCmd(BtRemoteCommand_Request) returns (stream BtRemoteCommand_Respond){}
rpc setBodyPara(Parameters) returns (Result) {}
//for motion test
rpc sendMotionTestRequest(MotionCommand) returns(Result) {}
//for offset calibration
rpc getOffsetData(OffsetRequest) returns(stream OffsetCalibationData){}
rpc setOffsetData(OffsetCalibationData) returns(stream OffsetRequest_result){}
// app work as server
rpc subscribeBms(Bms) returns(Result) {}
rpc subscribeWifiRssi (WifiRssi) returns(Result) {}
rpc subscribeStatus(StatusStamped) returns(Result) {}
rpc subscribeTrackingStatus(TrackingStatus) returns(Result) {}
rpc subscribeBodySelect(BodyInfo) returns(Result) {} //body
rpc subscribeTracking(BodyInfo) returns(Result) {} //tracking_result
rpc subscribeMap(OccupancyGrid) returns(Result) {}
rpc subscribePosition(DecisionStamped) returns(Result) {}
rpc subscribeVoiceprintResult(VoiceprintResult) returns(Result) {}
rpc subscribeFaceResult(FaceResult) returns(Result) {}
rpc heartbeat(Ticks) returns(Result) {}
rpc subscribeNavStatus(Caution) returns(Result) {}
rpc subscribeOdomOut(Odometry) returns(Result) {}
rpc subscribeObstacleDetection(Around) returns(Result) {}
rpc subscribeDogPose(DogPose) returns(Result) {}
rpc subscribeGpsScene(Scene) returns(Result) {}
rpc subscribeRemoteEvent(RemoteEvent) returns(Result) {}
rpc subscribePath(Path) returns(Result) {}
}
message Path{
Header header = 1;
repeated PoseStamped posestamped = 2;
}
message PoseStamped{
Header header = 1;
Pose pose = 2;
}
message RemoteEvent{
fixed32 scan_status = 1;
fixed32 remote_status = 2;
string address = 3;
string scan_device_info = 4;
string error = 5;
}
message BtRemoteCommand_Request{
enum COMMAND {
GET_STATUS = 0;
SCAN_DEVICE = 1;
CONNECT_DEVICE = 2;
DISCONNECT_DEVICE = 3;
REMOTE_RECONNECT_DEVICE = 4;
}
fixed32 command = 1;
string address = 2;
}
message BtRemoteCommand_Respond{
bool success = 1;
}
message Disconnect{
fixed32 reason = 1;
}
message ExtMonOrder_Request{
MonOrder order = 1;
fixed32 timeout = 2;
}
message ExtMonOrder_Respond{
enum ERR_CODE {
NORMAL = 0;
EXE_FAILED = 1;
REJECT = 2;
CANCELED = 4;
BAD_TIMESTAMP = 8;
}
MonOrder order = 1;
fixed32 err_code = 2;
bool succeed = 3;
bool is_feedback = 4;
fixed32 request_id = 5;
}
message Freameid{
fixed32 id = 1;
enum FRAMEID{
DEFAULT_FRAME = 0;
BODY_FRAME = 1;
ODOM_FRAME = 2;
VISION_FRAME = 3;
NAVI_FRAME = 4;
}
}
message DogPose{
Freameid frameid = 1;
Timestamp timestamp = 2;
double position_x = 3;
double position_y = 4;
double position_z = 5;
double rotation_w = 6;
double rotation_x = 7;
double rotation_y = 8;
double rotation_z = 9;
}
message OffsetRequest_result{
fixed32 gait = 1;
fixed32 result = 2;
enum Result {
SUCCESS = 0;
FAILED = 1;
}
}
message OffsetRequest{
fixed32 gait = 1;
enum Gait{
WALK = 0;
TROT = 1;
FLY_TROT = 2;
SLOW_TROT = 3;
}
}
message OffsetCalibationData{
fixed32 gait = 1;
double x_offset = 2;
double y_offset = 3;
double yaw_offset = 4;
fixed32 result = 5;
enum Result {
SUCCESS = 0;
FAILED = 1;
}
}
message MotionCommand{
fixed32 command = 1;
enum Command{
DEFAULT = 0;
TEST_INIT = 1;
TEST_DEINIT = 2;
TEST_START = 3;
TEST_STOP = 4;
TURN_LEFT = 5;
TURN_RIGHT = 6;
GO_AHEAD = 7;
GO_BACK = 8;
GO_LEFT = 9;
GO_RIGHT = 10;
}
}
message Around{
Ultrasonic front_distance = 1;
Ultrasonic back_distance = 2;
Ultrasonic left_distance = 3;
Ultrasonic right_distance = 4;
}
message Ultrasonic{
Range range_info = 1;
}
message Range{
Header header = 1;
fixed32 radiation_type = 2;
float field_of_view = 3;
float min_range = 4;
float max_range = 5;
float range = 6;
enum Radiation {
ULTRASOUND = 0;
INFRARED = 1;
}
}
message Caution
{
fixed32 error_type = 1;
fixed32 robot_mode = 2;
}
message Ticks{
string ip = 1;
}
message WifiRssi {
string rssi = 1;
}
message Mode {
fixed32 control_mode = 1;
fixed32 mode_type = 2;
}
message Pattern {
fixed32 gait_pattern = 1;
enum GAIT {
GAIT_TRANS = 0;
GAIT_PASSIVE = 1;
GAIT_KNEEL = 2;
GAIT_STAND_R = 3;
GAIT_STAND_B = 4;
GAIT_AMBLE = 5;
GAIT_WALK = 6;
GAIT_SLOW_TROT = 7;
GAIT_TROT = 8;
GAIT_FLYTROT = 9;
GAIT_BOUND = 10;
GAIT_PRONK = 11;
GAIT_DEFAULT = 99;
}
}
message Result {
string result = 1;
}
message Decissage {
Twist twist = 1;
Pose pose = 2;
Safety safety = 3;
}
message Safety {
int32 status = 1;
}
message Parameters {
double body_height = 1;
double gait_height = 2;
}
message Twist {
Vector3 linear = 1;
Vector3 angular = 2;
}
message Pose {
Point position = 1;
Quaternion orientation = 2;
}
message Vector3 {
double x = 1;
double y = 2;
double z = 3;
}
message Point {
double x = 1;
double y = 2;
double z = 3;
}
message Quaternion {
double x = 1;
double y = 2;
double z = 3;
double w = 4;
}
message Bms {
sfixed32 batt_volt = 1;
sfixed32 batt_curr = 2;
fixed32 batt_soc = 3;
sfixed32 batt_temp = 4;
fixed32 batt_st = 5;
fixed32 key_val = 6;
fixed32 disable_charge = 7;
fixed32 power_supply = 8;
fixed32 buzze = 9;
fixed32 status = 10;
}
message StatusStamped {
Header header = 1;
string child_frame_id = 2;
RawStatus status = 3;
}
message ErrorFlag {
sfixed32 exist_error = 1;
sfixed32 ori_error = 2;
sfixed32 footpos_error = 3;
repeated fixed32 motor_error = 4;
}
message RawStatus {
Mode mode = 1;
Pattern pattern = 3;
TwistWithCovariance twist = 4;
PoseWithCovariance pose = 5;
Parameters para = 6;
Safety safety = 7;
Scene scene = 8;
ErrorFlag error_flag = 9;
sfixed32 foot_contact = 10;
Pattern cached_pattern = 11;
MonOrder order = 12;
}
message States {
fixed32 motion_state = 1;
}
message Header {
Timestamp stamp = 1;
string frame_id = 2;
}
message Timestamp {
//The seconds component, valid over all int32 values.
sfixed32 sec = 1;
//The nanoseconds component, valid in the range [0, 10e9).
sfixed32 nanosec = 2;
}
message TwistWithCovariance {
Twist twist = 1;
repeated double covariance = 2;
}
message PoseWithCovariance {
Pose pose = 1;
repeated double covariance = 2;
}
message Scene {
fixed32 type = 1;
float lat = 2;
float lon = 3;
fixed32 if_danger = 4;
enum TYPE{
UNSET = 0;
INDOOR = 1;
OUTDOOR = 2;
}
}
message DecisionStamped {
Header header = 1;
Source id = 2;
Decissage decissage = 3;
}
message Source {
fixed32 source_id = 1;
}
message ModeStamped {
Header header = 1;
Mode mode = 2;
}
message CheckoutMode_request {
ModeStamped next_mode = 1;
fixed32 timeout = 2;
enum Command {
DEFAULT = 0;
LOCK = 1;
CONFIG = 2;
MANUAL = 3;
SEMI = 13;
EXPLOR = 14;
TRACK = 15;
}
enum Type {
DEFAULT_TYPE = 0;
TRACK_F = 1;
TRACK_S = 2;
EXPLOR_NAV_AB = 3;
EXPLOR_MAP_U = 4;
EXPLOR_MAP_N = 5;
}
}
message CheckoutMode_respond {
// respond type
bool is_feedback = 1;
// action_feedback
Header header = 2;
fixed32 current_state = 3;
// action_result
fixed32 err_code = 4;
fixed32 err_state = 5;
bool succeed = 6;
Mode next_mode = 7;
fixed32 request_id = 8;
}
message PatternStamped {
Header header = 1;
Pattern pattern = 2;
}
message CheckoutPattern_request {
PatternStamped patternstamped = 1;
fixed32 timeout = 2;
}
message CheckoutPattern_respond {
// type
bool is_feedback = 1;
// feedback_field
Header header = 2;
Pattern current_checking = 3;
bool last_pattern = 4;
// result
fixed32 err_code = 5;
Pattern err_pattern = 6;
bool succeed = 7;
PatternStamped patternstamped = 8;
fixed32 request_id = 9;
}
message TrackingStatus {
fixed32 status = 1;
enum Status{
OBJECT_FAR = 0;
OBJECT_NEAR = 1;
OBJECT_LOST = 2;
OBJECT_EDGE = 3;
}
}
message BodyInfo {
Header header = 1;
fixed32 count = 2;
repeated Body infos = 3;
}
message Body {
RegionOfInterest roi = 1;
}
message BodyRegion_Request {
RegionOfInterest roi = 1;
}
message BodyRegion_Respond {
bool success = 1;
}
message RegionOfInterest {
fixed32 x_offset = 1;
fixed32 y_offset = 2;
fixed32 height = 3;
fixed32 width = 4;
bool do_rectify = 5;
}
message MonOrder {
fixed32 id = 1;
double para = 2;
enum ID {
MONO_ORDER_NULL = 0;
MONO_ORDER_WAKE_STOP = 1;
MONO_ORDER_SHUT_STOP = 2;
MONO_ORDER_STAND_UP = 9;
MONO_ORDER_PROSTRATE = 10;
MONO_ORDER_COME_HERE = 11;
MONO_ORDER_STEP_BACK = 12;
MONO_ORDER_TURN_AROUND = 13;
MONO_ORDER_HI_FIVE = 14;
MONO_ORDER_DANCE = 15;
MONO_ORDER_WELCOME = 16;
MONO_ORDER_TURN_OVER = 17;
MONO_ORDER_SIT = 18;
MONO_ORDER_BOW = 19;
MONO_ORDER_MAX = 20;
}
}
message CameraService_request {
fixed32 command = 1;
string args = 2;
enum Command {
SET_PARAMETERS = 0;
TAKE_PICTURE = 1;
START_RECORDING = 2;
STOP_RECORDING = 3;
GET_STATE = 4;
DELETE_FILE = 5;
GET_ALL_FILES = 6;
START_LIVE_STREAM = 7;
STOP_LIVE_STREAM = 8;
}
}
message CameraService_respond {
fixed32 command = 1;
fixed32 result = 2;
string msg = 3;
enum Result {
SUCCESS = 0;
INVALID_ARGS = 1;
UNSUPPORTED = 2;
TIMEOUT = 3;
BUSY = 4;
INVALID_STATE = 5;
INNER_ERROR = 6;
UNDEFINED_ERROR = -1;
}
}
enum ResultCode {
FAILED = 0;
SUCCEED = 1;
}
message FaceManager_Request {
fixed32 command = 1;
string args = 2;
enum Command {
ADD_FACE = 0;
CANCLE_ADD_FACE = 1;
CONFIRM_LAST_FACE = 2;
UPDATE_FACE_ID = 3;
DELETE_FACE = 4;
GET_ALL_FACES = 5;
}
}
message FaceManager_Response {
fixed32 command = 1;
fixed32 result = 2;
string msg = 3;
repeated CompressedImage face_images = 4 ;
enum FaceResult {
RESULT_SUCCESS = 0;
RESULT_INVALID_ARGS = 1;
RESULT_UNSUPPORTED = 2;
RESULT_TIMEOUT = 3;
RESULT_BUSY = 4;
RESULT_INVALID_STATE = 5;
RESULT_INNER_ERROR = 6;
RESULT_UNDEFINED_ERROR = -1;
}
}
message CompressedImage {
Header header = 1;
string format = 2;
repeated fixed32 data = 3;
}
message Target_Request {
Header header = 1;
MapMetaData info = 2;
fixed32 target_x = 3;
fixed32 target_y = 4;
}
message MapMetaData {
Timestamp map_load_time = 1;
float resolution = 2;
fixed32 width = 3;
fixed32 height = 4;
Pose origin = 5;
}
message Target_Response {
MapMetaData info = 1;
bool success = 2;
}
message Odometry {
Header header = 1;
string child_frame_id = 2;
PoseWithCovariance pose = 3;
TwistWithCovariance twist = 4;
}
message OccupancyGrid {
Header header = 1;
MapMetaData info = 2;
repeated fixed32 data = 3;
}
message FaceResult {
fixed32 result = 1;
string msg = 2;
repeated CompressedImage face_images = 3;
}
message VoiceprintResult {
Header header = 1;
fixed32 type = 2;
bool succeed = 3;
fixed32 error = 4;
enum ErrorCode {
NORMAL = 0;
UNKNOWN_ERROR = 1;
RECORD_FAILED = 2;
PLAY_FAILED = 4;
TOO_NOISY_BACKGROUND = 8;
TIMEOUT = 16;
}
}
message Voiceprint_Request {
VoiceprintEntry info = 1;
}
message VoiceprintEntry {
Header header = 1;
AudioUser user = 2;
fixed32 ask = 3;
enum VoiceCommand {
DEFAULT = 0;
START = 1;
STOP = 2;
HAS_DATA = 3;
DELETE_DATA = 4;
}
}
message AudioUser {
fixed32 id = 1;
enum AudioCommand {
DEFAULT = 0;
STARTER = 1;
POWER = 2;
TOUCH = 3;
CAMERA = 4;
APP = 5;
BLUETOOTH = 6;
WIFI = 7;
XIAOAI = 8;
}
}
message Voiceprint_Response {
fixed32 ask = 1;
bool accept = 2;
}
message TokenPass_Request {
fixed32 ask = 1;
Token info = 2;
fixed32 vol = 3;
enum Code {
DEFAULT = 0;
ASK_TOKEN = 1;
ASK_DEVICE_ID = 2;
ASK_XIAOAI_OFF = 3;
ASK_XIAOAI_ON = 4;
ASK_XIAOAI_ONLINE_OFF = 5;
ASK_XIAOAI_ONLINE_ON = 6;
ASK_SET_VOLUME = 7;
ASK_GET_VOLUME = 8;
ASK_XIAOAI_SWITCH_STATUS = 9;
}
}
message Token {
Header header = 1;
string token = 2;
string token_refresh = 3;
string token_md5 = 4;
string token_refresh_md5 = 5;
fixed32 expire_in = 6;
}
message TokenPass_Response {
fixed32 flage = 1;
string divice_id = 2;
fixed32 vol = 3;
enum Code {
DEFAULT = 0;
TOKEN_SUCCEED = 1;
TOKEN_FAILED = 2;
DID_SUCCEED = 3;
DID_FAILED = 4;
XIAOAI_OFF_SUCCEED = 5;
XIAOAI_OFF_FAILED = 6;
XIAOAI_ON_SUCCEED = 7;
XIAOAI_ON_FAILED = 8;
XIAOAI_ONLINE_OFF_SUCCEED = 9;
XIAOAI_ONLINE_OFF_FAILED = 10;
XIAOAI_ONLINE_ON_SUCCEED = 11;
XIAOAI_ONLINE_ON_FAILED = 12;
SET_VOLUME_SUCCEED = 13;
SET_VOLUME_FAILED = 14;
GET_VOLUME_SUCCEED = 15;
GET_VOLUME_FAILED = 16;
XIAOAI_OFF = 17;
XIAOAI_ONLINE_ON = 18;
XIAOAI_OFFLINE_ON = 19;
}
}