Viam C++ SDK current
Loading...
Searching...
No Matches
arm_client.hpp
Go to the documentation of this file.
1
4#pragma once
5
6#include <grpcpp/channel.h>
7
8#include <viam/api/component/arm/v1/arm.grpc.pb.h>
9
11
12namespace viam {
13namespace sdk {
14namespace impl {
15
19class ArmClient : public Arm {
20 public:
21 using interface_type = Arm;
22 ArmClient(std::string name, std::shared_ptr<grpc::Channel> channel);
23
24 pose get_end_position(const AttributeMap& extra) override;
25 void move_to_position(const pose& pose, const AttributeMap& extra) override;
26 std::vector<double> get_joint_positions(const AttributeMap& extra) override;
27 void move_to_joint_positions(const std::vector<double>& positions,
28 const AttributeMap& extra) override;
29 bool is_moving() override;
30 void stop(const AttributeMap& extra) override;
31 AttributeMap do_command(const AttributeMap& command) override;
32 Arm::KinematicsData get_kinematics(const AttributeMap& extra) override;
33 std::vector<GeometryConfig> get_geometries(const AttributeMap& extra) override;
34
35 // Using declarations to introduce convenience overloads of interface which do not need to be
36 // passed the AttributeMap parameter.
43 using Arm::stop;
44
45 private:
46 using StubType = viam::component::arm::v1::ArmService::StubInterface;
47 std::unique_ptr<StubType> stub_;
48 std::shared_ptr<grpc::Channel> channel_;
49};
50
51} // namespace impl
52} // namespace sdk
53} // namespace viam
Defines an Arm component.
An Arm represents a physical robot arm that exists in three-dimensional space.
Definition arm.hpp:28
KinematicsData get_kinematics()
Get the kinematics data associated with the arm.
Definition arm.hpp:118
std::vector< double > get_joint_positions()
Lists the joint positions in degrees of every joint on a robot arm.
Definition arm.hpp:88
std::vector< GeometryConfig > get_geometries()
Returns GeometryConfigs associated with the calling arm.
Definition arm.hpp:123
boost::variant< KinematicsDataUnspecified, KinematicsDataSVA, KinematicsDataURDF > KinematicsData
The kinematics of the component.
Definition arm.hpp:61
virtual void move_to_joint_positions(const std::vector< double > &positions, const AttributeMap &extra)=0
Move each joint on the arm to the corresponding angle specified in.
pose get_end_position()
Get the current position of the end of the arm.
Definition arm.hpp:68
void move_to_position(const pose &pose)
Move the end of the arm to.
Definition arm.hpp:78
virtual std::string name() const
Return the resource's name.
void stop()
Stops a resource from running.
Definition stoppable.hpp:16
gRPC client implementation of an Arm component.
Definition arm_client.hpp:19
bool is_moving() override
Reports if the arm is in motion.
void move_to_position(const pose &pose, const AttributeMap &extra) override
Move the end of the arm to.
void stop(const AttributeMap &extra) override
Stops a resource from running.
std::vector< GeometryConfig > get_geometries(const AttributeMap &extra) override
Returns GeometryConfigs associated with the calling arm.
AttributeMap do_command(const AttributeMap &command) override
Send/receive arbitrary commands to the resource.
void move_to_joint_positions(const std::vector< double > &positions, const AttributeMap &extra) override
Move each joint on the arm to the corresponding angle specified in.
std::vector< double > get_joint_positions(const AttributeMap &extra) override
Lists the joint positions in degrees of every joint on a robot arm.
Arm::KinematicsData get_kinematics(const AttributeMap &extra) override
Get the kinematics data associated with the arm.
pose get_end_position(const AttributeMap &extra) override
Get the current position of the end of the arm.
Definition pose.hpp:18