2929
3030namespace cl_keyboard
3131{
32- // ------------------ KEYBOARD CLIENT ---------------------------------------------
33-
3432class ClKeyboard : public smacc2 ::ISmaccClient
3533{
3634public:
@@ -40,19 +38,20 @@ class ClKeyboard : public smacc2::ISmaccClient
4038 // Override the base class methods to call our setup
4139 template <typename TOrthogonal, typename TClient>
4240 void onComponentInitialization ()
43- // clients utilizes a composition based architecture for their components
44- // here we define the list of components that this client will have in a component based architecture
41+
42+ // Clients utilize a composition based architecture for their components.
43+ // In the function body below we create the components that will be used in this client.
44+
4545 {
46- // for listener we use dependency injection pattern where we reference the CpTopicSubscriber inside the smacc core
47- // this would be the basic subscription component to the topic
48- // we use this to gain the topic funcionality interated with SMACC and that post smacc events for transitions
49- // we are using it to handle ros topic messages reception and notifying other components in the client
46+ // We start by creating a topic subscriber component from SMACC2s client core components.
47+ // We use this to gain the topic funcionality interated with SMACC and the ability to post smacc events for transitions.
48+ // We are using it to handle the reception of ros topic messages and to notify the other components in the client.
5049 this ->createComponent <
5150 smacc2::client_core_components::CpTopicSubscriber<std_msgs::msg::UInt16>, TOrthogonal,
5251 ClKeyboard>(" /keyboard_unicode" );
5352
54- // this keyboard subscriber component requires the first subscriber component
55- // it is notified by the CpTopicSubscriber and processes the messages to decide with keyboard event must be posted and then post it
53+ // This keyboard listener component requires the first subscriber component.
54+ // It is notified by the CpTopicSubscriber and processes the messages to decide which keyboard event must be posted and then posts it.
5655 this ->createComponent <cl_keyboard::components::CpKeyboardListener1, TOrthogonal, ClKeyboard>();
5756 }
5857};
0 commit comments