55
66#include < string>
77
8+ #include < viam/sdk/common/proto_value.hpp>
89#include < viam/sdk/resource/stoppable.hpp>
910
1011namespace viam {
@@ -20,6 +21,13 @@ namespace sdk {
2021// / specific gripper implementations. This class cannot be used on its own.
2122class Gripper : public Component , public Stoppable {
2223 public:
24+ // / @struct holding_status
25+ // / @brief whether the gripper is holding something (along with other contextual info)
26+ struct holding_status {
27+ bool is_holding_something;
28+ ProtoStruct meta;
29+ };
30+
2331 // / @brief Open the gripper.
2432 inline void open () {
2533 return open ({});
@@ -40,6 +48,17 @@ class Gripper : public Component, public Stoppable {
4048 // / @return bool indicating if the gripper grabbed something.
4149 virtual bool grab (const ProtoStruct& extra) = 0;
4250
51+ // / @brief Reports whether the gripper is holding onto a object (alongside other information).
52+ // / @return holding_status (see `holding_status` struct for more info).
53+ inline holding_status is_holding_something () {
54+ return holding_status ({});
55+ }
56+
57+ // / @brief Reports whether the gripper is holding onto a object (alongside other information).
58+ // / @param extra Any additional arguments to the method.
59+ // / @return holding_status (see `holding_status` struct for more info).
60+ virtual holding_status is_holding_something (const ProtoStruct& extra) = 0;
61+
4362 // / @brief Reports if the gripper is in motion.
4463 virtual bool is_moving () = 0;
4564
0 commit comments