Viam C++ SDK current
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | List of all members
viam::sdk::Gripper Class Referenceabstract

A Gripper represents a physical robotic gripper. More...

#include "components/gripper.hpp"

+ Inheritance diagram for viam::sdk::Gripper:

Classes

struct  holding_status
 whether the gripper is holding something (along with other contextual info) More...
 

Public Member Functions

void open ()
 Open the gripper.
 
virtual void open (const ProtoStruct &extra)=0
 Open the gripper.
 
bool grab ()
 Instruct the gripper to grab.
 
virtual bool grab (const ProtoStruct &extra)=0
 Instruct the gripper to grab.
 
holding_status is_holding_something ()
 Reports whether the gripper is holding onto a object (alongside other information).
 
virtual holding_status is_holding_something (const ProtoStruct &extra)=0
 Reports whether the gripper is holding onto a object (alongside other information).
 
virtual bool is_moving ()=0
 Reports if the gripper is in motion.
 
virtual ProtoStruct do_command (const ProtoStruct &command)=0
 Send/receive arbitrary commands to the resource.
 
std::vector< GeometryConfigget_geometries ()
 Returns GeometryConfigs associated with the calling arm.
 
virtual std::vector< GeometryConfigget_geometries (const ProtoStruct &extra)=0
 Returns GeometryConfigs associated with the calling arm.
 
API api () const override
 Returns the API associated with a particular resource.
 
- Public Member Functions inherited from viam::sdk::Component
Name get_resource_name () const override
 Returns the Name for a particular resource.
 
- Public Member Functions inherited from viam::sdk::Resource
 Resource (std::string name)
 
virtual std::string name () const
 Return the resource's name.
 
void set_log_level (log_level) const
 Set the log level for log messages originating from this Resource.
 
- Public Member Functions inherited from viam::sdk::Stoppable
virtual void stop (const ProtoStruct &extra)=0
 Stops a resource from running.
 
void stop ()
 Stops a resource from running.
 

Protected Member Functions

 Gripper (std::string name)
 
- Protected Member Functions inherited from viam::sdk::Component
 Component (std::string name)
 
- Protected Member Functions inherited from viam::sdk::Resource
Name get_resource_name (const std::string &type) const
 

Additional Inherited Members

- Protected Attributes inherited from viam::sdk::Resource
LogSource logger_
 

Detailed Description

A Gripper represents a physical robotic gripper.

This acts as an abstract parent class to be inherited from by any drivers representing specific gripper implementations. This class cannot be used on its own.

Member Function Documentation

◆ api()

API viam::sdk::Gripper::api ( ) const
overridevirtual

Returns the API associated with a particular resource.

Implements viam::sdk::Resource.

◆ do_command()

virtual ProtoStruct viam::sdk::Gripper::do_command ( const ProtoStruct & command)
pure virtual

Send/receive arbitrary commands to the resource.

Parameters
Commandthe command to execute.
Returns
The result of the executed command.

Implemented in viam::sdk::impl::GripperClient.

◆ get_geometries()

virtual std::vector< GeometryConfig > viam::sdk::Gripper::get_geometries ( const ProtoStruct & extra)
pure virtual

Returns GeometryConfigs associated with the calling arm.

Parameters
extraAny additional arguments to the method

Implemented in viam::sdk::impl::GripperClient, and viam::sdk::impl::GripperClient.

◆ grab() [1/2]

bool viam::sdk::Gripper::grab ( )
inline

Instruct the gripper to grab.

Returns
bool indicating if the gripper grabbed something.

◆ grab() [2/2]

virtual bool viam::sdk::Gripper::grab ( const ProtoStruct & extra)
pure virtual

Instruct the gripper to grab.

Parameters
extraAny additional arguments to the method.
Returns
bool indicating if the gripper grabbed something.

Implemented in viam::sdk::impl::GripperClient, and viam::sdk::impl::GripperClient.

◆ is_holding_something() [1/2]

holding_status viam::sdk::Gripper::is_holding_something ( )
inline

Reports whether the gripper is holding onto a object (alongside other information).

Returns
holding_status (see holding_status struct for more info).

◆ is_holding_something() [2/2]

virtual holding_status viam::sdk::Gripper::is_holding_something ( const ProtoStruct & extra)
pure virtual

Reports whether the gripper is holding onto a object (alongside other information).

Parameters
extraAny additional arguments to the method.
Returns
holding_status (see holding_status struct for more info).

Implemented in viam::sdk::impl::GripperClient.

◆ is_moving()

virtual bool viam::sdk::Gripper::is_moving ( )
pure virtual

Reports if the gripper is in motion.

Implemented in viam::sdk::impl::GripperClient.

◆ open()

virtual void viam::sdk::Gripper::open ( const ProtoStruct & extra)
pure virtual

Open the gripper.

Parameters
extraAny additional arguments to the method.

Implemented in viam::sdk::impl::GripperClient, and viam::sdk::impl::GripperClient.


The documentation for this class was generated from the following file: