@@ -12,34 +12,37 @@ option java_package = "com.viam.component.camera.v1";
12
12
13
13
// A CameraService services all cameras associated with a robot
14
14
service CameraService {
15
- // GetImage returns a frame from a camera of the underlying robot. A specific MIME type
16
- // can be requested but may not necessarily be the same one returned.
15
+ // GetImage returns a frame from a camera of the underlying robot. A specific
16
+ // MIME type can be requested but may not necessarily be the same one
17
+ // returned.
17
18
rpc GetImage (GetImageRequest ) returns (GetImageResponse ) {
19
+ option deprecated = true ;
18
20
option (google.api.http ) = {get : "/viam/api/v1/component/camera/{name}/image" };
19
21
}
20
22
21
23
rpc GetImages (GetImagesRequest ) returns (GetImagesResponse ) {
24
+ option deprecated = true ;
22
25
option (google.api.http ) = {get : "/viam/api/v1/component/camera/{name}/images" };
23
26
}
24
27
25
- // RenderFrame renders a frame from a camera of the underlying robot to an HTTP response. A specific MIME type
26
- // can be requested but may not necessarily be the same one returned.
28
+ // RenderFrame renders a frame from a camera of the underlying robot to an
29
+ // HTTP response. A specific MIME type can be requested but may not
30
+ // necessarily be the same one returned.
27
31
rpc RenderFrame (RenderFrameRequest ) returns (google .api .HttpBody ) {
32
+ option deprecated = true ;
28
33
option (google.api.http ) = {get : "/viam/api/v1/component/camera/{name}/render_frame" };
29
34
}
30
35
31
- // GetPointCloud returns a point cloud from a camera of the underlying robot. A specific MIME type
32
- // can be requested but may not necessarily be the same one returned.
36
+ // GetPointCloud returns a point cloud from a camera of the underlying robot.
37
+ // A specific MIME type can be requested but may not necessarily be the same
38
+ // one returned.
33
39
rpc GetPointCloud (GetPointCloudRequest ) returns (GetPointCloudResponse ) {
40
+ option deprecated = true ;
34
41
option (google.api.http ) = {get : "/viam/api/v1/component/camera/{name}/point_cloud" };
35
42
}
36
43
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
- };
44
+ rpc BinaryReadings (BinaryReadingsRequest ) returns (BinaryReadingsResponse ) {
45
+ option (google.api.http ) = {get : "/viam/api/v1/component/camera/{name}/binary_readings" };
43
46
}
44
47
45
48
// GetProperties returns the camera intrinsic parameters and camera distortion
@@ -53,7 +56,8 @@ service CameraService {
53
56
option (google.api.http ) = {post : "/viam/api/v1/component/camera/{name}/do_command" };
54
57
}
55
58
56
- // GetGeometries returns the geometries of the component in their current configuration
59
+ // GetGeometries returns the geometries of the component in their current
60
+ // configuration
57
61
rpc GetGeometries (common .v1 .GetGeometriesRequest ) returns (common .v1 .GetGeometriesResponse ) {
58
62
option (google.api.http ) = {get : "/viam/api/v1/component/camera/{name}/geometries" };
59
63
}
@@ -129,90 +133,14 @@ message GetPointCloudResponse {
129
133
bytes point_cloud = 2 ;
130
134
}
131
135
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
- // map of camera sensor names to camera sensor readings returned from the
144
- // camera at the captured_at time
145
- // if there is only a single reading a key of empty string may be used to
146
- // represent an unlabeled sensor reading
147
- map <string , Reading > readings = 1 ;
148
-
149
- // contains timestamp data
150
- common.v1.ResponseMetadata response_metadata = 84260 ;
151
- }
152
-
153
- message Reading {
154
- // image_metadata is set if data contains an image, mutually exclusive with
155
- // all other _metadata fields
156
- ImageMetadata image_metadata = 1 ;
157
- // bitmap_metadata is set if data contains an bitmap, mutually exclusive with
158
- // all other _metadata fields
159
- BitmapMetadata bitmap_metadata = 2 ;
160
- // pointcloud_metadata is set if data contains an pointcloud, mutually
161
- // exclusive with all other _metadata fields
162
- PointCloudMetadata pointcloud_metadata = 3 ;
163
-
164
- // the reading's data
165
- bytes data = 6 ;
166
- }
167
-
168
- enum ImageType {
169
- IMAGE_TYPE_UNSPECIFIED = 0 ;
170
- IMAGE_TYPE_JPEG = 1 ;
171
- IMAGE_TYPE_PNG = 2 ;
172
- }
173
-
174
- enum BitmapType {
175
- BITMAP_TYPE_UNSPECIFIED = 0 ;
176
- BITMAP_TYPE_VIAM_RAW_RGBA = 1 ;
177
- BITMAP_TYPE_VIAM_RAW_DEPTH = 2 ;
178
- }
179
-
180
- enum PointCloudType {
181
- POINT_CLOUD_TYPE_UNSPECIFIED = 0 ;
182
- POINT_CLOUD_TYPE_PCD = 1 ;
183
- }
184
-
185
- message ImageMetadata {
186
- // type of the image
187
- ImageType type = 1 ;
188
- // pixel dimensions of the image
189
- Dimensions pixel_dimensions = 2 ;
190
- }
191
-
192
- message Dimensions {
193
- uint32 x = 2 ;
194
- uint32 y = 3 ;
195
- }
196
-
197
- message BitmapMetadata {
198
- // type of the bitmap
199
- BitmapType type = 1 ;
200
- // pixel dimensions of the bitmap
201
- Dimensions pixel_dimensions = 2 ;
202
- }
203
-
204
- message PointCloudMetadata {
205
- // type of the pointcloud
206
- PointCloudType type = 1 ;
207
- }
208
-
209
136
message GetPropertiesRequest {
210
137
// Name of a camera
211
138
string name = 1 ;
212
139
}
213
140
214
141
message GetPropertiesResponse {
215
- // A boolean property determining whether the camera supports the return of pointcloud data
142
+ // A boolean property determining whether the camera supports the return of
143
+ // pointcloud data
216
144
bool supports_pcd = 1 ;
217
145
// Parameters for doing a perspective of a 3D scene to a 2D plane
218
146
// If camera does not provide intrinsic parameters, leave the field empty
@@ -269,3 +197,50 @@ message DistortionParameters {
269
197
string model = 1 ;
270
198
repeated double parameters = 2 ;
271
199
}
200
+
201
+ enum ReadingFormat {
202
+ READING_FORMAT_UNSPECIFIED = 0 ;
203
+ READING_FORMAT_BITMAP_RAW_RGBA = 1 ;
204
+ READING_FORMAT_BITMAP_RAW_DEPTH = 2 ;
205
+ READING_FORMAT_IMAGE_JPEG = 3 ;
206
+ READING_FORMAT_IMAGE_PNG = 4 ;
207
+ READING_FORMAT_POINTCLOUD_PCD = 5 ;
208
+ }
209
+
210
+ message BinaryReadingsRequest {
211
+ // Name of a camera
212
+ string name = 1 ;
213
+
214
+ // Requested sensor_names
215
+ // If empty all readings are requested
216
+ repeated string sensor_names = 2 ;
217
+
218
+ // Requested reading_formats
219
+ // If empty all readings are requested
220
+ repeated ReadingFormat formats = 3 ;
221
+ }
222
+
223
+ message BinaryReadingsResponse {
224
+ // list of binary readings returned from the camera system
225
+ repeated BinaryReading readings = 1 ;
226
+ // contains timestamp data
227
+ common.v1.ResponseMetadata response_metadata = 84260 ;
228
+ }
229
+
230
+ message BinaryReading {
231
+ // the name of the sensor where the reading came from
232
+ string source_name = 1 ;
233
+ // format of the response sensor bytes
234
+ ReadingFormat format = 2 ;
235
+ // data in bytes
236
+ bytes data = 3 ;
237
+ // image pixel_dimensions
238
+ // may not be set if the reading isn't in an image reading format doesn't
239
+ // support pixel_dimensions
240
+ Dimensions pixel_dimensions = 4 ;
241
+ }
242
+
243
+ message Dimensions {
244
+ uint32 x = 1 ;
245
+ uint32 y = 2 ;
246
+ }
0 commit comments