#include <qbsofthand_industry_api.h>
|
| std::unique_ptr< Implementation > | pimpl_ |
| |
Definition at line 61 of file qbsofthand_industry_api.h.
◆ 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_ip | The IPv4 address used for the UDP socket connection. It must be a valid IPv4 address. |
| max_timeout | Time interval for connection in seconds. |
◆ ~qbSoftHandIndustryAPI()
| virtual qbsofthand_industry_api::qbSoftHandIndustryAPI::~qbSoftHandIndustryAPI |
( |
| ) |
|
|
virtual |
Close the UDP socket and perform the proper shutdown procedures.
◆ 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
-
| index | The 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
-
| index | The 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
-
| index | The 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
-
| command | the command to be exectuted |
| max_repeats | the 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
-
| position | The 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
-
| position | The percent-position command reference, in range [0, 100]% where 0 is the fully open configuration, and 100 is the fully closed. |
| velocity | The speed command reference, in range [12.5, 100]% where 12.5 is the minimum velocity of the closure, and 100 is full speed. |
| current | The 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
-
| index | The index of the digital input (3, 4 or 5). |
| position | The reference position for the motor [0, 3800]. |
| velocity | The reference velocity for the motor [400, 3200]. |
| position | The reference current for the motor [250, 450]. |
◆ setEthercatConnection()
| int qbsofthand_industry_api::qbSoftHandIndustryAPI::setEthercatConnection |
( |
const bool & |
mode | ) |
|
Set the connection mode.
- Parameters
-
| mode | true 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
-
| conf | true 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_ip | The device network IP address, e.g. 192.168.1.110. |
| net_mask | The device network mask, e.g. 255.255.255.0. |
| net_gateway | The 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
-
| wait | if 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.
◆ pimpl_
| std::unique_ptr<Implementation> qbsofthand_industry_api::qbSoftHandIndustryAPI::pimpl_ |
|
private |
The documentation for this class was generated from the following file: