66#include < string>
77
88#include < viam/sdk/resource/stoppable.hpp>
9+ #include < viam/sdk/common/proto_convert.hpp>
910
1011namespace viam {
1112namespace sdk {
@@ -20,6 +21,14 @@ namespace sdk {
2021// / specific gripper implementations. This class cannot be used on its own.
2122class Gripper : public Component , public Stoppable {
2223 public:
24+
25+ // / @struct holding_status
26+ // / @brief whether the gripper is holding something (along with other contextual info)
27+ struct holding_status {
28+ bool is_holding_something;
29+ ProtoStruct meta;
30+ };
31+
2332 // / @brief Open the gripper.
2433 inline void open () {
2534 return open ({});
@@ -40,6 +49,17 @@ class Gripper : public Component, public Stoppable {
4049 // / @return bool indicating if the gripper grabbed something.
4150 virtual bool grab (const ProtoStruct& extra) = 0;
4251
52+ // / @brief Reports whether the gripper is holding onto a object (alongside other information).
53+ // / @return holding_status (see `holding_status` struct for more info).
54+ inline holding_status is_holding_something () {
55+ return holding_status ({});
56+ }
57+
58+ // / @brief Reports whether the gripper is holding onto a object (alongside other information).
59+ // / @param extra Any additional arguments to the method.
60+ // / @return holding_status (see `holding_status` struct for more info).
61+ virtual holding_status is_holding_something (const ProtoStruct& extra) = 0;
62+
4363 // / @brief Reports if the gripper is in motion.
4464 virtual bool is_moving () = 0;
4565
0 commit comments