00001 /**************************************************************** 00002 * 00003 * Copyright 2016 Intelligent Industrial Robotics (IIROB) Group, 00004 * Institute for Anthropomatics and Robotics (IAR) - 00005 * Intelligent Process Control and Robotics (IPR), 00006 * Karlsruhe Institute of Technology 00007 * 00008 * Maintainers: Denis Štogl, email: denis.stogl@kit.edu 00009 * Florian Heller 00010 * Vanessa Streuer 00011 * 00012 * Date of update: 2014-2016 00013 * 00014 * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00015 * 00016 * Redistribution and use in source and binary forms, with or without 00017 * modification, are permitted provided that the following conditions are met: 00018 * 00019 * * Redistributions of source code must retain the above copyright 00020 * notice, this list of conditions and the following disclaimer. 00021 * * Redistributions in binary form must reproduce the above copyright 00022 * notice, this list of conditions and the following disclaimer in the 00023 * documentation and/or other materials provided with the distribution. 00024 * * Neither the name of the copyright holder nor the names of its 00025 * contributors may be used to endorse or promote products derived from 00026 * this software without specific prior written permission. 00027 * 00028 * This program is free software: you can redistribute it and/or modify 00029 * it under the terms of the GNU Lesser General Public License LGPL as 00030 * published by the Free Software Foundation, either version 3 of the 00031 * License, or (at your option) any later version. 00032 * 00033 * This program is distributed in the hope that it will be useful, 00034 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00035 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00036 * GNU Lesser General Public License LGPL for more details. 00037 * 00038 * You should have received a copy of the GNU Lesser General Public 00039 * License LGPL along with this program. 00040 * If not, see <http://www.gnu.org/licenses/>. 00041 * 00042 ****************************************************************/ 00043 00044 #include <ati_force_torque/force_torque_sensor_handle.h> 00045 00046 ForceTorqueSensorHandle::ForceTorqueSensorHandle(ros::NodeHandle& nh, std::string sensor_name, std::string output_frame) : 00047 ForceTorqueSensor(nh), hardware_interface::ForceTorqueSensorHandle(sensor_name, output_frame, interface_force_, interface_torque_) 00048 { 00049 transform_frame_ = output_frame; 00050 } 00051 00052 void ForceTorqueSensorHandle::updateFTData(const ros::TimerEvent& event) 00053 { 00054 filterFTData(); 00055 interface_force_[0] = threshold_filtered_force.wrench.force.x; 00056 interface_force_[1] = threshold_filtered_force.wrench.force.y; 00057 interface_force_[2] = threshold_filtered_force.wrench.force.z; 00058 00059 interface_torque_[0] = threshold_filtered_force.wrench.torque.x; 00060 interface_torque_[1] = threshold_filtered_force.wrench.torque.y; 00061 interface_torque_[2] = threshold_filtered_force.wrench.torque.z; 00062 }