10#include <viam/sdk/common/grpc_fwd.hpp>
11#include <viam/sdk/common/pose.hpp>
12#include <viam/sdk/common/utils.hpp>
13#include <viam/sdk/common/world_state.hpp>
14#include <viam/sdk/components/component.hpp>
16#include <viam/sdk/resource/resource.hpp>
17#include <viam/sdk/rpc/dial.hpp>
18#include <viam/sdk/services/service.hpp>
39 ProtoStruct kinematics;
46 boost::optional<std::string> session_id;
47 ProtoStruct arguments;
48 boost::optional<time_pt> started;
59 static std::shared_ptr<RobotClient>
at_address(
const std::string& address,
75 static std::shared_ptr<RobotClient>
with_channel(std::shared_ptr<ViamChannel> channel,
78 std::vector<Name> resource_names()
const;
99 return std::dynamic_pointer_cast<T>(
resource_by_name({API::get<T>(),
"", std::move(name)}));
105 const std::vector<WorldState::transform>& additional_transforms = {});
117 std::string destination,
118 const std::vector<WorldState::transform>& additional_transforms = {});
129 void stop_all(
const std::unordered_map<Name, ProtoStruct>& extra);
136 std::vector<std::shared_ptr<std::thread>> threads_;
137 std::atomic<bool> should_refresh_;
138 unsigned int refresh_interval_;
139 std::shared_ptr<GrpcChannel> channel_;
140 std::shared_ptr<ViamChannel> viam_channel_;
141 bool should_close_channel_;
143 std::unique_ptr<impl> impl_;
144 mutable std::mutex lock_;
145 std::vector<Name> resource_names_;
147 void refresh_every();
A name for specific instances of resources.
Definition resource_api.hpp:61
Defines a resource manager for use by anything that tracks resources.
Definition resource_manager.hpp:22
gRPC client for a robot, to be used for all interactions with a robot. There are two ways to instanti...
Definition client.hpp:35
static std::shared_ptr< RobotClient > at_local_socket(const std::string &address, const Options &options)
Creates a robot client connected to the robot at the provided local socket.
static std::shared_ptr< RobotClient > with_channel(std::shared_ptr< ViamChannel > channel, const Options &options)
Creates a robot client connected to the provided channel.
std::shared_ptr< Resource > resource_by_name(const Name &name)
Lookup and return a shared_ptr to a resource.
pose_in_frame transform_pose(const pose_in_frame &query, std::string destination, const std::vector< WorldState::transform > &additional_transforms={})
Transform a given Pose to a new specified destination which is a reference frame.
std::vector< frame_system_config > get_frame_system_config(const std::vector< WorldState::transform > &additional_transforms={})
Get the configuration of the frame system of the given robot.
void stop_all()
Cancel all operations for the robot and stop all actuators and movement.
static std::shared_ptr< RobotClient > at_address(const std::string &address, const Options &options)
Create a robot client connected to the robot at the provided address.
void block_for_operation(std::string id)
Blocks on the specified operation of the robot, returning when it is complete.
void cancel_operation(std::string id)
Cancel a specified operation on the robot.
std::vector< operation > get_operations()
Get the list of operations currently running on a robot.
std::shared_ptr< T > resource_by_name(std::string name)
Lookup and return a shared_ptr to a resource of the requested type.
Definition client.hpp:98
void stop_all(const std::unordered_map< Name, ProtoStruct > &extra)
Cancel all operations for the robot and stop all actuators and movement.
Defines the resource registry and associated types.