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 ProtoStruct& extra) override;
27 bool grab(const ProtoStruct& extra) override;
28 void stop(const ProtoStruct& extra) override;
29 bool is_moving() override;
30 ProtoStruct do_command(const ProtoStruct& command) override;
31 std::vector<GeometryConfig> get_geometries(const ProtoStruct& 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:21
void open()
Open the gripper.
Definition gripper.hpp:24
bool grab()
Instruct the gripper to grab.
Definition gripper.hpp:34
std::vector< GeometryConfig > get_geometries()
Returns GeometryConfigs associated with the calling arm.
Definition gripper.hpp:52
void stop()
Stops a resource from running.
Definition stoppable.hpp:16
gRPC client implementation of a Gripper component
Definition gripper_client.hpp:21
bool grab(const ProtoStruct &extra) override
Instruct the gripper to grab.
void open(const ProtoStruct &extra) override
Open the gripper.
void stop(const ProtoStruct &extra) override
Stops a resource from running.
bool is_moving() override
Reports if the gripper is in motion.
std::vector< GeometryConfig > get_geometries(const ProtoStruct &extra) override
Returns GeometryConfigs associated with the calling arm.
ProtoStruct do_command(const ProtoStruct &command) override
Send/receive arbitrary commands to the resource.
Defines a Gripper component.