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 <viam/api/component/gripper/v1/gripper.grpc.pb.h>
9
11#include <viam/sdk/rpc/dial.hpp>
12
13namespace viam {
14namespace sdk {
15namespace impl {
16
20class GripperClient : public Gripper {
21 public:
22 using interface_type = Gripper;
23 GripperClient(std::string name, const ViamChannel& channel);
24
25 const ViamChannel& channel() const {
26 return *channel_;
27 }
28
29 void open(const ProtoStruct& extra) override;
30
31 bool grab(const ProtoStruct& extra) override;
32
33 Gripper::holding_status is_holding_something(const ProtoStruct& extra) override;
34
35 void stop(const ProtoStruct& extra) override;
36
37 bool is_moving() override;
38
39 ProtoStruct do_command(const ProtoStruct& command) override;
40
41 std::vector<GeometryConfig> get_geometries(const ProtoStruct& extra) override;
42
44 using Gripper::grab;
46 using Gripper::open;
47 using Gripper::stop;
48
49 private:
50 using StubType = viam::component::gripper::v1::GripperService::StubInterface;
51 std::unique_ptr<StubType> stub_;
52 const ViamChannel* channel_;
53};
54
55} // namespace impl
56} // namespace sdk
57} // namespace viam
A Gripper represents a physical robotic gripper.
Definition gripper.hpp:22
holding_status is_holding_something()
Reports whether the gripper is holding onto a object (alongside other information).
Definition gripper.hpp:53
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
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 a Gripper component
Definition gripper_client.hpp:20
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