hlrc / server / include / MiddlewareROS.h @ aa50d3e9
History | View | Annotate | Download (2.885 KB)
1 | 0c286af0 | Simon Schulz | /*
|
---|---|---|---|
2 | * This file is part of hlrc_server
|
||
3 | *
|
||
4 | * Copyright(c) sschulz <AT> techfak.uni-bielefeld.de
|
||
5 | * http://opensource.cit-ec.de/projects/hlrc_server
|
||
6 | *
|
||
7 | * This file may be licensed under the terms of the
|
||
8 | * GNU General Public License Version 3 (the ``GPL''),
|
||
9 | * or (at your option) any later version.
|
||
10 | *
|
||
11 | * Software distributed under the License is distributed
|
||
12 | * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
|
||
13 | * express or implied. See the GPL for the specific language
|
||
14 | * governing rights and limitations.
|
||
15 | *
|
||
16 | * You should have received a copy of the GPL along with this
|
||
17 | * program. If not, go to http://www.gnu.org/licenses/gpl.html
|
||
18 | * or write to the Free Software Foundation, Inc.,
|
||
19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
20 | *
|
||
21 | * The development of this software was supported by the
|
||
22 | * Excellence Cluster EXC 277 Cognitive Interaction Technology.
|
||
23 | * The Excellence Cluster EXC 277 is a grant of the Deutsche
|
||
24 | * Forschungsgemeinschaft (DFG) in the context of the German
|
||
25 | * Excellence Initiative.
|
||
26 | *
|
||
27 | */
|
||
28 | |||
29 | #pragma once
|
||
30 | #include "Middleware.h" |
||
31 | #ifdef ROS_SUPPORT
|
||
32 | #include "ros/ros.h" |
||
33 | //messages
|
||
34 | #include "hlrc_server/phoneme.h" |
||
35 | #include "hlrc_server/soundchunk.h" |
||
36 | //actions
|
||
37 | #include "hlrc_server/gazetargetAction.h" |
||
38 | |||
39 | #include "ROS/GazeCallbackWrapperROS.h" |
||
40 | #include "ROS/MouthCallbackWrapperROS.h" |
||
41 | #include "ROS/UtteranceCallbackWrapperROS.h" |
||
42 | #include "ROS/EmotionCallbackWrapperROS.h" |
||
43 | #include "ROS/AnimationCallbackWrapperROS.h" |
||
44 | #include "ROS/SpeechCallbackWrapperROS.h" |
||
45 | #endif
|
||
46 | #include <boost/shared_ptr.hpp> |
||
47 | |||
48 | |||
49 | class MiddlewareROS : public Middleware{ |
||
50 | #ifndef ROS_SUPPORT
|
||
51 | public:
|
||
52 | MiddlewareROS(Arbiter *a, std::string _base_scope) : Middleware(a, _base_scope){ |
||
53 | printf("> ERROR: hlrc was compiled without ROS middleware support. Please use MiddlewareRSB() instead!\n\n");
|
||
54 | exit(EXIT_FAILURE); |
||
55 | } |
||
56 | |||
57 | ~MiddlewareROS(){} |
||
58 | void init(){};
|
||
59 | void tick(){};
|
||
60 | |||
61 | Utterance tts_call(std::string text){ |
||
62 | return Utterance();
|
||
63 | } |
||
64 | |||
65 | #else
|
||
66 | public:
|
||
67 | MiddlewareROS(Arbiter *a, std::string _base_scope); |
||
68 | ~MiddlewareROS(); |
||
69 | void init();
|
||
70 | void tick();
|
||
71 | Utterance tts_call(std::string text); |
||
72 | |||
73 | private:
|
||
74 | //boost::shared_ptr<ros::NodeHandle> node_handle;
|
||
75 | ros::NodeHandle *ros_node_handle; |
||
76 | bool tick_necessary;
|
||
77 | /*ros::ServiceServer animation_service;
|
||
78 | ros::ServiceServer utterance_service;
|
||
79 | ros::ServiceServer default_emotion_service;
|
||
80 | ros::ServiceServer current_emotion_service;
|
||
81 | ros::ServiceServer gaze_service;
|
||
82 | ros::ServiceServer tts_service;*/
|
||
83 | AnimationCallbackWrapper *animation_action_server; |
||
84 | UtteranceCallbackWrapper *utterance_action_server; |
||
85 | EmotionCallbackWrapper *current_emotion_action_server; |
||
86 | EmotionCallbackWrapper *default_emotion_action_server; |
||
87 | GazeCallbackWrapper *gaze_action_server; |
||
88 | MouthCallbackWrapper *mouth_action_server; |
||
89 | SpeechCallbackWrapper *speech_action_server; |
||
90 | #endif
|
||
91 | }; |
||
92 | |||
93 | |||
94 |