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/common/proto_value.hpp>
9#include <viam/sdk/resource/stoppable.hpp>
10
11namespace viam {
12namespace sdk {
13
15
22class Gripper : public Component, public Stoppable {
23 public:
27 bool is_holding_something;
28 ProtoStruct meta;
29 };
30
32 inline void open() {
33 return open({});
34 }
35
38 virtual void open(const ProtoStruct& extra) = 0;
39
42 inline bool grab() {
43 return grab({});
44 }
45
49 virtual bool grab(const ProtoStruct& extra) = 0;
50
54 return holding_status({});
55 }
56
60 virtual holding_status is_holding_something(const ProtoStruct& extra) = 0;
61
63 virtual bool is_moving() = 0;
64
68 virtual ProtoStruct do_command(const ProtoStruct& command) = 0;
69
71 inline std::vector<GeometryConfig> get_geometries() {
72 return get_geometries({});
73 }
74
77 virtual std::vector<GeometryConfig> get_geometries(const ProtoStruct& extra) = 0;
78
79 API api() const override;
80
81 protected:
82 explicit Gripper(std::string name);
83};
84
85template <>
87 static API api();
88};
89
90} // namespace sdk
91} // namespace viam
Definition resource_api.hpp:21
Definition component.hpp:10
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
virtual void open(const ProtoStruct &extra)=0
Open the gripper.
void open()
Open the gripper.
Definition gripper.hpp:32
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:42
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:71
virtual bool is_moving()=0
Reports if the gripper is in motion.
virtual holding_status is_holding_something(const ProtoStruct &extra)=0
Reports whether the gripper is holding onto a object (alongside other information).
virtual std::string name() const
Return the resource's name.
Definition stoppable.hpp:8
Definition resource_api.hpp:46
whether the gripper is holding something (along with other contextual info)
Definition gripper.hpp:26