helper.py
Go to the documentation of this file.
1 # A file with helper variables and classes
2 
3 terminal_text = ""
4 controllers = []
5 curr_controller = None
6 saved_axi = -1
7 saved_buti = -1
8 
9 read_joy = False
10 keepItUp = True
11 
12 config_file_location = ""
13 
14 twisty_dict = {
15  "0": "linear.x",
16  "1": "linear.y",
17  "2": "linear.z",
18  "3": "angular.x",
19  "4": "angular.y",
20  "5": "angular.z"
21  }
22 
23 jt_dict = {
24  "0": "position",
25  "1": "velocity",
26  "2": "acceleration",
27  "3": "effort"
28  }
29 
30 # Expected user input
31 YES = ["YES", "yes", "Y", "y"]
32 NO = ["NO", "no", "N", "n"]
33 QUIT = ["QUIT", "quit", "Q", "q"]
34 SAVE = ["SAVE", "save", "S", "s"]
35 
36 class JoyAction():
37  button = -1
38  axis = -1
39  value = 0
40  joint = ""
41  msg_field = ""
42 
43  def __init__(self, b, a, v, j, mf):
44  self.button = b
45  self.axis = a
46  self.value = v
47  self.joint = j
48  self.msg_field = mf
49 
50  def __repr__(self):
51  return "\nButton: {},\nAxis: {},\nValue: {},\nJoint: {},\nMessage Field: {}\n".format(self.button, self.axis, self.value, self.joint, self.msg_field)
52 
53 class Controller():
54  name = ""
55  type = ""
56  joints = []
57  joyActions = []
58  topic = ""
59 
60  def __init__(self, n, t, ja, j, tt):
61  self.name = n
62  self.type = t
63  self.joyActions = ja
64  self.joints = j
65  self.topic = tt
66 
67  def __repr__(self):
68  return "\nName: {},\nType: {},\nActions: {},\nJoints: {},\nTopic: {}\n".format(self.name, self.type, self.joyActions, self.joints, self.topic)
def __repr__(self)
Definition: helper.py:50
string msg_field
Definition: helper.py:41
string name
Definition: helper.py:54
def __init__(self, b, a, v, j, mf)
Definition: helper.py:43
list joyActions
Definition: helper.py:57
def __init__(self, n, t, ja, j, tt)
Definition: helper.py:60
string type
Definition: helper.py:55
string joint
Definition: helper.py:40
def __repr__(self)
Definition: helper.py:67
string topic
Definition: helper.py:58


jointstick
Author(s): George Stavrinos
autogenerated on Mon Jun 10 2019 13:38:17