6#include <boost/asio/posix/stream_descriptor.hpp>
7#include <boost/asio.hpp>
11#include <std_msgs/UInt16.h>
16template <
typename TSource,
typename TOrthogonal>
21template <
typename TSource,
typename TOrthogonal>
26template <
typename TSource,
typename TOrthogonal>
31template <
typename TSource,
typename TOrthogonal>
36template <
typename TSource,
typename TOrthogonal>
41template <
typename TSource,
typename TOrthogonal>
46template <
typename TSource,
typename TOrthogonal>
51template <
typename TSource,
typename TOrthogonal>
56template <
typename TSource,
typename TOrthogonal>
61template <
typename TSource,
typename TOrthogonal>
66template <
typename TSource,
typename TOrthogonal>
71template <
typename TSource,
typename TOrthogonal>
76template <
typename TSource,
typename TOrthogonal>
81template <
typename TSource,
typename TOrthogonal>
86template <
typename TSource,
typename TOrthogonal>
91template <
typename TSource,
typename TOrthogonal>
96template <
typename TSource,
typename TOrthogonal>
101template <
typename TSource,
typename TOrthogonal>
106template <
typename TSource,
typename TOrthogonal>
111template <
typename TSource,
typename TOrthogonal>
116template <
typename TSource,
typename TOrthogonal>
121template <
typename TSource,
typename TOrthogonal>
126template <
typename TSource,
typename TOrthogonal>
131template <
typename TSource,
typename TOrthogonal>
136template <
typename TSource,
typename TOrthogonal>
141template <
typename TSource,
typename TOrthogonal>
153 template <
typename T>
154 void OnKeyPress(
void (T::*callback)(
char keypress), T *
object)
168 template <
typename TOrthogonal,
typename TSourceObject>
175 char character = (char)unicode_keychar.data;
176 ROS_WARN(
"detected keyboard: %c", character);
178 if (character ==
'a')
179 this->postKeyEvent<EvKeyPressA<ClKeyboard, TOrthogonal>>();
180 else if (character ==
'b')
181 this->postKeyEvent<EvKeyPressB<ClKeyboard, TOrthogonal>>();
182 else if (character ==
'c')
183 this->postKeyEvent<EvKeyPressC<ClKeyboard, TOrthogonal>>();
184 else if (character ==
'd')
185 this->postKeyEvent<EvKeyPressD<ClKeyboard, TOrthogonal>>();
186 else if (character ==
'e')
187 this->postKeyEvent<EvKeyPressE<ClKeyboard, TOrthogonal>>();
188 else if (character ==
'f')
189 this->postKeyEvent<EvKeyPressF<ClKeyboard, TOrthogonal>>();
190 else if (character ==
'g')
191 this->postKeyEvent<EvKeyPressG<ClKeyboard, TOrthogonal>>();
192 else if (character ==
'h')
193 this->postKeyEvent<EvKeyPressH<ClKeyboard, TOrthogonal>>();
194 else if (character ==
'y')
195 this->postKeyEvent<EvKeyPressI<ClKeyboard, TOrthogonal>>();
196 else if (character ==
'j')
197 this->postKeyEvent<EvKeyPressJ<ClKeyboard, TOrthogonal>>();
198 else if (character ==
'k')
199 this->postKeyEvent<EvKeyPressK<ClKeyboard, TOrthogonal>>();
200 else if (character ==
'l')
201 this->postKeyEvent<EvKeyPressL<ClKeyboard, TOrthogonal>>();
202 else if (character ==
'm')
203 this->postKeyEvent<EvKeyPressM<ClKeyboard, TOrthogonal>>();
204 else if (character ==
'n')
205 this->postKeyEvent<EvKeyPressN<ClKeyboard, TOrthogonal>>();
206 else if (character ==
'o')
207 this->postKeyEvent<EvKeyPressO<ClKeyboard, TOrthogonal>>();
208 else if (character ==
'p')
209 this->postKeyEvent<EvKeyPressP<ClKeyboard, TOrthogonal>>();
210 else if (character ==
'q')
211 this->postKeyEvent<EvKeyPressQ<ClKeyboard, TOrthogonal>>();
212 else if (character ==
'r')
213 this->postKeyEvent<EvKeyPressR<ClKeyboard, TOrthogonal>>();
214 else if (character ==
's')
215 this->postKeyEvent<EvKeyPressS<ClKeyboard, TOrthogonal>>();
216 else if (character ==
't')
217 this->postKeyEvent<EvKeyPressT<ClKeyboard, TOrthogonal>>();
218 else if (character ==
'u')
219 this->postKeyEvent<EvKeyPressU<ClKeyboard, TOrthogonal>>();
220 else if (character ==
'v')
221 this->postKeyEvent<EvKeyPressV<ClKeyboard, TOrthogonal>>();
222 else if (character ==
'w')
223 this->postKeyEvent<EvKeyPressW<ClKeyboard, TOrthogonal>>();
224 else if (character ==
'x')
225 this->postKeyEvent<EvKeyPressX<ClKeyboard, TOrthogonal>>();
226 else if (character ==
'y')
227 this->postKeyEvent<EvKeyPressY<ClKeyboard, TOrthogonal>>();
228 else if (character ==
'z')
229 this->postKeyEvent<EvKeyPressZ<ClKeyboard, TOrthogonal>>();
236 template <
typename TEv>
240 this->postEvent<TEv>();
void onOrthogonalAllocation()
smacc::SmaccSignal< void(char keypress)> OnKeyPress_
std::function< void(std_msgs::UInt16)> postEventKeyPress
void OnKeyPress(void(T::*callback)(char keypress), T *object)
virtual void initialize() override
void onKeyboardMessage(const std_msgs::UInt16 &unicode_keychar)
ISmaccStateMachine * getStateMachine()
boost::signals2::connection createSignalConnection(TSmaccSignal &signal, TMemberFunctionPrototype callback, TSmaccObjectType *object)
std::string demangleSymbol()