Skip to content

Commit 9e8d4a2

Browse files
authored
[RSDK-9633] delete discover components (viamrobotics#860)
1 parent 8e9b4c9 commit 9e8d4a2

File tree

3 files changed

+0
-77
lines changed

3 files changed

+0
-77
lines changed

src/viam/proto/robot/__init__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
CancelOperationRequest,
1111
CancelOperationResponse,
1212
ConfigStatus,
13-
DiscoverComponentsRequest,
14-
DiscoverComponentsResponse,
15-
Discovery,
16-
DiscoveryQuery,
1713
FrameSystemConfig,
1814
FrameSystemConfigRequest,
1915
FrameSystemConfigResponse,
@@ -78,10 +74,6 @@
7874
"CancelOperationRequest",
7975
"CancelOperationResponse",
8076
"ConfigStatus",
81-
"DiscoverComponentsRequest",
82-
"DiscoverComponentsResponse",
83-
"Discovery",
84-
"DiscoveryQuery",
8577
"FrameSystemConfig",
8678
"FrameSystemConfigRequest",
8779
"FrameSystemConfigResponse",

src/viam/robot/client.py

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import asyncio
22
import sys
3-
import warnings
43
from dataclasses import dataclass
54
from datetime import datetime
65
from threading import RLock
@@ -18,10 +17,6 @@
1817
from viam.proto.robot import (
1918
BlockForOperationRequest,
2019
CancelOperationRequest,
21-
DiscoverComponentsRequest,
22-
DiscoverComponentsResponse,
23-
Discovery,
24-
DiscoveryQuery,
2520
FrameSystemConfig,
2621
FrameSystemConfigRequest,
2722
FrameSystemConfigResponse,
@@ -727,53 +722,6 @@ async def transform_pose(
727722
async def transform_point_cloud(self):
728723
raise NotImplementedError()
729724

730-
#######################
731-
# COMPONENT DISCOVERY #
732-
#######################
733-
734-
async def discover_components(
735-
self,
736-
queries: List[DiscoveryQuery],
737-
) -> List[Discovery]:
738-
"""
739-
Deprecated: v0.38.0, use the Discovery Service APIs instead.
740-
Get a list of discovered potential component configurations, for example listing different supported resolutions. Currently only works for some cameras.
741-
Returns module names for modules.
742-
743-
::
744-
745-
from viam.proto.robot import DiscoveryQuery
746-
747-
# Define a new discovery query.
748-
q = DiscoveryQuery(subtype="camera", model="webcam")
749-
750-
# Define a list of discovery queries.
751-
qs = [q]
752-
753-
# Get component configurations with these queries.
754-
component_configs = await machine.discover_components(qs)
755-
756-
Args:
757-
758-
queries (List[viam.proto.robot.DiscoveryQuery]): The list of component models to lookup potential configurations for.
759-
760-
Returns:
761-
List[Discovery]: A list of discovered potential component configurations.
762-
763-
For more information, see `Machine Management API <https://docs.viam.com/appendix/apis/robot/>`_.
764-
"""
765-
request = DiscoverComponentsRequest(queries=queries)
766-
response: DiscoverComponentsResponse = await self._client.DiscoverComponents(request)
767-
warnings.warn(
768-
"RobotClient.discover_components is deprecated. It will be removed on March 10 2025. Use the DiscoveryService APIs instead.",
769-
DeprecationWarning,
770-
stacklevel=2,
771-
)
772-
LOGGER.warning(
773-
"RobotClient.discover_components is deprecated. It will be removed on March 10 2025. Use the DiscoveryService APIs instead."
774-
)
775-
return list(response.discovery)
776-
777725
#################
778726
# MODULE MODELS #
779727
#################

tests/test_robot.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from unittest import mock
44

55
import pytest
6-
from google.protobuf.struct_pb2 import Struct, Value
76
from grpclib.client import Channel
87
from grpclib.exceptions import GRPCError
98
from grpclib.server import Stream
@@ -21,8 +20,6 @@
2120
BlockForOperationResponse,
2221
CancelOperationRequest,
2322
CancelOperationResponse,
24-
Discovery,
25-
DiscoveryQuery,
2623
FrameSystemConfig,
2724
FrameSystemConfigRequest,
2825
FrameSystemConfigResponse,
@@ -83,20 +80,6 @@
8380

8481
TRANSFORM_RESPONSE = PoseInFrame(reference_frame="arm", pose=Pose(x=1, y=2, z=3, o_x=2, o_y=3, o_z=4, theta=20))
8582

86-
DISCOVERY_QUERY = DiscoveryQuery(subtype="camera", model="webcam")
87-
88-
DISCOVERY_RESPONSE = [
89-
Discovery(
90-
query=DISCOVERY_QUERY,
91-
results=Struct(
92-
fields={
93-
"foo": Value(string_value="bar"),
94-
"one": Value(number_value=1),
95-
}
96-
),
97-
)
98-
]
99-
10083
OPERATION_ID = "abc"
10184

10285
OPERATIONS_RESPONSE = [Operation(id=OPERATION_ID)]

0 commit comments

Comments
 (0)