Revision 2cf3c285 server/src/MiddlewareROS.cpp
server/src/MiddlewareROS.cpp | ||
---|---|---|
72 | 72 |
printf("> registering on ROS as node %s\n",node_name.c_str()); |
73 | 73 |
if (ros::isInitialized()){ |
74 | 74 |
//ros is already active, no need to take care of that |
75 |
//FIXME: Instead of deciding based on ros::isInitialized() to tick or not, |
|
76 |
//we shoud use our own MessageQueue and AsyncSpinner. |
|
75 | 77 |
tick_necessary = false; |
76 | 78 |
}else{ |
77 | 79 |
printf("> ROS not initialized, calling ros::init()\n"); |
... | ... | |
86 | 88 |
ros::NodeHandle n; |
87 | 89 |
|
88 | 90 |
printf("> setting up ROS services...\n"); |
89 |
//FIXME//init_callback("speech", LocalServer::CallbackPtr(new SpeechCallbackWrapper(this))); |
|
90 |
|
|
91 | 91 |
//ros::AsyncSpinner *spinner = new ros::AsyncSpinner(4); // Use 4 threads |
92 | 92 |
//spinner->start(); |
93 | 93 |
|
94 |
tfListener.reset(new tf2_ros::TransformListener(tfBuffer)); |
|
95 |
tfBuffer.clear(); |
|
96 |
|
|
94 | 97 |
animation_action_server = new AnimationCallbackWrapper(this, scope, "animation"); |
95 | 98 |
utterance_action_server = new UtteranceCallbackWrapper(this, scope, "utterance"); |
96 | 99 |
current_emotion_action_server = new EmotionCallbackWrapper(this, scope, "currentEmotion"); |
97 | 100 |
default_emotion_action_server = new EmotionCallbackWrapper(this, scope, "defaultEmotion"); |
98 | 101 |
gaze_action_server = new GazeCallbackWrapper(this, scope, "gaze"); |
99 |
lookat_action_server = new LookatCallbackWrapper(this, scope, "lookat"); |
|
102 |
lookat_action_server = new LookatCallbackWrapper(this, scope, "lookat", tfBuffer);
|
|
100 | 103 |
mouth_action_server = new MouthCallbackWrapper(this, scope, "mouth"); |
101 | 104 |
speech_action_server = new SpeechCallbackWrapper(this, scope, "speech"); |
102 | 105 |
|
... | ... | |
106 | 109 |
printf("> tts action service not available, will not do any TTS !\n"); |
107 | 110 |
} |
108 | 111 |
|
109 |
|
|
110 |
|
|
111 | 112 |
printf("> init done\n"); |
112 | 113 |
} |
113 | 114 |
|
Also available in: Unified diff