Skip to content

Commit d89f094

Browse files
committed
Fix fake camera
1 parent 5c9d48e commit d89f094

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

components/camera/fake/image_file.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func (fs *fileSource) Read(ctx context.Context) (image.Image, func(), error) {
152152
}
153153

154154
// Images returns the saved color and depth image if they are present.
155-
func (fs *fileSource) Images(ctx context.Context) ([]camera.NamedImage, resource.ResponseMetadata, error) {
155+
func (fs *fileSource) Images(ctx context.Context, extra map[string]interface{}) ([]camera.NamedImage, resource.ResponseMetadata, error) {
156156
if fs.ColorFN == "" && fs.DepthFN == "" && fs.PreloadedImage == "" {
157157
return nil, resource.ResponseMetadata{}, errors.New("no image files to read, so not implemented")
158158
}
@@ -163,23 +163,23 @@ func (fs *fileSource) Images(ctx context.Context) ([]camera.NamedImage, resource
163163
if err != nil {
164164
return nil, resource.ResponseMetadata{}, err
165165
}
166-
imgs = append(imgs, camera.NamedImage{img, "preloaded"})
166+
imgs = append(imgs, camera.NamedImage{Image: img, SourceName: "preloaded"})
167167
}
168168

169169
if fs.ColorFN != "" {
170170
img, err := rimage.ReadImageFromFile(fs.ColorFN)
171171
if err != nil {
172172
return nil, resource.ResponseMetadata{}, err
173173
}
174-
imgs = append(imgs, camera.NamedImage{img, "color"})
174+
imgs = append(imgs, camera.NamedImage{Image: img, SourceName: "color"})
175175
}
176176

177177
if fs.DepthFN != "" {
178178
dm, err := rimage.NewDepthMapFromFile(context.Background(), fs.DepthFN)
179179
if err != nil {
180180
return nil, resource.ResponseMetadata{}, err
181181
}
182-
imgs = append(imgs, camera.NamedImage{dm, "depth"})
182+
imgs = append(imgs, camera.NamedImage{Image: dm, SourceName: "depth"})
183183
}
184184

185185
ts := time.Now()
@@ -239,10 +239,10 @@ func (ss *StaticSource) Images(ctx context.Context) ([]camera.NamedImage, resour
239239
}
240240
imgs := []camera.NamedImage{}
241241
if ss.ColorImg != nil {
242-
imgs = append(imgs, camera.NamedImage{ss.ColorImg, "color"})
242+
imgs = append(imgs, camera.NamedImage{Image: ss.ColorImg, SourceName: "color"})
243243
}
244244
if ss.DepthImg != nil {
245-
imgs = append(imgs, camera.NamedImage{ss.DepthImg, "depth"})
245+
imgs = append(imgs, camera.NamedImage{Image: ss.DepthImg, SourceName: "depth"})
246246
}
247247
ts := time.Now()
248248
return imgs, resource.ResponseMetadata{CapturedAt: ts}, nil

0 commit comments

Comments
 (0)