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
12#include <viam/sdk/common/proto_value.hpp>
13
15
16namespace viam {
17namespace sdk {
18namespace impl {
19
23class GripperClient : public Gripper {
24 public:
25 using interface_type = Gripper;
26 GripperClient(std::string names, std::shared_ptr<grpc::Channel> channel);
27
28 void open(const ProtoStruct& extra) override;
29 bool grab(const ProtoStruct& extra) override;
30 Gripper::holding_status is_holding_something(const ProtoStruct& extra) override;
31 void stop(const ProtoStruct& extra) override;
32 bool is_moving() override;
33 ProtoStruct do_command(const ProtoStruct& command) override;
34 std::vector<GeometryConfig> get_geometries(const ProtoStruct& extra) override;
35
37 using Gripper::grab;
38 using Gripper::open;
39 using Gripper::stop;
40
41 private:
42 using StubType = viam::component::gripper::v1::GripperService::StubInterface;
43 std::unique_ptr<StubType> stub_;
44 std::shared_ptr<grpc::Channel> channel_;
45};
46
47} // namespace impl
48} // namespace sdk
49} // namespace viam
A Gripper represents a physical robotic gripper.
Definition gripper.hpp:22
void open()
Open the gripper.
Definition gripper.hpp:32
bool grab()
Instruct the gripper to grab.
Definition gripper.hpp:42
std::vector< GeometryConfig > get_geometries()
Returns GeometryConfigs associated with the calling arm.
Definition gripper.hpp:71
void stop()
Stops a resource from running.
Definition stoppable.hpp:16
gRPC client implementation of a Gripper component
Definition gripper_client.hpp:23
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.
Gripper::holding_status is_holding_something(const ProtoStruct &extra) override
Reports whether the gripper is holding onto a object (alongside other information).
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.
whether the gripper is holding something (along with other contextual info)
Definition gripper.hpp:26