Skip to content

Commit 3837117

Browse files
committed
fix: revamp alvik print_status
1 parent 716de05 commit 3837117

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

arduino_alvik/arduino_alvik.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -971,10 +971,27 @@ def print_status(self):
971971
Prints the Alvik status
972972
:return:
973973
"""
974-
for a in vars(self):
975-
if str(a).startswith('_'):
976-
continue
977-
print(f'{str(a).upper()} = {getattr(self, str(a))}')
974+
print('---ALVIK STATUS---')
975+
print(f'VERSION: {self._version}')
976+
977+
print('---SENSORS---')
978+
print(f'TOF: T:{self._top_tof} B:{self._bottom_tof} L:{self._left_tof} CL:{self._center_left_tof}' +
979+
f' C:{self._center_tof} CR:{self._center_right_tof} R:{self._right_tof}')
980+
print(f'LINE: L:{self._left_line} C:{self._center_line} R:{self._right_line}')
981+
print(f'ACC: X:{self._ax} Y:{self._ay} Z:{self._az}')
982+
print(f'GYR: X:{self._gx} Y:{self._gy} Z:{self._gz}')
983+
print(f'POS: X:{self._x} Y:{self._y} TH:{self._theta}')
984+
print(f'IMU: ROLL:{self._roll} PITCH:{self._pitch} YAW:{self._yaw}')
985+
print(f'COLOR: R:{self._red} G:{self._green} B:{self._blue}')
986+
print(f'BATT(%) {self._battery_perc}')
987+
988+
print('---COMMUNICATION---')
989+
print(f'TOUCH BYTE: {self._touch_byte}')
990+
print(f'LAST ACK: {self._last_ack}')
991+
992+
print('---MOTORS---')
993+
print(f'LINEAR VEL: {self._linear_velocity}')
994+
print(f'ANGULAR VEL: {self._angular_velocity}')
978995

979996
def on_touch_ok_pressed(self, callback: callable, args: tuple = ()) -> None:
980997
"""

0 commit comments

Comments
 (0)