Skip to content

Commit 09a4e23

Browse files
BruceVonKMichelle Sintov
authored andcommitted
updating proto (#153)
proto updates for volume change, userintent events, new behaviors
1 parent 26296e6 commit 09a4e23

8 files changed

Lines changed: 1148 additions & 250 deletions

File tree

anki_vector/messaging/external_interface.proto

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,30 @@ service ExternalInterface {
253253
};
254254
}
255255

256+
// Make Vector look for faces by turning and angling his head
257+
rpc FindFaces(FindFacesRequest) returns (FindFacesResponse) {
258+
option (google.api.http) = {
259+
post: "/v1/find_faces",
260+
body: "*"
261+
};
262+
}
263+
264+
// Make Vector look around in place by turning and moving his head
265+
rpc LookAroundInPlace(LookAroundInPlaceRequest) returns (LookAroundInPlaceResponse) {
266+
option (google.api.http) = {
267+
post: "/v1/look_around_in_place",
268+
body: "*"
269+
};
270+
}
271+
272+
// Make Vector roll his block, regardless of relative position and orientation
273+
rpc RollBlock(RollBlockRequest) returns (RollBlockResponse) {
274+
option (google.api.http) = {
275+
post: "/v1/roll_block",
276+
body: "*"
277+
};
278+
}
279+
256280
// Get the photos info.
257281
rpc PhotosInfo(PhotosInfoRequest) returns (PhotosInfoResponse) {
258282
option (google.api.http) = {
@@ -315,6 +339,9 @@ service ExternalInterface {
315339
// Ask Vector to place the object he is carrying on the ground at the current location.
316340
rpc PlaceObjectOnGroundHere(PlaceObjectOnGroundHereRequest) returns (PlaceObjectOnGroundHereResponse) {}
317341

342+
// Set the Robot's master volume
343+
rpc SetMasterVolume(MasterVolumeRequest) returns (MasterVolumeResponse) {}
344+
318345
rpc UserAuthentication(UserAuthenticationRequest) returns (UserAuthenticationResponse) {
319346
option (google.api.http) = {
320347
post: "/v1/user_authentication",

anki_vector/messaging/external_interface_pb2.py

Lines changed: 71 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

anki_vector/messaging/external_interface_pb2_grpc.py

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,21 @@ def __init__(self, channel):
178178
request_serializer=anki__vector_dot_messaging_dot_messages__pb2.DriveOnChargerRequest.SerializeToString,
179179
response_deserializer=anki__vector_dot_messaging_dot_messages__pb2.DriveOnChargerResponse.FromString,
180180
)
181+
self.FindFaces = channel.unary_unary(
182+
'/Anki.Vector.external_interface.ExternalInterface/FindFaces',
183+
request_serializer=anki__vector_dot_messaging_dot_messages__pb2.FindFacesRequest.SerializeToString,
184+
response_deserializer=anki__vector_dot_messaging_dot_messages__pb2.FindFacesResponse.FromString,
185+
)
186+
self.LookAroundInPlace = channel.unary_unary(
187+
'/Anki.Vector.external_interface.ExternalInterface/LookAroundInPlace',
188+
request_serializer=anki__vector_dot_messaging_dot_messages__pb2.LookAroundInPlaceRequest.SerializeToString,
189+
response_deserializer=anki__vector_dot_messaging_dot_messages__pb2.LookAroundInPlaceResponse.FromString,
190+
)
191+
self.RollBlock = channel.unary_unary(
192+
'/Anki.Vector.external_interface.ExternalInterface/RollBlock',
193+
request_serializer=anki__vector_dot_messaging_dot_messages__pb2.RollBlockRequest.SerializeToString,
194+
response_deserializer=anki__vector_dot_messaging_dot_messages__pb2.RollBlockResponse.FromString,
195+
)
181196
self.PhotosInfo = channel.unary_unary(
182197
'/Anki.Vector.external_interface.ExternalInterface/PhotosInfo',
183198
request_serializer=anki__vector_dot_messaging_dot_messages__pb2.PhotosInfoRequest.SerializeToString,
@@ -248,6 +263,11 @@ def __init__(self, channel):
248263
request_serializer=anki__vector_dot_messaging_dot_messages__pb2.PlaceObjectOnGroundHereRequest.SerializeToString,
249264
response_deserializer=anki__vector_dot_messaging_dot_messages__pb2.PlaceObjectOnGroundHereResponse.FromString,
250265
)
266+
self.SetMasterVolume = channel.unary_unary(
267+
'/Anki.Vector.external_interface.ExternalInterface/SetMasterVolume',
268+
request_serializer=anki__vector_dot_messaging_dot_messages__pb2.MasterVolumeRequest.SerializeToString,
269+
response_deserializer=anki__vector_dot_messaging_dot_messages__pb2.MasterVolumeResponse.FromString,
270+
)
251271
self.UserAuthentication = channel.unary_unary(
252272
'/Anki.Vector.external_interface.ExternalInterface/UserAuthentication',
253273
request_serializer=anki__vector_dot_messaging_dot_shared__pb2.UserAuthenticationRequest.SerializeToString,
@@ -574,6 +594,27 @@ def DriveOnCharger(self, request, context):
574594
context.set_details('Method not implemented!')
575595
raise NotImplementedError('Method not implemented!')
576596

597+
def FindFaces(self, request, context):
598+
"""Make Vector look for faces by turning and angling his head
599+
"""
600+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
601+
context.set_details('Method not implemented!')
602+
raise NotImplementedError('Method not implemented!')
603+
604+
def LookAroundInPlace(self, request, context):
605+
"""Make Vector look around in place by turning and moving his head
606+
"""
607+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
608+
context.set_details('Method not implemented!')
609+
raise NotImplementedError('Method not implemented!')
610+
611+
def RollBlock(self, request, context):
612+
"""Make Vector roll his block, regardless of relative position and orientation
613+
"""
614+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
615+
context.set_details('Method not implemented!')
616+
raise NotImplementedError('Method not implemented!')
617+
577618
def PhotosInfo(self, request, context):
578619
"""Get the photos info.
579620
"""
@@ -672,6 +713,13 @@ def PlaceObjectOnGroundHere(self, request, context):
672713
context.set_details('Method not implemented!')
673714
raise NotImplementedError('Method not implemented!')
674715

716+
def SetMasterVolume(self, request, context):
717+
"""Set the Robot's master volume
718+
"""
719+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
720+
context.set_details('Method not implemented!')
721+
raise NotImplementedError('Method not implemented!')
722+
675723
def UserAuthentication(self, request, context):
676724
# missing associated documentation comment in .proto file
677725
pass
@@ -977,6 +1025,21 @@ def add_ExternalInterfaceServicer_to_server(servicer, server):
9771025
request_deserializer=anki__vector_dot_messaging_dot_messages__pb2.DriveOnChargerRequest.FromString,
9781026
response_serializer=anki__vector_dot_messaging_dot_messages__pb2.DriveOnChargerResponse.SerializeToString,
9791027
),
1028+
'FindFaces': grpc.unary_unary_rpc_method_handler(
1029+
servicer.FindFaces,
1030+
request_deserializer=anki__vector_dot_messaging_dot_messages__pb2.FindFacesRequest.FromString,
1031+
response_serializer=anki__vector_dot_messaging_dot_messages__pb2.FindFacesResponse.SerializeToString,
1032+
),
1033+
'LookAroundInPlace': grpc.unary_unary_rpc_method_handler(
1034+
servicer.LookAroundInPlace,
1035+
request_deserializer=anki__vector_dot_messaging_dot_messages__pb2.LookAroundInPlaceRequest.FromString,
1036+
response_serializer=anki__vector_dot_messaging_dot_messages__pb2.LookAroundInPlaceResponse.SerializeToString,
1037+
),
1038+
'RollBlock': grpc.unary_unary_rpc_method_handler(
1039+
servicer.RollBlock,
1040+
request_deserializer=anki__vector_dot_messaging_dot_messages__pb2.RollBlockRequest.FromString,
1041+
response_serializer=anki__vector_dot_messaging_dot_messages__pb2.RollBlockResponse.SerializeToString,
1042+
),
9801043
'PhotosInfo': grpc.unary_unary_rpc_method_handler(
9811044
servicer.PhotosInfo,
9821045
request_deserializer=anki__vector_dot_messaging_dot_messages__pb2.PhotosInfoRequest.FromString,
@@ -1047,6 +1110,11 @@ def add_ExternalInterfaceServicer_to_server(servicer, server):
10471110
request_deserializer=anki__vector_dot_messaging_dot_messages__pb2.PlaceObjectOnGroundHereRequest.FromString,
10481111
response_serializer=anki__vector_dot_messaging_dot_messages__pb2.PlaceObjectOnGroundHereResponse.SerializeToString,
10491112
),
1113+
'SetMasterVolume': grpc.unary_unary_rpc_method_handler(
1114+
servicer.SetMasterVolume,
1115+
request_deserializer=anki__vector_dot_messaging_dot_messages__pb2.MasterVolumeRequest.FromString,
1116+
response_serializer=anki__vector_dot_messaging_dot_messages__pb2.MasterVolumeResponse.SerializeToString,
1117+
),
10501118
'UserAuthentication': grpc.unary_unary_rpc_method_handler(
10511119
servicer.UserAuthentication,
10521120
request_deserializer=anki__vector_dot_messaging_dot_shared__pb2.UserAuthenticationRequest.FromString,

anki_vector/messaging/messages.proto

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,30 @@ message DriveOnChargerResponse {
444444
BehaviorResults result = 2;
445445
}
446446

447+
message FindFacesRequest {
448+
}
449+
450+
message FindFacesResponse {
451+
ResponseStatus status = 1;
452+
BehaviorResults result = 2;
453+
}
454+
455+
message LookAroundInPlaceRequest {
456+
}
457+
458+
message LookAroundInPlaceResponse {
459+
ResponseStatus status = 1;
460+
BehaviorResults result = 2;
461+
}
462+
463+
//this triggers a Vector Behavior, different from RollObjectRequest which triggers an Action
464+
message RollBlockRequest {
465+
}
466+
467+
message RollBlockResponse {
468+
ResponseStatus status = 1;
469+
BehaviorResults result = 2;
470+
}
447471

448472
message WakeWordBegin {
449473
}
@@ -453,6 +477,11 @@ message WakeWordEnd {
453477
string intent_json = 2;
454478
}
455479

480+
message UserIntent {
481+
uint32 intent_id = 1;
482+
string json_data = 2;
483+
}
484+
456485
message PhotoInfo {
457486
uint32 photo_id = 1;
458487
uint32 timestamp_utc = 2;
@@ -977,6 +1006,25 @@ message ExternalAudioStreamResponse {
9771006
}
9781007
}
9791008

1009+
enum MasterVolumeLevel
1010+
{
1011+
VOLUME_LOW = 0;
1012+
VOLUME_MEDIUM_LOW = 1;
1013+
VOLUME_MEDIUM = 2;
1014+
VOLUME_MEDIUM_HIGH = 3;
1015+
VOLUME_HIGH = 4;
1016+
}
1017+
1018+
message MasterVolumeRequest
1019+
{
1020+
MasterVolumeLevel volume_level = 1;
1021+
}
1022+
1023+
message MasterVolumeResponse
1024+
{
1025+
ResponseStatus status = 1;
1026+
}
1027+
9801028
// When enabled, RobotObservedObject messages will be produced
9811029
message EnableMarkerDetectionRequest
9821030
{

anki_vector/messaging/messages_pb2.py

Lines changed: 608 additions & 201 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

anki_vector/messaging/shared.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ message Event {
6161
ConnectionResponse connection_response = 13;
6262
MirrorModeDisabled mirror_mode_disabled = 16;
6363
VisionModesAutoDisabled vision_modes_auto_disabled = 17;
64+
UserIntent user_intent = 19;
6465
}
6566
}
6667

anki_vector/messaging/shared_pb2.py

Lines changed: 25 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)