humotion / include / client / middleware_ros.h @ 8c6c1163
History | View | Annotate | Download (1.907 KB)
1 |
#pragma once
|
---|---|
2 |
#include "middleware.h" |
3 |
#ifdef ROS_SUPPORT
|
4 |
#include "ros/ros.h" |
5 |
#endif
|
6 |
#include <boost/shared_ptr.hpp> |
7 |
/*
|
8 |
* This file is part of humotion
|
9 |
*
|
10 |
* Copyright(c) sschulz <AT> techfak.uni-bielefeld.de
|
11 |
* http://opensource.cit-ec.de/projects/humotion
|
12 |
*
|
13 |
* This file may be licensed under the terms of the
|
14 |
* GNU Lesser General Public License Version 3 (the ``LGPL''),
|
15 |
* or (at your option) any later version.
|
16 |
*
|
17 |
* Software distributed under the License is distributed
|
18 |
* on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
|
19 |
* express or implied. See the LGPL for the specific language
|
20 |
* governing rights and limitations.
|
21 |
*
|
22 |
* You should have received a copy of the LGPL along with this
|
23 |
* program. If not, go to http://www.gnu.org/licenses/lgpl.html
|
24 |
* or write to the Free Software Foundation, Inc.,
|
25 |
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
26 |
*
|
27 |
* The development of this software was supported by the
|
28 |
* Excellence Cluster EXC 277 Cognitive Interaction Technology.
|
29 |
* The Excellence Cluster EXC 277 is a grant of the Deutsche
|
30 |
* Forschungsgemeinschaft (DFG) in the context of the German
|
31 |
* Excellence Initiative.
|
32 |
*/
|
33 |
|
34 |
namespace humotion{ |
35 |
namespace client{ |
36 |
|
37 |
class MiddlewareROS : public Middleware{ |
38 |
#ifndef ROS_SUPPORT
|
39 |
public:
|
40 |
MiddlewareROS(std::string name) : Middleware(name){ |
41 |
printf("> ERROR: humotion was compiled without ROS middleware support. Please use MiddlewareRSB() instead!\n\n");
|
42 |
exit(EXIT_FAILURE); |
43 |
} |
44 |
|
45 |
~MiddlewareROS(){} |
46 |
void send_mouth_target(){};
|
47 |
void send_gaze_target(){};
|
48 |
bool ok(){ return false; } |
49 |
void tick(){}
|
50 |
|
51 |
#else
|
52 |
public:
|
53 |
MiddlewareROS(std::string name); |
54 |
~MiddlewareROS(); |
55 |
|
56 |
void send_mouth_target();
|
57 |
void send_gaze_target();
|
58 |
bool ok();
|
59 |
void tick();
|
60 |
|
61 |
|
62 |
private:
|
63 |
bool tick_necessary;
|
64 |
//boost::shared_ptr<ros::NodeHandle> node_handle;
|
65 |
ros::Publisher mouth_target_publisher; |
66 |
ros::Publisher gaze_target_publisher; |
67 |
#endif
|
68 |
}; |
69 |
|
70 |
} |
71 |
} |