Currently, we are printing out status checking message every 10 seconds
|
self.dianostic = self.create_timer(10, self.dianostic) |
|
def dianostic(self): |
|
for odrv in self.odrvs: |
|
odrv.check_errors() |
This is not very helpful as it is hard to keep tracking critical messages. We should make this message shows up only when error happens.
I wrote this fucntion to check errors
|
def get_errors(self) -> str: |
|
""" |
|
Return ODrive system errors |
|
""" |
|
# https://docs.odriverobotics.com/v/0.5.4/fibre_types/com_odriverobotics_ODrive.html#ODrive.Error |
|
errors = self.decode_errors(self.odrv.error) |
|
return " & ".join([ODriveError(error).name for error in errors]) |
We can work on top of this fucntion
Currently, we are printing out status checking message every 10 seconds
rover-code/src/drive/drive/diff_drive.py
Line 61 in 587a146
rover-code/src/drive/drive/diff_drive.py
Lines 85 to 87 in 587a146
This is not very helpful as it is hard to keep tracking critical messages. We should make this message shows up only when error happens.
I wrote this fucntion to check errors
rover-code/components/odrive/utils.py
Lines 38 to 44 in 587a146
We can work on top of this fucntion