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/api/common/v1/common.pb.h>
9#include <viam/api/component/gripper/v1/gripper.pb.h>
10
11#include <viam/sdk/resource/stoppable.hpp>
12
13namespace viam {
14namespace sdk {
15
17
24class Gripper : public Component, public Stoppable {
25 public:
27 inline void open() {
28 return open({});
29 }
30
33 virtual void open(const AttributeMap& extra) = 0;
34
37 inline bool grab() {
38 return grab({});
39 }
40
44 virtual bool grab(const AttributeMap& extra) = 0;
45
47 virtual bool is_moving() = 0;
48
52 virtual AttributeMap do_command(const AttributeMap& command) = 0;
53
55 inline std::vector<GeometryConfig> get_geometries() {
56 return get_geometries({});
57 }
58
61 virtual std::vector<GeometryConfig> get_geometries(const AttributeMap& extra) = 0;
62
63 API api() const override;
64
65 protected:
66 explicit Gripper(std::string name);
67};
68
69template <>
71 static API api();
72};
73
74} // namespace sdk
75} // namespace viam
Extends APIType to additionally define a resource's subtype (e.g., camera).
Definition resource_api.hpp:33
Definition component.hpp:14
A Gripper represents a physical robotic gripper.
Definition gripper.hpp:24
virtual std::vector< GeometryConfig > get_geometries(const AttributeMap &extra)=0
Returns GeometryConfigs associated with the calling arm.
void open()
Open the gripper.
Definition gripper.hpp:27
API api() const override
Returns the API associated with a particular resource.
virtual void open(const AttributeMap &extra)=0
Open the gripper.
bool grab()
Instruct the gripper to grab.
Definition gripper.hpp:37
virtual AttributeMap do_command(const AttributeMap &command)=0
Send/receive arbitrary commands to the resource.
std::vector< GeometryConfig > get_geometries()
Returns GeometryConfigs associated with the calling arm.
Definition gripper.hpp:55
virtual bool grab(const AttributeMap &extra)=0
Instruct the gripper to grab.
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