qb_hand_hardware_interface.cpp
Go to the documentation of this file.
1 /***
2  * Software License Agreement: BSD 3-Clause License
3  *
4  * Copyright (c) 2016-2018, 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 
29 
30 using namespace qb_hand_hardware_interface;
31 
33  : qbDeviceHW(std::make_shared<qb_hand_transmission_interface::qbHandVirtualTransmission>(), {"synergy_joint"}, {"synergy_joint"}) {
34 
35 }
36 
38 
39 }
40 
41 std::vector<std::string> qbHandHW::getJoints() {
42  return joints_.names;
43 }
44 
45 bool qbHandHW::init(ros::NodeHandle &root_nh, ros::NodeHandle &robot_hw_nh) {
46  if (!qb_device_hardware_interface::qbDeviceHW::init(root_nh, robot_hw_nh)) {
47  return false;
48  }
49 
50  // if the device interface initialization has succeed the device info have been retrieved
52  return true;
53 }
54 
55 void qbHandHW::read(const ros::Time &time, const ros::Duration &period) {
56  // read actuator state from the hardware (convert to proper measurement units)
58 }
59 
60 void qbHandHW::write(const ros::Time &time, const ros::Duration &period) {
61  // send actuator command to the hardware (saturate and convert to proper measurement units)
63 }
64 
qb_device_hardware_interface::qbDeviceHWResources joints_
virtual bool init(ros::NodeHandle &root_nh, ros::NodeHandle &robot_hw_nh)
std::vector< std::string > getJoints() override
qb_device_hardware_interface::qbDeviceResources device_
virtual void read(const ros::Time &time, const ros::Duration &period)
qb_device_transmission_interface::qbDeviceTransmissionResources transmission_
The qbrobotics qbhand HardWare interface implements the specific structures to manage the communicati...
qbHandHW()
Initialize the qb_device_hardware_interface::qbDeviceHW with the specific transmission interface and ...
bool init(ros::NodeHandle &root_nh, ros::NodeHandle &robot_hw_nh) override
Call the base method and nothing more.
virtual void write(const ros::Time &time, const ros::Duration &period)
void write(const ros::Time &time, const ros::Duration &period) override
Call the base method and nothing more.
PLUGINLIB_EXPORT_CLASS(transmission_interface::BiDirectionalEffortJointInterfaceProvider, transmission_interface::RequisiteProvider)
void read(const ros::Time &time, const ros::Duration &period) override
Call the base method and nothing more.
The qbrobotics qbhand Transmission interface implements the specific transmission_interface::Transmis...


qb_hand_hardware_interface
Author(s): qbrobotics®
autogenerated on Wed Jun 5 2019 20:23:24