SMACC2
Public Member Functions | Public Attributes | List of all members
keyboard_server_node.KeyboardPublisher Class Reference
Inheritance diagram for keyboard_server_node.KeyboardPublisher:
Inheritance graph
Collaboration diagram for keyboard_server_node.KeyboardPublisher:
Collaboration graph

Public Member Functions

def __init__ (self)
 
def timer_update (self)
 

Public Attributes

 pub
 
 timer
 
 i
 

Detailed Description

Definition at line 39 of file keyboard_server_node.py.

Constructor & Destructor Documentation

◆ __init__()

def keyboard_server_node.KeyboardPublisher.__init__ (   self)

Definition at line 40 of file keyboard_server_node.py.

40 def __init__(self):
41 super().__init__("keyboard_node")
42 self.pub = self.create_publisher(UInt16, "keyboard_unicode", 1)
43 timer_period = 0.20 # seconds
44 self.timer = self.create_timer(timer_period, self.timer_update)
45 self.i = 0
46

References keyboard_server_node.KeyboardPublisher.__init__().

Referenced by keyboard_server_node.KeyboardPublisher.__init__().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ timer_update()

def keyboard_server_node.KeyboardPublisher.timer_update (   self)

Definition at line 47 of file keyboard_server_node.py.

47 def timer_update(self):
48 try:
49 key = getKey()
50 # rospy.loginfo(type(key))
51 msg = UInt16()
52 msg.data = ord(key)
53
54 self.pub.publish(msg)
55
56 except Exception as e:
57 print(e)
58
59 finally:
60 termios.tcsetattr(sys.stdin, termios.TCSADRAIN, settings)
61
62

References keyboard_server_node.getKey(), and keyboard_server_node.KeyboardPublisher.pub.

Here is the call graph for this function:

Member Data Documentation

◆ i

keyboard_server_node.KeyboardPublisher.i

Definition at line 45 of file keyboard_server_node.py.

◆ pub

keyboard_server_node.KeyboardPublisher.pub

◆ timer

keyboard_server_node.KeyboardPublisher.timer

Definition at line 44 of file keyboard_server_node.py.


The documentation for this class was generated from the following file: