qbsofthand_industry_api.h
Go to the documentation of this file.
1 /***
2  * Software License Agreement: BSD 3-Clause License
3  *
4  * Copyright (c) 2019-2023, qbrobotics®
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
8  * following conditions are met:
9  *
10  * * Redistributions of source code must retain the above copyright notice, this list of conditions and the
11  * following disclaimer.
12  *
13  * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
14  * following disclaimer in the documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
17  * products derived from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
25  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 #ifndef QBSOFTHAND_INDUSTRY_API_H
29 #define QBSOFTHAND_INDUSTRY_API_H
30 
31 // standard libraries
32 #include <memory>
33 #include <string>
34 
37  public:
46 
52  explicit qbSoftHandIndustryAPI(const bool &debug_serial);
53 
58  explicit qbSoftHandIndustryAPI(const std::string &serial_port_name);
59 
68  explicit qbSoftHandIndustryAPI(const std::string &device_ip, const int &max_timeout);
69 
73  virtual ~qbSoftHandIndustryAPI();
74 
78  double getCurrent();
79 
83  double getVoltage();
84 
89  int getDigitalInputPosition(const int &index);
90 
95  int getDigitalInputVelocity(const int &index);
96 
101  int getDigitalInputCurrent(const int &index);
102 
106  double getPosition();
107 
111  double getVelocity();
112 
116  std::string getStatistics();
117 
121  std::string getStatisticsFull();
122 
126  std::string getSerialNumber();
127 
131  std::string getDeviceSerialNumber();
132 
136  std::string getFirmwareVersion();
137 
141  std::string getIPAddress();
142 
146  std::string getNetMask();
147 
151  std::string getGateWayAddress();
152 
157 
161  bool getWaitForStableGrasp();
162 
166  bool getEthercatConnection();
167 
171  int getHandSide();
172 
178  int setHandSide(const bool &is_right);
179 
185  int setEthercatConnection(const bool &mode);
186 
191  bool isInitialized();
192 
196  void saveParams();
197 
204  int setClosure(const float &position);
205 
220  int setClosure(const float &position, const float &velocity, const float &current);
221 
230  int setIP(const std::string &net_ip, const std::string &net_mask, const std::string &net_gateway);
231 
239  int setDigitalInputParams(const int &index, const int &position, const int &velocity, const int &current);
240 
246  int setWaitForStableGrasp(const bool &wait);
247 
253  int waitForTargetReached();
254 
262  int sendRawCommand(const std::string &command, const int &max_repeats);
263 
264  private:
265  class Implementation;
266  std::unique_ptr<Implementation> pimpl_;
267 };
268 } // namespace qbsofthand_industry_api
269 
270 #endif // QBSOFTHAND_INDUSTRY_API_H
qbsofthand_industry_api::qbSoftHandIndustryAPI
Definition: qbsofthand_industry_api.h:61
qbsofthand_industry_api::qbSoftHandIndustryAPI::qbSoftHandIndustryAPI
qbSoftHandIndustryAPI()
qbsofthand_industry_api::qbSoftHandIndustryAPI::pimpl_
std::unique_ptr< Implementation > pimpl_
Definition: qbsofthand_industry_api.h:315
qbsofthand_industry_api::qbSoftHandIndustryAPI::setEthercatConnection
int setEthercatConnection(const bool &mode)
qbsofthand_industry_api::qbSoftHandIndustryAPI::getPosition
double getPosition()
qbsofthand_industry_api::qbSoftHandIndustryAPI::getSerialNumber
std::string getSerialNumber()
qbsofthand_industry_api::qbSoftHandIndustryAPI::setClosure
int setClosure(const float &position)
command
ROSLIB_DECL std::string command(const std::string &cmd)
qbsofthand_industry_api::qbSoftHandIndustryAPI::getDeviceSerialNumber
std::string getDeviceSerialNumber()
qbsofthand_industry_api::qbSoftHandIndustryAPI::setIP
int setIP(const std::string &net_ip, const std::string &net_mask, const std::string &net_gateway)
qbsofthand_industry_api::qbSoftHandIndustryAPI::~qbSoftHandIndustryAPI
virtual ~qbSoftHandIndustryAPI()
qbsofthand_industry_api::qbSoftHandIndustryAPI::setWaitForStableGrasp
int setWaitForStableGrasp(const bool &wait)
qbsofthand_industry_api::qbSoftHandIndustryAPI::getGateWayAddress
std::string getGateWayAddress()
qbsofthand_industry_api::qbSoftHandIndustryAPI::getDigitalInputVelocity
int getDigitalInputVelocity(const int &index)
qbsofthand_industry_api::qbSoftHandIndustryAPI::saveParams
void saveParams()
saves non-volatile parameters from the RAM to the flash memory
qbsofthand_industry_api::qbSoftHandIndustryAPI::sendRawCommand
int sendRawCommand(const std::string &command, const int &max_repeats)
Send a command to qbSoftHand Industry for max_repeats attempts.
qbsofthand_industry_api::qbSoftHandIndustryAPI::getDigitalInputPosition
int getDigitalInputPosition(const int &index)
qbsofthand_industry_api::qbSoftHandIndustryAPI::waitForTargetReached
int waitForTargetReached()
qbsofthand_industry_api::qbSoftHandIndustryAPI::setHandSide
int setHandSide(const bool &is_right)
qbsofthand_industry_api::qbSoftHandIndustryAPI::getVelocity
double getVelocity()
qbsofthand_industry_api::qbSoftHandIndustryAPI::getDigitalInputCurrent
int getDigitalInputCurrent(const int &index)
qbsofthand_industry_api::qbSoftHandIndustryAPI::getEthercatConnection
bool getEthercatConnection()
qbsofthand_industry_api::qbSoftHandIndustryAPI::isInitialized
bool isInitialized()
qbsofthand_industry_api::qbSoftHandIndustryAPI::getStatisticsFull
std::string getStatisticsFull()
qbsofthand_industry_api::qbSoftHandIndustryAPI::getWaitForStableGrasp
bool getWaitForStableGrasp()
qbsofthand_industry_api::qbSoftHandIndustryAPI::getIPAddress
std::string getIPAddress()
qbsofthand_industry_api::qbSoftHandIndustryAPI::getVoltage
double getVoltage()
qbsofthand_industry_api::qbSoftHandIndustryAPI::setDigitalInputParams
int setDigitalInputParams(const int &index, const int &position, const int &velocity, const int &current)
qbsofthand_industry_api
Definition: qbsofthand_industry_api.h:35
qbsofthand_industry_api::qbSoftHandIndustryAPI::getNetMask
std::string getNetMask()
qbsofthand_industry_api::qbSoftHandIndustryAPI::getMaxCurrentThreshold
int getMaxCurrentThreshold()
qbsofthand_industry_api::qbSoftHandIndustryAPI::getStatistics
std::string getStatistics()
qbsofthand_industry_api::qbSoftHandIndustryAPI::getFirmwareVersion
std::string getFirmwareVersion()
qbsofthand_industry_api::qbSoftHandIndustryAPI::getHandSide
int getHandSide()
qbsofthand_industry_api::qbSoftHandIndustryAPI::getCurrent
double getCurrent()


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