Skip to content

Commit 82a2f5f

Browse files
brettpacbrettpac
andauthored
Brettpac branch (#610)
* Refactor keyboard client to remove cb.cpp file * Cleaning up the comments in Keyboard Client * precommit fixes --------- Co-authored-by: brettpac <brettpac@system76-pc.localdomain>
1 parent ab36383 commit 82a2f5f

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

smacc2_client_library/keyboard_client/include/keyboard_client/cl_keyboard.hpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929

3030
namespace cl_keyboard
3131
{
32-
//------------------ KEYBOARD CLIENT ---------------------------------------------
33-
3432
class ClKeyboard : public smacc2::ISmaccClient
3533
{
3634
public:
@@ -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
};

smacc2_client_library/keyboard_client/include/keyboard_client/components/cp_keyboard_listener_1.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ struct EvKeyPressZ : sc::event<EvKeyPressZ<TSource, TOrthogonal>>
157157
{
158158
};
159159

160-
//------------------ KEYBOARD CLIENT ---------------------------------------------
160+
//------------------ KEYBOARD LISTENER COMPONENT ---------------------------------------------
161161

162162
class CpKeyboardListener1 : public smacc2::ISmaccComponent
163163
{

smacc2_client_library/keyboard_client/src/keyboard_client/cl_keyboard.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323
namespace cl_keyboard
2424
{
25+
// Declare the Client's default constructor.
2526
ClKeyboard::ClKeyboard() {}
26-
27+
// Declare the Client's default destructor.
2728
ClKeyboard::~ClKeyboard() {}
28-
2929
} // namespace cl_keyboard

0 commit comments

Comments
 (0)