hlrc / server / include / MiddlewareROS.h @ 8192a820
History | View | Annotate | Download (3.188 KB)
1 |
/*
|
---|---|
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 |
#include <actionlib/client/simple_action_client.h> |
34 |
|
35 |
//messages
|
36 |
#include "hlrc_server/phoneme.h" |
37 |
#include "hlrc_server/soundchunk.h" |
38 |
#include "hlrc_server/utterance.h" |
39 |
//actions
|
40 |
#include "hlrc_server/gazetargetAction.h" |
41 |
#include "hlrc_server/ttsAction.h" |
42 |
|
43 |
#include "ROS/GazeCallbackWrapperROS.h" |
44 |
#include "ROS/MouthCallbackWrapperROS.h" |
45 |
#include "ROS/UtteranceCallbackWrapperROS.h" |
46 |
#include "ROS/EmotionCallbackWrapperROS.h" |
47 |
#include "ROS/AnimationCallbackWrapperROS.h" |
48 |
#include "ROS/SpeechCallbackWrapperROS.h" |
49 |
#endif
|
50 |
#include <boost/shared_ptr.hpp> |
51 |
|
52 |
#define ROS_ACTION_CALL_TIMEOUT 30.0 |
53 |
|
54 |
class MiddlewareROS : public Middleware{ |
55 |
#ifndef ROS_SUPPORT
|
56 |
public:
|
57 |
MiddlewareROS(Arbiter *a, std::string _base_scope) : Middleware(a, _base_scope){ |
58 |
printf("> ERROR: hlrc was compiled without ROS middleware support. Please use MiddlewareRSB() instead!\n\n");
|
59 |
exit(EXIT_FAILURE); |
60 |
} |
61 |
|
62 |
~MiddlewareROS(){} |
63 |
void init(){};
|
64 |
void tick(){};
|
65 |
|
66 |
boost::shared_ptr<Utterance> tts_call(std::string text){ |
67 |
return boost::shared_ptr<Utterance>(new Utterance());
|
68 |
} |
69 |
|
70 |
#else
|
71 |
public:
|
72 |
MiddlewareROS(Arbiter *a, std::string _base_scope); |
73 |
~MiddlewareROS(); |
74 |
void init();
|
75 |
void tick();
|
76 |
boost::shared_ptr<Utterance> tts_call(std::string text); |
77 |
|
78 |
private:
|
79 |
//boost::shared_ptr<ros::NodeHandle> node_handle;
|
80 |
ros::NodeHandle *ros_node_handle; |
81 |
bool tick_necessary;
|
82 |
/*ros::ServiceServer animation_service;
|
83 |
ros::ServiceServer utterance_service;
|
84 |
ros::ServiceServer default_emotion_service;
|
85 |
ros::ServiceServer current_emotion_service;
|
86 |
ros::ServiceServer gaze_service;
|
87 |
ros::ServiceServer tts_service;*/
|
88 |
AnimationCallbackWrapper *animation_action_server; |
89 |
UtteranceCallbackWrapper *utterance_action_server; |
90 |
EmotionCallbackWrapper *current_emotion_action_server; |
91 |
EmotionCallbackWrapper *default_emotion_action_server; |
92 |
GazeCallbackWrapper *gaze_action_server; |
93 |
MouthCallbackWrapper *mouth_action_server; |
94 |
SpeechCallbackWrapper *speech_action_server; |
95 |
actionlib::SimpleActionClient<hlrc_server::ttsAction> *tts_ac; |
96 |
#endif
|
97 |
}; |
98 |
|
99 |
|
100 |
|
101 |
|