Viam C++ SDK current
Loading...
Searching...
No Matches
gripper_client.hpp
Go to the documentation of this file.
1
4#pragma once
5
6#include <memory>
7
8#include <grpcpp/channel.h>
9
10#include <viam/api/component/gripper/v1/gripper.grpc.pb.h>
11
13
14namespace viam {
15namespace sdk {
16namespace impl {
17
21class GripperClient : public Gripper {
22 public:
23 using interface_type = Gripper;
24 GripperClient(std::string names, std::shared_ptr<grpc::Channel> channel);
25
26 void open(const AttributeMap& extra) override;
27 bool grab(const AttributeMap& extra) override;
28 void stop(const AttributeMap& extra) override;
29 bool is_moving() override;
30 AttributeMap do_command(const AttributeMap& command) override;
31 std::vector<GeometryConfig> get_geometries(const AttributeMap& extra) override;
32
34 using Gripper::grab;
35 using Gripper::open;
36 using Gripper::stop;
37
38 private:
39 using StubType = viam::component::gripper::v1::GripperService::StubInterface;
40 std::unique_ptr<StubType> stub_;
41 std::shared_ptr<grpc::Channel> channel_;
42};
43
44} // namespace impl
45} // namespace sdk
46} // namespace viam
A Gripper represents a physical robotic gripper.
Definition gripper.hpp:24
void open()
Open the gripper.
Definition gripper.hpp:27
bool grab()
Instruct the gripper to grab.
Definition gripper.hpp:37
std::vector< GeometryConfig > get_geometries()
Returns GeometryConfigs associated with the calling arm.
Definition gripper.hpp:55
void stop()
Stops a resource from running.
Definition stoppable.hpp:16
gRPC client implementation of a Gripper component
Definition gripper_client.hpp:21
bool is_moving() override
Reports if the gripper is in motion.
bool grab(const AttributeMap &extra) override
Instruct the gripper to grab.
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.
void open(const AttributeMap &extra) override
Open the gripper.
AttributeMap do_command(const AttributeMap &command) override
Send/receive arbitrary commands to the resource.
Defines a Gripper component.