Skip to content

Commit 9692810

Browse files
committed
remove
1 parent e59af19 commit 9692810

File tree

5 files changed

+0
-95
lines changed

5 files changed

+0
-95
lines changed

src/viam/examples/dial/example_dial.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,6 @@ int main() {
4646
std::cout << "\t" << resource << "\n";
4747
}
4848

49-
// ensure we can query statuses
50-
std::vector<RobotClient::status> status_plural = robot->get_status();
51-
std::cout << "Status plural len " << status_plural.size() << std::endl;
52-
for (const RobotClient::status& s : status_plural) {
53-
std::cout << " Status! " << s.name->api().resource_subtype() << std::endl;
54-
}
55-
56-
// ensure we can send requests for specific resources
57-
std::vector<Name> just_one = {resource_names[0]};
58-
std::vector<RobotClient::status> status_singular = robot->get_status(just_one);
59-
std::cout << "Status singular len " << status_singular.size() << std::endl;
60-
for (const RobotClient::status& s : status_singular) {
61-
std::cout << " Status! " << s.name->api().resource_subtype() << std::endl;
62-
}
63-
6449
// ensure we can create clients to the robot
6550
auto gc = robot->resource_by_name<GenericComponent>("generic1");
6651
if (gc) {

src/viam/examples/dial_api_key/example_dial_api_key.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,5 @@ int main(int argc, char* argv[]) {
5959
std::cout << "\t" << resource << "\n";
6060
}
6161

62-
// ensure we can query statuses
63-
std::vector<RobotClient::status> status_plural = robot->get_status();
64-
std::cout << "Status plural len " << status_plural.size() << std::endl;
65-
for (const RobotClient::status& s : status_plural) {
66-
std::cout << " Status! " << s.name->api().resource_subtype() << std::endl;
67-
}
68-
69-
// ensure we can send requests for specific resources
70-
std::vector<Name> just_one = {resource_names[0]};
71-
std::vector<RobotClient::status> status_singular = robot->get_status(just_one);
72-
std::cout << "Status singular len " << status_singular.size() << std::endl;
73-
for (const RobotClient::status& s : status_singular) {
74-
std::cout << " Status! " << s.name->api().resource_subtype() << std::endl;
75-
}
76-
7762
return EXIT_SUCCESS;
7863
}

src/viam/sdk/robot/client.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -167,37 +167,6 @@ void RobotClient::close() {
167167
bool is_error_response(const grpc::Status& response) {
168168
return !response.ok() && (response.error_message() != kStreamRemoved);
169169
}
170-
std::vector<RobotClient::status> RobotClient::get_status() {
171-
auto resources = resource_names();
172-
return get_status(resources);
173-
}
174-
// gets statuses of components associated with robot. If a specific component
175-
// vector is provided, only statuses for the given Names will be
176-
// returned
177-
std::vector<RobotClient::status> RobotClient::get_status(std::vector<Name>& components) {
178-
viam::robot::v1::GetStatusRequest req;
179-
viam::robot::v1::GetStatusResponse resp;
180-
ClientContext ctx;
181-
for (const Name& name : components) {
182-
*req.mutable_resource_names()->Add() = name.to_proto();
183-
}
184-
185-
const grpc::Status response = impl_->stub_->GetStatus(ctx, req, &resp);
186-
if (is_error_response(response)) {
187-
BOOST_LOG_TRIVIAL(error) << "Error getting status: " << response.error_message()
188-
<< response.error_details();
189-
}
190-
191-
const RepeatedPtrField<Status> resp_status = resp.status();
192-
193-
std::vector<status> statuses = std::vector<status>();
194-
195-
for (const Status& s : resp_status) {
196-
statuses.push_back(from_proto(s));
197-
}
198-
199-
return statuses;
200-
}
201170

202171
std::vector<RobotClient::operation> RobotClient::get_operations() {
203172
const viam::robot::v1::GetOperationsRequest req;

src/viam/sdk/robot/client.hpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,6 @@ class RobotClient {
129129
/// @return The list of operations currently running on the calling robot.
130130
std::vector<operation> get_operations();
131131

132-
/// @brief Get the status of the requested robot components.
133-
/// @param components A list of the specific components for which status is desired.
134-
/// @return A list of statuses.
135-
std::vector<status> get_status(std::vector<Name>& components);
136-
137-
/// @brief Get the status of all robot components.
138-
/// @return A list of statuses.
139-
std::vector<status> get_status();
140-
141132
std::vector<discovery> discover_components(const std::vector<discovery_query>& queries);
142133

143134
/// @brief Transform a given `Pose` to a new specified destination which is a reference frame.

src/viam/sdk/tests/test_robot.cpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -108,31 +108,6 @@ BOOST_AUTO_TEST_CASE(test_resource_names) {
108108
});
109109
}
110110

111-
BOOST_AUTO_TEST_CASE(test_get_status) {
112-
robot_client_to_mocks_pipeline(
113-
[](std::shared_ptr<RobotClient> client, MockRobotService& service) -> void {
114-
auto mock_statuses = mock_status_response();
115-
116-
// get all resource statuses
117-
auto statuses = client->get_status();
118-
119-
// ensure we get statuses for all resources, and that they are as expected.
120-
BOOST_CHECK_EQUAL(statuses.size(), 3);
121-
BOOST_TEST(statuses == mock_statuses, boost::test_tools::per_element());
122-
123-
// get only a subset of status responses
124-
auto names = mock_resource_names_response();
125-
std::vector<Name> some_names{names[0], names[1]};
126-
auto some_statuses = client->get_status(some_names);
127-
// ensure that we only get two of the three existing statuses
128-
BOOST_CHECK_EQUAL(some_statuses.size(), 2);
129-
130-
std::vector<RobotClient::status> some_mock_statuses{mock_statuses[0], mock_statuses[1]};
131-
132-
BOOST_TEST(some_statuses == some_mock_statuses, boost::test_tools::per_element());
133-
});
134-
}
135-
136111
// This test ensures that the functions in the `mock_robot` files have the same fields for both
137112
// the proto and custom type versions.
138113
BOOST_AUTO_TEST_CASE(test_frame_system_config) {

0 commit comments

Comments
 (0)