Viam C++ SDK current
Loading...
Searching...
No Matches
gripper.hpp
Go to the documentation of this file.
1
4#pragma once
5
6#include <string>
7
8#include <viam/sdk/resource/stoppable.hpp>
9
10namespace viam {
11namespace sdk {
12
14
21class Gripper : public Component, public Stoppable {
22 public:
24 inline void open() {
25 return open({});
26 }
27
30 virtual void open(const ProtoStruct& extra) = 0;
31
34 inline bool grab() {
35 return grab({});
36 }
37
41 virtual bool grab(const ProtoStruct& extra) = 0;
42
44 virtual bool is_moving() = 0;
45
49 virtual ProtoStruct do_command(const ProtoStruct& command) = 0;
50
52 inline std::vector<GeometryConfig> get_geometries() {
53 return get_geometries({});
54 }
55
58 virtual std::vector<GeometryConfig> get_geometries(const ProtoStruct& extra) = 0;
59
60 API api() const override;
61
62 protected:
63 explicit Gripper(std::string name);
64};
65
66template <>
68 static API api();
69};
70
71} // namespace sdk
72} // namespace viam
Extends APIType to additionally define a resource's subtype (e.g., camera).
Definition resource_api.hpp:33
Definition component.hpp:10
A Gripper represents a physical robotic gripper.
Definition gripper.hpp:21
virtual void open(const ProtoStruct &extra)=0
Open the gripper.
void open()
Open the gripper.
Definition gripper.hpp:24
virtual std::vector< GeometryConfig > get_geometries(const ProtoStruct &extra)=0
Returns GeometryConfigs associated with the calling arm.
API api() const override
Returns the API associated with a particular resource.
virtual ProtoStruct do_command(const ProtoStruct &command)=0
Send/receive arbitrary commands to the resource.
bool grab()
Instruct the gripper to grab.
Definition gripper.hpp:34
virtual bool grab(const ProtoStruct &extra)=0
Instruct the gripper to grab.
std::vector< GeometryConfig > get_geometries()
Returns GeometryConfigs associated with the calling arm.
Definition gripper.hpp:52
virtual bool is_moving()=0
Reports if the gripper is in motion.
virtual std::string name() const
Return the resource's name.
Definition stoppable.hpp:8
Definition resource_api.hpp:50