Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ require (
go.uber.org/goleak v1.3.0
go.uber.org/multierr v1.11.0
go.uber.org/zap v1.28.0
go.viam.com/api v0.1.590
go.viam.com/api v0.1.591-0.20261008175309-0947df106487
go.viam.com/test v1.2.4
go.viam.com/utils v0.13.2
goji.io v2.0.2+incompatible
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1218,8 +1218,8 @@ go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI=
go.uber.org/zap v1.28.0 h1:IZzaP1Fv73/T/pBMLk4VutPl36uNC+OSUh3JLG3FIjo=
go.uber.org/zap v1.28.0/go.mod h1:rDLpOi171uODNm/mxFcuYWxDsqWSAVkFdX4XojSKg/Q=
go.viam.com/api v0.1.590 h1:GqRxbKFX3PkDNfc1PtyDay+KhU/GGc1q/8MTOFn3eQ8=
go.viam.com/api v0.1.590/go.mod h1:KCJHm/hGRAa3kQlJNXMq6MipEpU1QhAe7/SutP/PHuc=
go.viam.com/api v0.1.591-0.20261008175309-0947df106487 h1:b7HGE3kV+VFphGZPsEwmpjV3kqhRc7lAK62Bgd6FZ3Y=
go.viam.com/api v0.1.591-0.20261008175309-0947df106487/go.mod h1:KCJHm/hGRAa3kQlJNXMq6MipEpU1QhAe7/SutP/PHuc=
go.viam.com/test v1.2.4 h1:JYgZhsuGAQ8sL9jWkziAXN9VJJiKbjoi9BsO33TW3ug=
go.viam.com/test v1.2.4/go.mod h1:zI2xzosHdqXAJ/kFqcN+OIF78kQuTV2nIhGZ8EzvaJI=
go.viam.com/utils v0.13.2 h1:P2z+Q5rvfUGf341DCD/VtUCJJU37yAR+kgsz+lcUyTU=
Expand Down
1 change: 1 addition & 0 deletions services/vision/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ func (c *client) GetProperties(ctx context.Context, extra map[string]interface{}
ObjectPCDsSupported: resp.ObjectPointCloudsSupported,
DefaultCamera: resp.DefaultCamera,
Detections3DSupported: resp.Detections_3DSupported,
Cameras: resp.Cameras,
}, nil
}

Expand Down
8 changes: 7 additions & 1 deletion services/vision/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ func TestClient(t *testing.T) {
return []objectdetection.Detection{det1}, nil
}
srv.GetPropertiesFunc = func(ctx context.Context, extra map[string]interface{}) (*vision.Properties, error) {
return &vision.Properties{ClassificationSupported: false, DetectionSupported: true, ObjectPCDsSupported: false}, nil
return &vision.Properties{
ClassificationSupported: false,
DetectionSupported: true,
ObjectPCDsSupported: false,
Cameras: []string{"cam1", "cam2"},
}, nil
}

test.That(t, err, test.ShouldBeNil)
Expand Down Expand Up @@ -140,6 +145,7 @@ func TestClient(t *testing.T) {
test.That(t, props.ClassificationSupported, test.ShouldEqual, false)
test.That(t, props.DetectionSupported, test.ShouldEqual, true)
test.That(t, props.ObjectPCDsSupported, test.ShouldEqual, false)
test.That(t, props.Cameras, test.ShouldResemble, []string{"cam1", "cam2"})

test.That(t, client.Close(context.Background()), test.ShouldBeNil)
test.That(t, conn.Close(), test.ShouldBeNil)
Expand Down
1 change: 1 addition & 0 deletions services/vision/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ func (server *serviceServer) GetProperties(ctx context.Context,
ObjectPointCloudsSupported: props.ObjectPCDsSupported,
DefaultCamera: props.DefaultCamera,
Detections_3DSupported: props.Detections3DSupported,
Cameras: props.Cameras,
}
return out, nil
}
Expand Down
8 changes: 7 additions & 1 deletion services/vision/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@ func TestServerGetProperties(t *testing.T) {
logger := logging.NewTestLogger(t)
injectVS := &inject.VisionService{}
injectVS.GetPropertiesFunc = func(ctx context.Context, extra map[string]interface{}) (*vision.Properties, error) {
return &vision.Properties{ClassificationSupported: false, DetectionSupported: true, ObjectPCDsSupported: false}, nil
return &vision.Properties{
ClassificationSupported: false,
DetectionSupported: true,
ObjectPCDsSupported: false,
Cameras: []string{"cam1", "cam2"},
}, nil
}
m := map[resource.Name]vision.Service{
visName1: injectVS,
Expand All @@ -139,6 +144,7 @@ func TestServerGetProperties(t *testing.T) {
test.That(t, resp.ClassificationsSupported, test.ShouldEqual, false)
test.That(t, resp.DetectionsSupported, test.ShouldEqual, true)
test.That(t, resp.ObjectPointCloudsSupported, test.ShouldEqual, false)
test.That(t, resp.Cameras, test.ShouldResemble, []string{"cam1", "cam2"})
}

func TestServerCaptureAllFromCamera(t *testing.T) {
Expand Down
3 changes: 3 additions & 0 deletions services/vision/vision.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,4 +279,7 @@ type Properties struct {
ObjectPCDsSupported bool
DefaultCamera *string
Detections3DSupported bool
// Cameras lists the cameras the vision service works with. If empty, the
// vision service works with any camera resource.
Cameras []string
}
Loading