Skip to content

Commit 18ac7a6

Browse files
committed
consolidate-camera-api-demo
1 parent 29c7a2e commit 18ac7a6

File tree

1 file changed

+84
-1
lines changed

1 file changed

+84
-1
lines changed

proto/viam/component/camera/v1/camera.proto

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,16 @@ service CameraService {
3434
option (google.api.http) = {get: "/viam/api/v1/component/camera/{name}/point_cloud"};
3535
}
3636

37-
// GetProperties returns the camera intrinsic parameters and camera distortion parameters from a camera of the underlying robot, if available.
37+
// Readings returns a map of camera sensor names to camera sensor reading
38+
// allong with a timestamp
39+
rpc Readings(ReadingsRequest) returns (ReadingsResponse) {
40+
option (google.api.http) = {
41+
get : "/viam/api/v1/component/camera/{name}/readings"
42+
};
43+
}
44+
45+
// GetProperties returns the camera intrinsic parameters and camera distortion
46+
// parameters from a camera of the underlying robot, if available.
3847
rpc GetProperties(GetPropertiesRequest) returns (GetPropertiesResponse) {
3948
option (google.api.http) = {get: "/viam/api/v1/component/camera/{name}/properties"};
4049
}
@@ -120,6 +129,80 @@ message GetPointCloudResponse {
120129
bytes point_cloud = 2;
121130
}
122131

132+
message ReadingsRequest {
133+
// Name of a camera
134+
string name = 1;
135+
// Requested sensor_names
136+
// If empty all sensors are requested
137+
repeated string sensor_names = 2;
138+
// Additional arguments to the method
139+
google.protobuf.Struct extra = 99;
140+
}
141+
142+
message ReadingsResponse {
143+
// timestamp all sensor readings were taken
144+
google.protobuf.Timestamp captured_at = 1;
145+
// map of camera sensor names to camera sensor readings returned from the
146+
// camera at the captured_at time
147+
map<string, Reading> readings = 2;
148+
}
149+
150+
message Reading {
151+
// image_metadata is set if data contains an image, mutually exclusive with
152+
// all other _metadata fields
153+
ImageMetadata image_metadata = 1;
154+
// bitmap_metadata is set if data contains an bitmap, mutually exclusive with
155+
// all other _metadata fields
156+
BitmapMetadata bitmap_metadata = 2;
157+
// pointcloud_metadata is set if data contains an pointcloud, mutually exclusive with
158+
// all other _metadata fields
159+
PointCloudMetadata pointcloud_metadata = 3;
160+
161+
// the reading's data
162+
bytes data = 6;
163+
}
164+
165+
enum ImageType {
166+
IMAGE_TYPE_UNSPECIFIED = 0;
167+
IMAGE_TYPE_IMAGE_JPEG = 1;
168+
IMAGE_TYPE_IMAGE_PNG = 2;
169+
}
170+
171+
enum BitmapType {
172+
BITMAP_TYPE_UNSPECIFIED = 0;
173+
BITMAP_TYPE_BITMAP_VIAM_RAW_RGBA = 1;
174+
BITMAP_TYPE_BITMAP_VIAM_RAW_DEPTH = 2;
175+
}
176+
177+
enum PointCloudType {
178+
POINT_CLOUD_TYPE_UNSPECIFIED = 0;
179+
POINT_CLOUD_TYPE_PCD = 1;
180+
}
181+
182+
message ImageMetadata {
183+
// type of the image
184+
ImageType type = 1;
185+
// pixel dimensions of the image
186+
Dimensions pixel_dimensions = 2;
187+
}
188+
189+
message Dimensions {
190+
uint32 x = 2;
191+
uint32 y = 3;
192+
}
193+
194+
message BitmapMetadata {
195+
// type of the bitmap
196+
BitmapType type = 1;
197+
// pixel dimensions of the bitmap
198+
Dimensions pixel_dimensions = 2;
199+
}
200+
201+
message PointCloudMetadata {
202+
// type of the pointcloud
203+
PointCloudType type = 1;
204+
}
205+
123206
message GetPropertiesRequest {
124207
// Name of a camera
125208
string name = 1;

0 commit comments

Comments
 (0)