Main Page
Classes
Files
File List
File Members
src
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
****************************************************************/
55
#include <
force_torque_sensor/force_torque_sensor_handle.h
>
56
#include <
force_torque_sensor/force_torque_sensor_sim.h
>
57
#include <force_torque_sensor/NodeConfigurationParameters.h>
58
59
#include <
ati_force_torque/ati_force_torque_hw_can.h
>
60
#include <
ati_force_torque/ati_force_torque_hw_rs485.h
>
61
62
class
ATIForceTorqueSensorNode
63
{
64
public
:
65
ATIForceTorqueSensorNode
(
ros::NodeHandle
&nh):
node_params_
{
ros::NodeHandle
(
"~/Node"
).getNamespace()}
66
{
67
node_params_
.fromParamServer();
68
bool
sim =
node_params_
.sim;
69
hardware_interface::ForceTorqueSensorHW
*sensor;
70
if
(sim) {
71
sensor =
new
force_torque_sensor::ForceTorqueSensorSim
();
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
98
ATIForceTorqueSensorNode
ftn(nh);
99
100
ROS_INFO
(
"ForceTorque Sensor Node running."
);
101
102
ros::waitForShutdown
();
103
104
return
0;
105
}
106
ati_force_torque_hw_can.h
ATIForceTorqueSensorNode
Definition:
force_torque_sensor_node.cpp:62
force_torque_sensor::ForceTorqueSensorSim
ros::NodeHandle
ros::init
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
main
int main(int argc, char **argv)
Definition:
force_torque_sensor_node.cpp:89
force_torque_sensor_sim.h
force_torque_sensor_handle.h
ATIForceTorqueSensorHWCan
Definition:
ati_force_torque_hw_can.h:83
spinner
void spinner()
ros::AsyncSpinner::start
void start()
ROS_INFO
#define ROS_INFO(...)
ATIForceTorqueSensorNode::node_params_
force_torque_sensor::NodeConfigurationParameters node_params_
Definition:
force_torque_sensor_node.cpp:86
ATIForceTorqueSensorHWRS485
Definition:
ati_force_torque_hw_rs485.h:130
force_torque_sensor::ForceTorqueSensorHandle
hardware_interface::ForceTorqueSensorHW
ati_force_torque_hw_rs485.h
ATIForceTorqueSensorNode::ATIForceTorqueSensorNode
ATIForceTorqueSensorNode(ros::NodeHandle &nh)
Definition:
force_torque_sensor_node.cpp:65
ROS_ERROR
#define ROS_ERROR(...)
ros::waitForShutdown
ROSCPP_DECL void waitForShutdown()
ros::AsyncSpinner
ati_force_torque
Author(s): Denis Štogl, Alexander Bubeck
autogenerated on Thu Sep 17 2020 03:18:35