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 <viam/api/component/arm/v1/arm.grpc.pb.h>
7
9#include <viam/sdk/rpc/dial.hpp>
10
11namespace viam {
12namespace sdk {
13namespace impl {
14
18class ArmClient : public Arm {
19 public:
20 using interface_type = Arm;
21 ArmClient(std::string name, const ViamChannel& channel);
22
23 const ViamChannel& channel() const {
24 return *channel_;
25 }
26
27 pose get_end_position(const ProtoStruct& extra) override;
28 void move_to_position(const pose& pose, const ProtoStruct& extra) override;
29 std::vector<double> get_joint_positions(const ProtoStruct& extra) override;
30 void move_to_joint_positions(const std::vector<double>& positions,
31 const ProtoStruct& extra) override;
32 void move_through_joint_positions(const std::vector<std::vector<double>>& positions,
33 const Arm::MoveOptions& options,
34 const ProtoStruct& extra) override;
35 bool is_moving() override;
36 void stop(const ProtoStruct& extra) override;
37 ProtoStruct do_command(const ProtoStruct& command) override;
38 Arm::KinematicsData get_kinematics(const ProtoStruct& extra) override;
39 std::map<std::string, mesh> get_3d_models(const ProtoStruct& extra) override;
40 std::vector<GeometryConfig> get_geometries(const ProtoStruct& extra) override;
41
42 // Using declarations to introduce convenience overloads of interface which do not need to be
43 // passed the ProtoStruct parameter.
52 using Arm::stop;
53
54 private:
55 using StubType = viam::component::arm::v1::ArmService::StubInterface;
56 std::unique_ptr<StubType> stub_;
57 const ViamChannel* channel_;
58};
59
60} // namespace impl
61} // namespace sdk
62} // namespace viam
Defines an Arm component.
An Arm represents a physical robot arm that exists in three-dimensional space.
Definition arm.hpp:27
KinematicsData get_kinematics()
Get the kinematics data associated with the arm.
Definition arm.hpp:142
std::vector< double > get_joint_positions()
Lists the joint positions in degrees of every joint on a robot arm.
Definition arm.hpp:91
void move_to_joint_positions(const std::vector< double > &positions)
Move each joint on the arm to the corresponding angle specified in.
Definition arm.hpp:100
std::vector< GeometryConfig > get_geometries()
Returns GeometryConfigs associated with the calling arm.
Definition arm.hpp:158
boost::variant< KinematicsDataUnspecified, KinematicsDataSVA, KinematicsDataURDF > KinematicsData
The kinematics of the component.
Definition arm.hpp:60
void move_through_joint_positions(const std::vector< std::vector< double > > &positions, const MoveOptions &options)
Move each joint on the arm through the positions specified in.
Definition arm.hpp:113
std::map< std::string, mesh > get_3d_models()
Returns 3DModels associated with the calling arm.
Definition arm.hpp:153
pose get_end_position()
Get the current position of the end of the arm.
Definition arm.hpp:71
void move_to_position(const pose &pose)
Move the end of the arm to.
Definition arm.hpp:81
virtual std::string name() const
Return the resource's name.
void stop()
Stops a resource from running.
Definition stoppable.hpp:16
Definition dial.hpp:25
gRPC client implementation of an Arm component.
Definition arm_client.hpp:18
pose get_end_position(const ProtoStruct &extra) override
Get the current position of the end of the arm.
std::map< std::string, mesh > get_3d_models(const ProtoStruct &extra) override
Returns 3DModels associated with the calling arm.
bool is_moving() override
Reports if the arm is in motion.
std::vector< double > get_joint_positions(const ProtoStruct &extra) override
Lists the joint positions in degrees of every joint on a robot arm.
void move_to_joint_positions(const std::vector< double > &positions, const ProtoStruct &extra) override
Move each joint on the arm to the corresponding angle specified in.
ProtoStruct do_command(const ProtoStruct &command) override
Send/receive arbitrary commands to the resource.
void move_to_position(const pose &pose, const ProtoStruct &extra) override
Move the end of the arm to.
void stop(const ProtoStruct &extra) override
Stops a resource from running.
std::vector< GeometryConfig > get_geometries(const ProtoStruct &extra) override
Returns GeometryConfigs associated with the calling arm.
Arm::KinematicsData get_kinematics(const ProtoStruct &extra) override
Get the kinematics data associated with the arm.
void move_through_joint_positions(const std::vector< std::vector< double > > &positions, const Arm::MoveOptions &options, const ProtoStruct &extra) override
Move each joint on the arm through the positions specified in.
Movement specifications for move_through_join_positions.
Definition arm.hpp:64
Definition pose.hpp:30