src
jsk_teleop_joy
b_control_status.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
3
import
rospy
4
import
roslib
5
6
7
class
BControl2Status
():
8
def
__init__
(self, msg):
9
if
msg.axes[8] == 1.0:
10
self.
buttonU1
=
True
11
else
:
12
self.
buttonU1
=
False
13
if
msg.axes[9] == 1.0:
14
self.
buttonU2
=
True
15
else
:
16
self.
buttonU2
=
False
17
if
msg.axes[10] == 1.0:
18
self.
buttonU3
=
True
19
else
:
20
self.
buttonU3
=
False
21
if
msg.axes[11] == 1:
22
self.
buttonU4
=
True
23
else
:
24
self.
buttonU4
=
False
25
if
msg.axes[12] == 1.0:
26
self.
buttonU5
=
True
27
else
:
28
self.
buttonU5
=
False
29
if
msg.axes[13] == 1.0:
30
self.
buttonU6
=
True
31
else
:
32
self.
buttonU6
=
False
33
if
msg.axes[14] == 1.0:
34
self.
buttonU7
=
True
35
else
:
36
self.
buttonU7
=
False
37
if
msg.axes[15] == 1.0:
38
self.
buttonU8
=
True
39
else
:
40
self.
buttonU8
=
False
41
42
if
msg.axes[16] == 1.0:
43
self.
buttonL1
=
True
44
else
:
45
self.
buttonL1
=
False
46
if
msg.axes[17] == 1.0:
47
self.
buttonL2
=
True
48
else
:
49
self.
buttonL2
=
False
50
if
msg.axes[18] == 1.0:
51
self.
buttonL3
=
True
52
else
:
53
self.
buttonL3
=
False
54
if
msg.axes[19] == 1.0:
55
self.
buttonL4
=
True
56
else
:
57
self.
buttonL4
=
False
58
if
msg.axes[20] == 1.0:
59
self.
buttonL5
=
True
60
else
:
61
self.
buttonL5
=
False
62
if
msg.axes[21] == 1.0:
63
self.
buttonL6
=
True
64
else
:
65
self.
buttonL6
=
False
66
if
msg.axes[22] == 1.0:
67
self.
buttonL7
=
True
68
else
:
69
self.
buttonL7
=
False
70
if
msg.axes[23] == 1.0:
71
self.
buttonL8
=
True
72
else
:
73
self.
buttonL8
=
False
74
75
self.
slide1
= msg.axes[24]
76
self.
slide2
= msg.axes[25]
77
self.
slide3
= msg.axes[26]
78
self.
slide4
= msg.axes[27]
79
self.
slide5
= msg.axes[28]
80
self.
slide6
= msg.axes[29]
81
self.
slide7
= msg.axes[30]
82
self.
slide8
= msg.axes[31]
83
84
self.
rotate1_1
= msg.axes[0]
85
self.
rotate1_2
= msg.axes[1]
86
self.
rotate1_3
= msg.axes[2]
87
self.
rotate1_4
= msg.axes[3]
88
self.
rotate1_5
= msg.axes[4]
89
self.
rotate1_6
= msg.axes[5]
90
self.
rotate1_7
= msg.axes[6]
91
self.
rotate1_8
= msg.axes[7]
92
93
self.
rotate2_1
= msg.axes[32]
94
self.
rotate2_2
= msg.axes[33]
95
self.
rotate2_3
= msg.axes[34]
96
self.
rotate2_4
= msg.axes[35]
97
self.
rotate2_5
= msg.axes[36]
98
self.
rotate2_6
= msg.axes[37]
99
self.
rotate2_7
= msg.axes[38]
100
self.
rotate2_8
= msg.axes[39]
101
102
self.
rotate3_1
= msg.axes[40]
103
self.
rotate3_2
= msg.axes[41]
104
self.
rotate3_3
= msg.axes[42]
105
self.
rotate3_4
= msg.axes[43]
106
self.
rotate3_5
= msg.axes[44]
107
self.
rotate3_6
= msg.axes[45]
108
self.
rotate3_7
= msg.axes[46]
109
self.
rotate3_8
= msg.axes[47]
110
111
self.
rotate4_1
= msg.axes[48]
112
self.
rotate4_2
= msg.axes[49]
113
self.
rotate4_3
= msg.axes[50]
114
self.
rotate4_4
= msg.axes[51]
115
self.
rotate4_5
= msg.axes[52]
116
self.
rotate4_6
= msg.axes[53]
117
self.
rotate4_7
= msg.axes[54]
118
self.
rotate4_8
= msg.axes[55]
119
120
121
import
pprint
122
123
def
joyCB
(msg):
124
status =
BControl2Status
(msg)
125
pprint.PrettyPrinter().pprint(status.__dict__)
126
127
128
def
main
():
129
import
roslib
130
import
rospy
131
from
sensor_msgs.msg
import
Joy
132
133
rospy.sleep(1)
134
rospy.init_node(
'b_control_controller'
)
135
s = rospy.Subscriber(
'/b_control/joy'
, Joy, joyCB)
136
137
rospy.spin()
138
139
if
__name__ ==
'__main__'
:
140
main
()
jsk_teleop_joy.b_control_status.BControl2Status.rotate2_7
rotate2_7
Definition:
b_control_status.py:99
jsk_teleop_joy.b_control_status.BControl2Status.buttonL4
buttonL4
Definition:
b_control_status.py:55
jsk_teleop_joy.b_control_status.BControl2Status.rotate3_6
rotate3_6
Definition:
b_control_status.py:107
jsk_teleop_joy.b_control_status.BControl2Status.slide2
slide2
Definition:
b_control_status.py:76
jsk_teleop_joy.b_control_status.BControl2Status.rotate1_1
rotate1_1
Definition:
b_control_status.py:84
jsk_teleop_joy.b_control_status.main
def main()
Definition:
b_control_status.py:128
jsk_teleop_joy.b_control_status.BControl2Status.rotate3_2
rotate3_2
Definition:
b_control_status.py:103
jsk_teleop_joy.b_control_status.BControl2Status.buttonL5
buttonL5
Definition:
b_control_status.py:59
jsk_teleop_joy.b_control_status.BControl2Status.rotate4_4
rotate4_4
Definition:
b_control_status.py:114
jsk_teleop_joy.b_control_status.BControl2Status.rotate1_8
rotate1_8
Definition:
b_control_status.py:91
jsk_teleop_joy.b_control_status.BControl2Status.buttonU7
buttonU7
Definition:
b_control_status.py:34
jsk_teleop_joy.b_control_status.BControl2Status.rotate1_4
rotate1_4
Definition:
b_control_status.py:87
jsk_teleop_joy.b_control_status.BControl2Status.buttonU4
buttonU4
Definition:
b_control_status.py:22
jsk_teleop_joy.b_control_status.BControl2Status.rotate2_4
rotate2_4
Definition:
b_control_status.py:96
jsk_teleop_joy.b_control_status.BControl2Status.rotate1_5
rotate1_5
Definition:
b_control_status.py:88
jsk_teleop_joy.b_control_status.BControl2Status.buttonL7
buttonL7
Definition:
b_control_status.py:67
jsk_teleop_joy.b_control_status.BControl2Status.rotate4_1
rotate4_1
Definition:
b_control_status.py:111
jsk_teleop_joy.b_control_status.BControl2Status.buttonU1
buttonU1
Definition:
b_control_status.py:10
jsk_teleop_joy.b_control_status.BControl2Status.__init__
def __init__(self, msg)
Definition:
b_control_status.py:8
msg
jsk_teleop_joy.b_control_status.BControl2Status.rotate2_5
rotate2_5
Definition:
b_control_status.py:97
jsk_teleop_joy.b_control_status.BControl2Status.rotate2_1
rotate2_1
Definition:
b_control_status.py:93
jsk_teleop_joy.b_control_status.BControl2Status.rotate1_2
rotate1_2
Definition:
b_control_status.py:85
jsk_teleop_joy.b_control_status.BControl2Status.rotate4_2
rotate4_2
Definition:
b_control_status.py:112
jsk_teleop_joy.b_control_status.BControl2Status.rotate4_6
rotate4_6
Definition:
b_control_status.py:116
jsk_teleop_joy.b_control_status.BControl2Status.buttonL6
buttonL6
Definition:
b_control_status.py:63
jsk_teleop_joy.b_control_status.BControl2Status.rotate1_6
rotate1_6
Definition:
b_control_status.py:89
jsk_teleop_joy.b_control_status.BControl2Status.slide6
slide6
Definition:
b_control_status.py:80
jsk_teleop_joy.b_control_status.BControl2Status.buttonU5
buttonU5
Definition:
b_control_status.py:26
jsk_teleop_joy.b_control_status.BControl2Status.rotate4_5
rotate4_5
Definition:
b_control_status.py:115
jsk_teleop_joy.b_control_status.BControl2Status.rotate3_7
rotate3_7
Definition:
b_control_status.py:108
jsk_teleop_joy.b_control_status.joyCB
def joyCB(msg)
Definition:
b_control_status.py:123
jsk_teleop_joy.b_control_status.BControl2Status.buttonL8
buttonL8
Definition:
b_control_status.py:71
jsk_teleop_joy.b_control_status.BControl2Status.rotate3_3
rotate3_3
Definition:
b_control_status.py:104
jsk_teleop_joy.b_control_status.BControl2Status.slide4
slide4
Definition:
b_control_status.py:78
jsk_teleop_joy.b_control_status.BControl2Status.buttonL2
buttonL2
Definition:
b_control_status.py:47
jsk_teleop_joy.b_control_status.BControl2Status.rotate4_3
rotate4_3
Definition:
b_control_status.py:113
jsk_teleop_joy.b_control_status.BControl2Status.rotate1_3
rotate1_3
Definition:
b_control_status.py:86
jsk_teleop_joy.b_control_status.BControl2Status.buttonL3
buttonL3
Definition:
b_control_status.py:51
jsk_teleop_joy.b_control_status.BControl2Status.rotate3_4
rotate3_4
Definition:
b_control_status.py:105
jsk_teleop_joy.b_control_status.BControl2Status
Definition:
b_control_status.py:7
jsk_teleop_joy.b_control_status.BControl2Status.rotate2_8
rotate2_8
Definition:
b_control_status.py:100
jsk_teleop_joy.b_control_status.BControl2Status.slide3
slide3
Definition:
b_control_status.py:77
jsk_teleop_joy.b_control_status.BControl2Status.rotate2_3
rotate2_3
Definition:
b_control_status.py:95
jsk_teleop_joy.b_control_status.BControl2Status.rotate3_5
rotate3_5
Definition:
b_control_status.py:106
jsk_teleop_joy.b_control_status.BControl2Status.rotate3_8
rotate3_8
Definition:
b_control_status.py:109
jsk_teleop_joy.b_control_status.BControl2Status.slide8
slide8
Definition:
b_control_status.py:82
jsk_teleop_joy.b_control_status.BControl2Status.rotate3_1
rotate3_1
Definition:
b_control_status.py:102
jsk_teleop_joy.b_control_status.BControl2Status.buttonU2
buttonU2
Definition:
b_control_status.py:14
jsk_teleop_joy.b_control_status.BControl2Status.buttonU6
buttonU6
Definition:
b_control_status.py:30
jsk_teleop_joy.b_control_status.BControl2Status.buttonL1
buttonL1
Definition:
b_control_status.py:43
jsk_teleop_joy.b_control_status.BControl2Status.rotate1_7
rotate1_7
Definition:
b_control_status.py:90
jsk_teleop_joy.b_control_status.BControl2Status.buttonU8
buttonU8
Definition:
b_control_status.py:38
jsk_teleop_joy.b_control_status.BControl2Status.slide7
slide7
Definition:
b_control_status.py:81
jsk_teleop_joy.b_control_status.BControl2Status.rotate2_6
rotate2_6
Definition:
b_control_status.py:98
jsk_teleop_joy.b_control_status.BControl2Status.rotate4_8
rotate4_8
Definition:
b_control_status.py:118
jsk_teleop_joy.b_control_status.BControl2Status.buttonU3
buttonU3
Definition:
b_control_status.py:18
jsk_teleop_joy.b_control_status.BControl2Status.slide5
slide5
Definition:
b_control_status.py:79
jsk_teleop_joy.b_control_status.BControl2Status.slide1
slide1
Definition:
b_control_status.py:75
jsk_teleop_joy.b_control_status.BControl2Status.rotate4_7
rotate4_7
Definition:
b_control_status.py:117
jsk_teleop_joy.b_control_status.BControl2Status.rotate2_2
rotate2_2
Definition:
b_control_status.py:94
jsk_teleop_joy
Author(s): Ryohei Ueda
autogenerated on Sun May 28 2023 03:03:37