Public Member Functions | Private Attributes | List of all members
qbsofthand_industry_api::qbSoftHandIndustryAPI Class Reference

#include <qbsofthand_industry_api.h>

Public Member Functions

double getCurrent ()
 
std::string getDeviceSerialNumber ()
 
int getDigitalInputCurrent (const int &index)
 
int getDigitalInputPosition (const int &index)
 
int getDigitalInputVelocity (const int &index)
 
bool getEthercatConnection ()
 
std::string getFirmwareVersion ()
 
std::string getGateWayAddress ()
 
int getHandSide ()
 
std::string getIPAddress ()
 
int getMaxCurrentThreshold ()
 
std::string getNetMask ()
 
double getPosition ()
 
std::string getSerialNumber ()
 
std::string getStatistics ()
 
std::string getStatisticsFull ()
 
double getVelocity ()
 
double getVoltage ()
 
bool getWaitForStableGrasp ()
 
bool isInitialized ()
 
 qbSoftHandIndustryAPI ()
 
 qbSoftHandIndustryAPI (const bool &debug_serial)
 
 qbSoftHandIndustryAPI (const std::string &device_ip, const int &max_timeout)
 
 qbSoftHandIndustryAPI (const std::string &serial_port_name)
 
void saveParams ()
 saves non-volatile parameters from the RAM to the flash memory More...
 
int sendRawCommand (const std::string &command, const int &max_repeats)
 Send a command to qbSoftHand Industry for max_repeats attempts. More...
 
int setClosure (const float &position)
 
int setClosure (const float &position, const float &velocity, const float &current)
 
int setDigitalInputParams (const int &index, const int &position, const int &velocity, const int &current)
 
int setEthercatConnection (const bool &mode)
 
int setHandSide (const bool &is_right)
 
int setIP (const std::string &net_ip, const std::string &net_mask, const std::string &net_gateway)
 
int setWaitForStableGrasp (const bool &wait)
 
int waitForTargetReached ()
 
virtual ~qbSoftHandIndustryAPI ()
 

Private Attributes

std::unique_ptr< Implementation > pimpl_
 

Detailed Description

Definition at line 61 of file qbsofthand_industry_api.h.

Constructor & Destructor Documentation

◆ qbSoftHandIndustryAPI() [1/4]

qbsofthand_industry_api::qbSoftHandIndustryAPI::qbSoftHandIndustryAPI ( )

Initialize the qb SoftHand Industry API handler by opening the proper UDP socket or, if any Elmo device is found, by serial port and test its communication. The constructor try to connect to the qb SoftHand Industry for at most 2 seconds and then returns. Through the method 'isInitialized()' is possible to test whether the initialization succeeded or not. The default IPv4 address used for the UDP socket connection is 192.168.1.110.

◆ qbSoftHandIndustryAPI() [2/4]

qbsofthand_industry_api::qbSoftHandIndustryAPI::qbSoftHandIndustryAPI ( const bool &  debug_serial)
explicit

Initialize the qb SoftHand Industry API handler by opening, if any Elmo device is found, a serial port and test its communication. Debug messages are printed on terminal. If serial fails, constructor tries default UDP connection.

◆ qbSoftHandIndustryAPI() [3/4]

qbsofthand_industry_api::qbSoftHandIndustryAPI::qbSoftHandIndustryAPI ( const std::string &  serial_port_name)
explicit

Initialize the qb SoftHand Industry API handler by opening, at the name indicated, a serial port and tests its communication. If serial fails, constructor tries default UDP connection.

◆ qbSoftHandIndustryAPI() [4/4]

qbsofthand_industry_api::qbSoftHandIndustryAPI::qbSoftHandIndustryAPI ( const std::string &  device_ip,
const int &  max_timeout 
)
explicit

Initialize the qb SoftHand Industry API handler by opening the proper UDP socket and by testing its communication. With the explicit definition of IP address, this method skips the search for serial connection. The constructor try to connect to the qb SoftHand Industry for at most max_timeout seconds and then returns. Through the method 'isInitialized()' is possible to test whether the initialization succeeded or not.

Parameters
device_ipThe IPv4 address used for the UDP socket connection. It must be a valid IPv4 address.
max_timeoutTime interval for connection in seconds.

◆ ~qbSoftHandIndustryAPI()

virtual qbsofthand_industry_api::qbSoftHandIndustryAPI::~qbSoftHandIndustryAPI ( )
virtual

Close the UDP socket and perform the proper shutdown procedures.

Member Function Documentation

◆ getCurrent()

double qbsofthand_industry_api::qbSoftHandIndustryAPI::getCurrent ( )

Get the actual qb SoftHand Industry motor torque in percent value w.r.t. the maximum value.

◆ getDeviceSerialNumber()

std::string qbsofthand_industry_api::qbSoftHandIndustryAPI::getDeviceSerialNumber ( )

Get the Elmo Driver Serial Number.

◆ getDigitalInputCurrent()

int qbsofthand_industry_api::qbSoftHandIndustryAPI::getDigitalInputCurrent ( const int &  index)

Get the current reference sent to the motor when the digital input is triggered.

Parameters
indexThe index of the digital input (3, 4 or 5).

◆ getDigitalInputPosition()

int qbsofthand_industry_api::qbSoftHandIndustryAPI::getDigitalInputPosition ( const int &  index)

Get the position reference sent to the motor when the digital input is triggered.

Parameters
indexThe index of the digital input (3, 4 or 5).

◆ getDigitalInputVelocity()

int qbsofthand_industry_api::qbSoftHandIndustryAPI::getDigitalInputVelocity ( const int &  index)

Get the velocity reference sent to the motor when the digital input is triggered.

Parameters
indexThe index of the digital input (3, 4 or 5).

◆ getEthercatConnection()

bool qbsofthand_industry_api::qbSoftHandIndustryAPI::getEthercatConnection ( )

Get the connection mode: 1 for Ethercat, 42330 for Ethernet.

◆ getFirmwareVersion()

std::string qbsofthand_industry_api::qbSoftHandIndustryAPI::getFirmwareVersion ( )

Get the qb SoftHand Industry FW version.

◆ getGateWayAddress()

std::string qbsofthand_industry_api::qbSoftHandIndustryAPI::getGateWayAddress ( )

Get the qb SoftHand Industry Gateway address for UDP connection.

◆ getHandSide()

int qbsofthand_industry_api::qbSoftHandIndustryAPI::getHandSide ( )

Get the SoftHand Industry model configuration: 1 for Righ-Hand, 0 for Left-Side.

◆ getIPAddress()

std::string qbsofthand_industry_api::qbSoftHandIndustryAPI::getIPAddress ( )

Get the qb SoftHand Industry IP address for UDP connection.

◆ getMaxCurrentThreshold()

int qbsofthand_industry_api::qbSoftHandIndustryAPI::getMaxCurrentThreshold ( )

Get the maximum absorbed current from qb SoftHand Industry.

◆ getNetMask()

std::string qbsofthand_industry_api::qbSoftHandIndustryAPI::getNetMask ( )

Get the qb SoftHand Industry netmask for UDP connection.

◆ getPosition()

double qbsofthand_industry_api::qbSoftHandIndustryAPI::getPosition ( )

Get the actual qb SoftHand Industry motor position in percent value w.r.t. the maximum value.

◆ getSerialNumber()

std::string qbsofthand_industry_api::qbSoftHandIndustryAPI::getSerialNumber ( )

Get the qb SoftHand Industry Serial Number.

◆ getStatistics()

std::string qbsofthand_industry_api::qbSoftHandIndustryAPI::getStatistics ( )

Get the qb SoftHand Industry device information.

◆ getStatisticsFull()

std::string qbsofthand_industry_api::qbSoftHandIndustryAPI::getStatisticsFull ( )

Get the qb SoftHand Industry full device information.

◆ getVelocity()

double qbsofthand_industry_api::qbSoftHandIndustryAPI::getVelocity ( )

Get the actual qb SoftHand Industry motor velocity in percent value w.r.t. the maximum value.

◆ getVoltage()

double qbsofthand_industry_api::qbSoftHandIndustryAPI::getVoltage ( )

Get the Elmo input Voltage [V].

◆ getWaitForStableGrasp()

bool qbsofthand_industry_api::qbSoftHandIndustryAPI::getWaitForStableGrasp ( )

Get the parameter that defines whether or not the device waits for the stable grasp .

◆ isInitialized()

bool qbsofthand_industry_api::qbSoftHandIndustryAPI::isInitialized ( )

Return true if the initialization procedure has succeeded.

Returns
true on success.

◆ saveParams()

void qbsofthand_industry_api::qbSoftHandIndustryAPI::saveParams ( )

saves non-volatile parameters from the RAM to the flash memory

◆ sendRawCommand()

int qbsofthand_industry_api::qbSoftHandIndustryAPI::sendRawCommand ( const std::string &  command,
const int &  max_repeats 
)

Send a command to qbSoftHand Industry for max_repeats attempts.

Parameters
commandthe command to be exectuted
max_repeatsthe attempts to be performed
Returns
the response status

◆ setClosure() [1/2]

int qbsofthand_industry_api::qbSoftHandIndustryAPI::setClosure ( const float &  position)

Send the given percent-position closure command reference to the qb SoftHand Industry.

Parameters
positionThe percent-position command reference, in range [0, 100]% where 0 is the fully open configuration, and 100 is the fully closed.
Returns
0 on success; -1 if the position is out of range; -3 if communication is lost.

◆ setClosure() [2/2]

int qbsofthand_industry_api::qbSoftHandIndustryAPI::setClosure ( const float &  position,
const float &  velocity,
const float &  current 
)

Send the given percent-position closure command reference to the qb SoftHand Industry, together with the speed reference command and the maximum force that should be applied during the grasp. This is the most complete command to send a reference to the qb SoftHand and should be used for special cases. In normal usage, the simpler version above should be preferred. All the parameters are expressed in percent w.r.t. the maximum possible value.

Parameters
positionThe percent-position command reference, in range [0, 100]% where 0 is the fully open configuration, and 100 is the fully closed.
velocityThe speed command reference, in range [12.5, 100]% where 12.5 is the minimum velocity of the closure, and 100 is full speed.
currentThe current threshold for the motor, in range [62.5, 100]% where 62.5 is the minimum force that the hand can apply, and 100 is the maximum.
Returns
0 on success; -1 if at least one of the percent values is out of range; -3 if communication is lost.

◆ setDigitalInputParams()

int qbsofthand_industry_api::qbSoftHandIndustryAPI::setDigitalInputParams ( const int &  index,
const int &  position,
const int &  velocity,
const int &  current 
)

Set the position, velocity and current references to send to the motor when the digital input is triggered.

Parameters
indexThe index of the digital input (3, 4 or 5).
positionThe reference position for the motor [0, 3800].
velocityThe reference velocity for the motor [400, 3200].
positionThe reference current for the motor [250, 450].

◆ setEthercatConnection()

int qbsofthand_industry_api::qbSoftHandIndustryAPI::setEthercatConnection ( const bool &  mode)

Set the connection mode.

Parameters
modetrue for Ethercat, false for Ethernet.
Returns
0 on success; -1 if the position is out of range; -3 if communication is lost.

◆ setHandSide()

int qbsofthand_industry_api::qbSoftHandIndustryAPI::setHandSide ( const bool &  is_right)

Set the SoftHand Industry model configuration.

Parameters
conftrue for Righ-Hand, false for Left-Side.
Returns
0 on success; -1 if the position is out of range; -3 if communication is lost.

◆ setIP()

int qbsofthand_industry_api::qbSoftHandIndustryAPI::setIP ( const std::string &  net_ip,
const std::string &  net_mask,
const std::string &  net_gateway 
)

Change the qb SoftHand Industry IPv4 address, network mask and gateway of the device. It is worth noticing that the device should be connected first to use this command.

Parameters
net_ipThe device network IP address, e.g. 192.168.1.110.
net_maskThe device network mask, e.g. 255.255.255.0.
net_gatewayThe device network gateway, e.g. 192.168.1.1.
Returns
0 on success; -1 if at least one of the given IPv4-format addresses is wrong.

◆ setWaitForStableGrasp()

int qbsofthand_industry_api::qbSoftHandIndustryAPI::setWaitForStableGrasp ( const bool &  wait)

Set the parameter that blocks receiving new commands until the motor is stationary.

Parameters
waitif true, the device waits until the motor is stationary, false othewise.
Returns
0 on success.

◆ waitForTargetReached()

int qbsofthand_industry_api::qbSoftHandIndustryAPI::waitForTargetReached ( )

Wait until the qb SoftHand Industry has reached the commanded position. This method should be called after a setClosure one, to wait for the action to be completed.

Returns
0 on success; -3 if communication is lost.

Member Data Documentation

◆ pimpl_

std::unique_ptr<Implementation> qbsofthand_industry_api::qbSoftHandIndustryAPI::pimpl_
private

Definition at line 315 of file qbsofthand_industry_api.h.


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


qb_softhand_industry_driver
Author(s): qbroboticsĀ®
autogenerated on Sat Feb 10 2024 03:06:45