21#include <boost/asio.hpp>
22#include <boost/asio/posix/stream_descriptor.hpp>
25#include <std_msgs/msg/u_int16.hpp>
30template <
typename TSource,
typename TOrthogonal>
35template <
typename TSource,
typename TOrthogonal>
40template <
typename TSource,
typename TOrthogonal>
45template <
typename TSource,
typename TOrthogonal>
50template <
typename TSource,
typename TOrthogonal>
55template <
typename TSource,
typename TOrthogonal>
60template <
typename TSource,
typename TOrthogonal>
65template <
typename TSource,
typename TOrthogonal>
70template <
typename TSource,
typename TOrthogonal>
75template <
typename TSource,
typename TOrthogonal>
80template <
typename TSource,
typename TOrthogonal>
85template <
typename TSource,
typename TOrthogonal>
90template <
typename TSource,
typename TOrthogonal>
95template <
typename TSource,
typename TOrthogonal>
100template <
typename TSource,
typename TOrthogonal>
105template <
typename TSource,
typename TOrthogonal>
110template <
typename TSource,
typename TOrthogonal>
115template <
typename TSource,
typename TOrthogonal>
120template <
typename TSource,
typename TOrthogonal>
125template <
typename TSource,
typename TOrthogonal>
130template <
typename TSource,
typename TOrthogonal>
135template <
typename TSource,
typename TOrthogonal>
140template <
typename TSource,
typename TOrthogonal>
145template <
typename TSource,
typename TOrthogonal>
150template <
typename TSource,
typename TOrthogonal>
155template <
typename TSource,
typename TOrthogonal>
171 template <
typename T>
180 template <
typename TOrthogonal,
typename TSourceObject>
185 TOrthogonal, TSourceObject>();
188 char character = (char)unicode_keychar.data;
189 RCLCPP_WARN(
getLogger(),
"detected keyboard: %c", character);
191 if (character ==
'a')
192 this->postKeyEvent<EvKeyPressA<ClKeyboard, TOrthogonal>>();
193 else if (character ==
'b')
194 this->postKeyEvent<EvKeyPressB<ClKeyboard, TOrthogonal>>();
195 else if (character ==
'c')
196 this->postKeyEvent<EvKeyPressC<ClKeyboard, TOrthogonal>>();
197 else if (character ==
'd')
198 this->postKeyEvent<EvKeyPressD<ClKeyboard, TOrthogonal>>();
199 else if (character ==
'e')
200 this->postKeyEvent<EvKeyPressE<ClKeyboard, TOrthogonal>>();
201 else if (character ==
'f')
202 this->postKeyEvent<EvKeyPressF<ClKeyboard, TOrthogonal>>();
203 else if (character ==
'g')
204 this->postKeyEvent<EvKeyPressG<ClKeyboard, TOrthogonal>>();
205 else if (character ==
'h')
206 this->postKeyEvent<EvKeyPressH<ClKeyboard, TOrthogonal>>();
207 else if (character ==
'y')
208 this->postKeyEvent<EvKeyPressI<ClKeyboard, TOrthogonal>>();
209 else if (character ==
'j')
210 this->postKeyEvent<EvKeyPressJ<ClKeyboard, TOrthogonal>>();
211 else if (character ==
'k')
212 this->postKeyEvent<EvKeyPressK<ClKeyboard, TOrthogonal>>();
213 else if (character ==
'l')
214 this->postKeyEvent<EvKeyPressL<ClKeyboard, TOrthogonal>>();
215 else if (character ==
'm')
216 this->postKeyEvent<EvKeyPressM<ClKeyboard, TOrthogonal>>();
217 else if (character ==
'n')
218 this->postKeyEvent<EvKeyPressN<ClKeyboard, TOrthogonal>>();
219 else if (character ==
'o')
220 this->postKeyEvent<EvKeyPressO<ClKeyboard, TOrthogonal>>();
221 else if (character ==
'p')
222 this->postKeyEvent<EvKeyPressP<ClKeyboard, TOrthogonal>>();
223 else if (character ==
'q')
224 this->postKeyEvent<EvKeyPressQ<ClKeyboard, TOrthogonal>>();
225 else if (character ==
'r')
226 this->postKeyEvent<EvKeyPressR<ClKeyboard, TOrthogonal>>();
227 else if (character ==
's')
228 this->postKeyEvent<EvKeyPressS<ClKeyboard, TOrthogonal>>();
229 else if (character ==
't')
230 this->postKeyEvent<EvKeyPressT<ClKeyboard, TOrthogonal>>();
231 else if (character ==
'u')
232 this->postKeyEvent<EvKeyPressU<ClKeyboard, TOrthogonal>>();
233 else if (character ==
'v')
234 this->postKeyEvent<EvKeyPressV<ClKeyboard, TOrthogonal>>();
235 else if (character ==
'w')
236 this->postKeyEvent<EvKeyPressW<ClKeyboard, TOrthogonal>>();
237 else if (character ==
'x')
238 this->postKeyEvent<EvKeyPressX<ClKeyboard, TOrthogonal>>();
239 else if (character ==
'y')
240 this->postKeyEvent<EvKeyPressY<ClKeyboard, TOrthogonal>>();
241 else if (character ==
'z')
242 this->postKeyEvent<EvKeyPressZ<ClKeyboard, TOrthogonal>>();
249 template <
typename TEv>
254 this->postEvent<TEv>();
std::function< void(std_msgs::msg::UInt16)> postEventKeyPress
smacc2::SmaccSignal< void(char keypress)> OnKeyPress_
void onOrthogonalAllocation()
void onKeyboardMessage(const std_msgs::msg::UInt16 &unicode_keychar)
virtual void onInitialize() override
void OnKeyPress(void(T::*callback)(char keypress), T *object)
ISmaccStateMachine * getStateMachine()
rclcpp::Logger getLogger()
boost::signals2::connection createSignalConnection(TSmaccSignal &signal, TMemberFunctionPrototype callback, TSmaccObjectType *object)
std::string demangleSymbol(const std::string &name)
void callback(const image_tools::ROSCvMatContainer &img)