Skip to content

Commit bf7abb6

Browse files
committed
Merge branch 'beta' into release
2 parents 6d8dc58 + fb59ce1 commit bf7abb6

14 files changed

+126
-10
lines changed

etee/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.0.0"
1+
__version__ = "1.0.1"

etee/driver_eteecontroller.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,17 @@ def __init__(self):
118118
:type: Event """
119119

120120
self.left_hand_lost = EteeControllerEvent()
121-
"""Event for losing left controller connection. Occurs when data is not received for more than 0.5 seconds.
121+
"""Event for losing left controller connection. Occurs when data is not received for more than 1.5 seconds.
122122
123123
:type: Event """
124124

125125
self.right_hand_lost = EteeControllerEvent()
126-
"""Event for losing right controller connection. Occurs when data is not received for more than 0.5 seconds.
126+
"""Event for losing right controller connection. Occurs when data is not received for more than 1.5 seconds.
127127
128128
:type: Event """
129129

130130
self.data_lost = EteeControllerEvent()
131-
"""Event for losing data from both controllers. Occurs when data is not received for more than 0.5 seconds.
131+
"""Event for losing data from both controllers. Occurs when data is not received for more than 1.5 seconds.
132132
133133
:type: Event """
134134

@@ -256,7 +256,6 @@ def _api_data_callback(self, frameno, data):
256256
:param dict data: Dictionary of the parsed controller data.
257257
"""
258258
if data["hand"] == 0:
259-
# print(time.time() - self.hand_last_on_left)
260259
self._api_data_left = data
261260
self._hand_last_on_left = time.time()
262261
self._frameno_left += 1
@@ -272,10 +271,10 @@ def _api_data_callback(self, frameno, data):
272271

273272
self.hand_received.emit()
274273

275-
if time.time() - self._hand_last_on_left > 0.1 and self._api_data_left is not None:
274+
if (time.time() - self._hand_last_on_left) > 1.5 and self._api_data_left is not None:
276275
self._api_data_left = None
277276
self.left_hand_lost.emit()
278-
if time.time() - self._hand_last_on_right > 0.1 and self._api_data_left is not None:
277+
if (time.time() - self._hand_last_on_right) > 1.5 and self._api_data_right is not None:
279278
self._api_data_right = None
280279
self.right_hand_lost.emit()
281280

@@ -314,8 +313,8 @@ def _rest_callback(self, reading):
314313
"""
315314
if reading is not None:
316315
return
317-
left_lost = time.time() - self._hand_last_on_left > 0.1 and self._api_data_left is not None
318-
right_lost = time.time() - self._hand_last_on_right > 0.1 and self._api_data_right is not None
316+
left_lost = (time.time() - self._hand_last_on_left) > 1.5 and self._api_data_left is not None
317+
right_lost = (time.time() - self._hand_last_on_right) > 1.5 and self._api_data_right is not None
319318
if left_lost:
320319
self._api_data_left = None
321320
self.left_hand_lost.emit()
@@ -531,7 +530,7 @@ def all_hands_on(self):
531530
:return: Returns true if data has been recently received from both controllers.
532531
:rtype: bool
533532
"""
534-
return (self.get_left is not None) and (self.get_right is not None)
533+
return (self._api_data_left is not None) and (self._api_data_right is not None)
535534

536535
def any_hand_on(self):
537536
"""

examples/01_Retrieving_Data/right_index_events_based.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515

1616

1717
def process_right_index():
18+
"""
19+
Retrieve the pressure data for the right index finger from the etee driver. Print the values.
20+
"""
1821
right_index_pull = etee.get_index_pull('right')
1922
right_index_force = etee.get_index_force('right')
2023
current_time = datetime.now().strftime("%H:%M:%S.%f")

examples/01_Retrieving_Data/right_index_getter_function.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616

1717

1818
def process_right_index():
19+
"""
20+
Retrieve the pressure data for the right index finger from the etee driver.
21+
22+
:return: Index finger pull pressure and force pressure, from the right eteeController.
23+
:rtype: int, int
24+
"""
1925
right_index_pull = etee.get_index_pull('right')
2026
right_index_force = etee.get_index_force('right')
2127
return right_index_pull, right_index_force

examples/02_Print_Data/print_etee_euler_angles.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717

1818
def print_title():
19+
"""
20+
Print CLI graphics for the application title.
21+
"""
1922
print("======================================================")
2023
print(r" __ ___ ____ ____")
2124
print(r" ___ / /____ ___ / | / __ \/ _/")

examples/02_Print_Data/print_etee_finger_data.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@
1313

1414

1515
def process_finger(dev, finger):
16+
"""
17+
Retrieve the selected device's finger values from the etee driver.
18+
19+
:param str dev: Selected device hand. Possible values: "left", "right".
20+
:param str finger: Selected finger. Possible values: "thumb", "index", "middle", "ring", "pinky".
21+
:return: Array containing the selected controller's index finger values: pull pressure, force pressure,
22+
touch and click.
23+
:rtype: list[Any]
24+
"""
1625
finger_pull = finger + "_pull"
1726
finger_force = finger + "_force"
1827
finger_touch = finger + "_touched"
@@ -24,6 +33,9 @@ def process_finger(dev, finger):
2433

2534

2635
def print_title():
36+
"""
37+
Print CLI graphics for the application title.
38+
"""
2739
print("======================================================")
2840
print(r" __ ___ ____ ____")
2941
print(r" ___ / /____ ___ / | / __ \/ _/")

examples/02_Print_Data/print_etee_fingers_all_data.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515

1616
def print_title():
17+
"""
18+
Print CLI graphics for the application title.
19+
"""
1720
print("======================================================")
1821
print(r" __ ___ ____ ____")
1922
print(r" ___ / /____ ___ / | / __ \/ _/")

examples/02_Print_Data/print_etee_imu.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414

1515
def print_title():
16+
"""
17+
Print CLI graphics for the application title.
18+
"""
1619
print("======================================================")
1720
print(r" __ ___ ____ ____")
1821
print(r" ___ / /____ ___ / | / __ \/ _/")
@@ -25,6 +28,14 @@ def print_title():
2528

2629

2730
def adjust_imu(original_arr, offsets_arr):
31+
"""
32+
Apply offsets to the original array.
33+
34+
:param list[int] original_arr: Original IMU (i.e. accel, gyro or mag) XYZ array without offsets.
35+
:param list[int] offsets_arr: Array of XYZ offsets to be applied to the original array.
36+
:return: Adjusted IMU array after applying offsets.
37+
:rtype: list[int]
38+
"""
2839
adj_arr = [0, 0, 0]
2940
if original_arr is None or offsets_arr is None:
3041
pass

examples/02_Print_Data/print_etee_quaternions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515

1616
def print_title():
17+
"""
18+
Print CLI graphics for the application title.
19+
"""
1720
print("======================================================")
1821
print(r" __ ___ ____ ____")
1922
print(r" ___ / /____ ___ / | / __ \/ _/")

examples/02_Print_Data/print_etee_slider_data.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,23 @@
1313

1414

1515
def process_slider(dev):
16+
"""
17+
Retrieve the selected device's slider values from the etee driver.
18+
19+
:param str dev: Selected device hand. Possible values: "left", "right".
20+
:return: Array containing the selected controller's slider values: Y-axis position, touch, up and down button values.
21+
:rtype: list[Any]
22+
"""
1623
slider = [etee.get_slider_value(dev),
1724
etee.get_slider_touched(dev),
1825
etee.get_slider_up_button(dev), etee.get_slider_down_button(dev)]
1926
return slider
2027

2128

2229
def print_title():
30+
"""
31+
Print CLI graphics for the application title.
32+
"""
2333
print("======================================================")
2434
print(r" __ ___ ____ ____")
2535
print(r" ___ / /____ ___ / | / __ \/ _/")

0 commit comments

Comments
 (0)