Skip to content

Commit

Permalink
fetch resources
Browse files Browse the repository at this point in the history
  • Loading branch information
seanavery committed Jul 14, 2023
1 parent 12640eb commit 136810c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion test/test_sdk_perf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,24 @@ int main() {
vs::Credentials credentials("");
vs::DialOptions dial_options;
dial_options.set_allow_insecure_downgrade(credentials.payload().empty());

vs::Options options = vs::Options(1, dial_options);

std::shared_ptr<vs::RobotClient> robot;
try {
robot = vs::RobotClient::at_address(robot_address, options);
std::cout << "Successfully connected to the robot" << std::endl;
} catch (const std::exception& e) {
std::cerr << "Failed to connect to the robot. Exiting." << std::endl;
throw;
}


// Get camera resource
std::vector<vs::ResourceName>* resource_names = robot->resource_names();
std::cout << "Resources of the robot:" << std::endl;
for (vs::ResourceName resource : *resource_names) {
std::cout << " - " << resource.name() << " (" << resource.subtype() << ")" << std::endl;
}

return EXIT_SUCCESS;
}

0 comments on commit 136810c

Please sign in to comment.