force_torque_sensor_node.cpp
Go to the documentation of this file.
1 /****************************************************************
2  *
3  * Copyright 2016 Intelligent Industrial Robotics (IIROB) Group,
4  * Institute for Anthropomatics and Robotics (IAR) -
5  * Intelligent Process Control and Robotics (IPR),
6  * Karlsruhe Institute of Technology
7  *
8  * Maintainers: Denis Štogl, email: denis.stogl@kit.edu
9  * Florian Heller
10  * Vanessa Streuer
11  *
12  * Date of update: 2014-2016
13  *
14  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15  *
16  * Copyright (c) 2010
17  *
18  * Fraunhofer Institute for Manufacturing Engineering
19  * and Automation (IPA)
20  *
21  * Author: Alexander Bubeck, email:alexander.bubeck@ipa.fhg.de
22  * Supervised by: Alexander Bubeck, email:alexander.bubeck@ipa.fhg.de
23  *
24  * Date of creation: June 2010
25  *
26  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
27  *
28  * Redistribution and use in source and binary forms, with or without
29  * modification, are permitted provided that the following conditions are met:
30  *
31  * * Redistributions of source code must retain the above copyright
32  * notice, this list of conditions and the following disclaimer.
33  * * Redistributions in binary form must reproduce the above copyright
34  * notice, this list of conditions and the following disclaimer in the
35  * documentation and/or other materials provided with the distribution.
36  * * Neither the name of the copyright holder nor the names of its
37  * contributors may be used to endorse or promote products derived from
38  * this software without specific prior written permission.
39  *
40  * This program is free software: you can redistribute it and/or modify
41  * it under the terms of the GNU Lesser General Public License LGPL as
42  * published by the Free Software Foundation, either version 3 of the
43  * License, or (at your option) any later version.
44  *
45  * This program is distributed in the hope that it will be useful,
46  * but WITHOUT ANY WARRANTY; without even the implied warranty of
47  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48  * GNU Lesser General Public License LGPL for more details.
49  *
50  * You should have received a copy of the GNU Lesser General Public
51  * License LGPL along with this program.
52  * If not, see <http://www.gnu.org/licenses/>.
53  *
54  ****************************************************************/
57 #include <force_torque_sensor/NodeConfigurationParameters.h>
58 
61 
63 {
64 public:
66 {
67  node_params_.fromParamServer();
68  bool sim = node_params_.sim;
70  if(sim) {
72  }
73  else if (node_params_.sensor_hw == "ati_force_torque/ATIForceTorqueSensorHWCan"){
74  sensor = new ATIForceTorqueSensorHWCan();
75  }
76  else if (node_params_.sensor_hw == "ati_force_torque/ATIForceTorqueSensorHWRS485"){
77  sensor = new ATIForceTorqueSensorHWRS485();
78  }
79  else {
80  ROS_ERROR("Unknown sensor hardware plugin!");
81  return;
82  }
83  new force_torque_sensor::ForceTorqueSensorHandle(nh, sensor, node_params_.sensor_frame,node_params_.transform_frame);
84 }
85 private:
86  force_torque_sensor::NodeConfigurationParameters node_params_;
87 };
88 
89 int main(int argc, char **argv)
90 {
91  ros::init(argc, argv, "force_torque_node");
92 
93  ros::AsyncSpinner spinner(4); // Use 4 threads
94  spinner.start();
95 
96  ros::NodeHandle nh("~");
97 
99 
100  ROS_INFO("ForceTorque Sensor Node running.");
101 
103 
104  return 0;
105 }
106 
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
int main(int argc, char **argv)
void spinner()
#define ROS_INFO(...)
force_torque_sensor::NodeConfigurationParameters node_params_
ATIForceTorqueSensorNode(ros::NodeHandle &nh)
#define ROS_ERROR(...)
ROSCPP_DECL void waitForShutdown()


ati_force_torque
Author(s): Denis Štogl, Alexander Bubeck
autogenerated on Thu Sep 17 2020 03:18:35