Skip to content

Commit c14082a

Browse files
committed
Update proto (#187)
1 parent 4af9c0f commit c14082a

File tree

8 files changed

+667
-43
lines changed

8 files changed

+667
-43
lines changed

anki_vector/messaging/external_interface.proto

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,14 @@ service ExternalInterface {
488488
};
489489
}
490490

491+
// Get Vector's camera configuration.
492+
rpc GetCameraConfig(CameraConfigRequest) returns (CameraConfigResponse) {
493+
option (google.api.http) = {
494+
post: "/v1/get_camera_config",
495+
body: "*"
496+
};
497+
}
498+
491499
// Set Vector's eye color.
492500
rpc SetEyeColor(SetEyeColorRequest) returns (SetEyeColorResponse) {
493501
option (google.api.http) = {
@@ -504,4 +512,12 @@ service ExternalInterface {
504512
};
505513
}
506514

515+
// Set Vector's camera settings
516+
rpc SetCameraSettings(SetCameraSettingsRequest) returns (SetCameraSettingsResponse) {
517+
option (google.api.http) = {
518+
post: "/v1/set_camera_settings",
519+
body: "*"
520+
};
521+
}
522+
507523
}

anki_vector/messaging/external_interface_pb2.py

Lines changed: 22 additions & 4 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: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,11 @@ def __init__(self, channel):
358358
request_serializer=anki__vector_dot_messaging_dot_messages__pb2.CaptureSingleImageRequest.SerializeToString,
359359
response_deserializer=anki__vector_dot_messaging_dot_messages__pb2.CaptureSingleImageResponse.FromString,
360360
)
361+
self.GetCameraConfig = channel.unary_unary(
362+
'/Anki.Vector.external_interface.ExternalInterface/GetCameraConfig',
363+
request_serializer=anki__vector_dot_messaging_dot_messages__pb2.CameraConfigRequest.SerializeToString,
364+
response_deserializer=anki__vector_dot_messaging_dot_messages__pb2.CameraConfigResponse.FromString,
365+
)
361366
self.SetEyeColor = channel.unary_unary(
362367
'/Anki.Vector.external_interface.ExternalInterface/SetEyeColor',
363368
request_serializer=anki__vector_dot_messaging_dot_messages__pb2.SetEyeColorRequest.SerializeToString,
@@ -368,6 +373,11 @@ def __init__(self, channel):
368373
request_serializer=anki__vector_dot_messaging_dot_nav__map__pb2.NavMapFeedRequest.SerializeToString,
369374
response_deserializer=anki__vector_dot_messaging_dot_nav__map__pb2.NavMapFeedResponse.FromString,
370375
)
376+
self.SetCameraSettings = channel.unary_unary(
377+
'/Anki.Vector.external_interface.ExternalInterface/SetCameraSettings',
378+
request_serializer=anki__vector_dot_messaging_dot_messages__pb2.SetCameraSettingsRequest.SerializeToString,
379+
response_deserializer=anki__vector_dot_messaging_dot_messages__pb2.SetCameraSettingsResponse.FromString,
380+
)
371381

372382

373383
class ExternalInterfaceServicer(object):
@@ -860,6 +870,13 @@ def CaptureSingleImage(self, request, context):
860870
context.set_details('Method not implemented!')
861871
raise NotImplementedError('Method not implemented!')
862872

873+
def GetCameraConfig(self, request, context):
874+
"""Get Vector's camera configuration.
875+
"""
876+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
877+
context.set_details('Method not implemented!')
878+
raise NotImplementedError('Method not implemented!')
879+
863880
def SetEyeColor(self, request, context):
864881
"""Set Vector's eye color.
865882
"""
@@ -874,6 +891,13 @@ def NavMapFeed(self, request, context):
874891
context.set_details('Method not implemented!')
875892
raise NotImplementedError('Method not implemented!')
876893

894+
def SetCameraSettings(self, request, context):
895+
"""Set Vector's camera settings
896+
"""
897+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
898+
context.set_details('Method not implemented!')
899+
raise NotImplementedError('Method not implemented!')
900+
877901

878902
def add_ExternalInterfaceServicer_to_server(servicer, server):
879903
rpc_method_handlers = {
@@ -1217,6 +1241,11 @@ def add_ExternalInterfaceServicer_to_server(servicer, server):
12171241
request_deserializer=anki__vector_dot_messaging_dot_messages__pb2.CaptureSingleImageRequest.FromString,
12181242
response_serializer=anki__vector_dot_messaging_dot_messages__pb2.CaptureSingleImageResponse.SerializeToString,
12191243
),
1244+
'GetCameraConfig': grpc.unary_unary_rpc_method_handler(
1245+
servicer.GetCameraConfig,
1246+
request_deserializer=anki__vector_dot_messaging_dot_messages__pb2.CameraConfigRequest.FromString,
1247+
response_serializer=anki__vector_dot_messaging_dot_messages__pb2.CameraConfigResponse.SerializeToString,
1248+
),
12201249
'SetEyeColor': grpc.unary_unary_rpc_method_handler(
12211250
servicer.SetEyeColor,
12221251
request_deserializer=anki__vector_dot_messaging_dot_messages__pb2.SetEyeColorRequest.FromString,
@@ -1227,6 +1256,11 @@ def add_ExternalInterfaceServicer_to_server(servicer, server):
12271256
request_deserializer=anki__vector_dot_messaging_dot_nav__map__pb2.NavMapFeedRequest.FromString,
12281257
response_serializer=anki__vector_dot_messaging_dot_nav__map__pb2.NavMapFeedResponse.SerializeToString,
12291258
),
1259+
'SetCameraSettings': grpc.unary_unary_rpc_method_handler(
1260+
servicer.SetCameraSettings,
1261+
request_deserializer=anki__vector_dot_messaging_dot_messages__pb2.SetCameraSettingsRequest.FromString,
1262+
response_serializer=anki__vector_dot_messaging_dot_messages__pb2.SetCameraSettingsResponse.SerializeToString,
1263+
),
12301264
}
12311265
generic_handler = grpc.method_handlers_generic_handler(
12321266
'Anki.Vector.external_interface.ExternalInterface', rpc_method_handlers)

anki_vector/messaging/messages.proto

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,6 +1234,39 @@ message SetEyeColorResponse {
12341234
ResponseStatus status = 1;
12351235
}
12361236

1237+
message CameraConfigRequest {}
1238+
1239+
message CameraConfigResponse {
1240+
float focal_length_x = 1;
1241+
float focal_length_y = 2;
1242+
float center_x = 3;
1243+
float center_y = 4;
1244+
float fov_x = 5; // Full FOV in degrees
1245+
float fov_y = 6; // Full FOV in degrees
1246+
uint32 min_camera_exposure_time_ms = 7;
1247+
uint32 max_camera_exposure_time_ms = 8;
1248+
float min_camera_gain = 9;
1249+
float max_camera_gain = 10;
1250+
}
1251+
1252+
message SetCameraSettingsRequest {
1253+
float gain = 1;
1254+
uint32 exposure_ms = 2;
1255+
bool enable_auto_exposure = 3;
1256+
}
1257+
1258+
message SetCameraSettingsResponse {
1259+
ResponseStatus status = 1;
1260+
string status_message = 2;
1261+
}
1262+
1263+
// Event sent when camera exposure settings change
1264+
message CameraSettingsUpdate {
1265+
float gain = 1;
1266+
uint32 exposure_ms = 2;
1267+
bool auto_exposure_enabled = 3;
1268+
}
1269+
12371270
message SDKInitializationRequest {
12381271
string sdk_module_version = 1;
12391272
string python_version = 2;

anki_vector/messaging/messages_pb2.py

Lines changed: 312 additions & 25 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
@@ -64,6 +64,7 @@ message Event {
6464
RobotObservedMotion robot_observed_motion = 20;
6565
RobotErasedEnrolledFace robot_erased_enrolled_face = 21;
6666
RobotRenamedEnrolledFace robot_renamed_enrolled_face = 22;
67+
CameraSettingsUpdate camera_settings_update = 23;
6768
}
6869
}
6970

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)