parameter_pa_node.cpp
Go to the documentation of this file.
1 /******************************************************************************
2 * *
3 * parameter_pa_node.cpp *
4 * ===================== *
5 * *
6 *******************************************************************************
7 * *
8 * github repository *
9 * https://github.com/TUC-ProAut/ros_parameter *
10 * *
11 * Chair of Automation Technology, Technische Universität Chemnitz *
12 * https://www.tu-chemnitz.de/etit/proaut *
13 * *
14 *******************************************************************************
15 * *
16 * New BSD License *
17 * *
18 * Copyright (c) 2015-2018, Peter Weissig, Technische Universität Chemnitz *
19 * All rights reserved. *
20 * *
21 * Redistribution and use in source and binary forms, with or without *
22 * modification, are permitted provided that the following conditions are met: *
23 * * Redistributions of source code must retain the above copyright *
24 * notice, this list of conditions and the following disclaimer. *
25 * * Redistributions in binary form must reproduce the above copyright *
26 * notice, this list of conditions and the following disclaimer in the *
27 * documentation and/or other materials provided with the distribution. *
28 * * Neither the name of the Technische Universität Chemnitz nor the *
29 * names of its contributors may be used to endorse or promote products *
30 * derived from this software without specific prior written permission. *
31 * *
32 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" *
33 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE *
34 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE *
35 * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY *
36 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
37 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR *
38 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *
39 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *
40 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY *
41 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
42 * DAMAGE. *
43 * *
44 ******************************************************************************/
45 
46 // local headers
49 
50 // standard headers
51 #include <string>
52 #include <math.h>
53 
54 //**************************[main]*********************************************
55 int main(int argc, char **argv) {
56 
57  ros::init(argc, argv, "pcd_filter_pa_node");
58  cParameterPaNode pcd_filter;
59 
60  ros::spin();
61 
62  return 0;
63 }
64 
65 //**************************[cParameterPaNode]*********************************
67 
68  cParameterPaRos paramloader;
69  std::string str_service = paramloader.resolveRessourcename("~/");
70 
71  // service for path substitution
72  ser_path_ = nh_.advertiseService( str_service + "substitutePath",
74  // service for ressource name substitution
76  str_service + "substituteRessource",
78 }
79 
80 //**************************[~cParameterPaNode]********************************
82 
83 }
84 
85 //**************************[substitutePathCallbackSrv]*************************
87  parameter_pa::ParameterPaString::Request &req,
88  parameter_pa::ParameterPaString::Response &res) {
89 
90  std::string str = req.in_string;
92  res.out_string = str;
93 
94  return true;
95 }
96 
97 //**************************[substituteNameCallbackSrv]*************************
99  parameter_pa::ParameterPaString::Request &req,
100  parameter_pa::ParameterPaString::Response &res) {
101 
102  res.out_string = cParameterPaRos::resolveRessourcename(req.in_string);
103  res.ok = true;
104 
105  return true;
106 }
ros::ServiceServer ser_path_
service for path substitution
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
bool substitutePathCallbackSrv(parameter_pa::ParameterPaString::Request &req, parameter_pa::ParameterPaString::Response &res)
callback function for path substitution
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
static bool replaceFindpack(std::string &path)
int main(int argc, char **argv)
ros::NodeHandle nh_
node handler for topic subscription and advertising
ROSCPP_DECL void spin()
ros::ServiceServer ser_ressource_
service for ressource name substitution
static std::string resolveRessourcename(const std::string name)
cParameterPaNode()
default constructor
bool substituteNameCallbackSrv(parameter_pa::ParameterPaString::Request &req, parameter_pa::ParameterPaString::Response &res)
callback function for ressource name substitution
~cParameterPaNode()
default destructor


parameter_pa
Author(s):
autogenerated on Fri Jun 7 2019 21:42:21