Fixed Encoder clear at startup
This commit is contained in:
parent
9e61023e67
commit
3e7df14da8
2 changed files with 11 additions and 4 deletions
|
@ -57,7 +57,12 @@ class Encoder(object):
|
|||
raise IndexError("Invalid encoder port specified!")
|
||||
|
||||
encoder_start_values[port] = Encoder.read_raw(port)
|
||||
|
||||
|
||||
for i in range(1, MOTOR_COUNT + 1):
|
||||
encoder_start_values[i] = Encoder.read_raw(i)
|
||||
@staticmethod
|
||||
def clear_all():
|
||||
"""Reset all encoder positions to 0
|
||||
"""
|
||||
|
||||
for i in range(1, MOTOR_COUNT + 1):
|
||||
encoder_start_values[i] = Encoder.read_raw(i)
|
||||
|
|
@ -3,6 +3,7 @@ __version__ = "0.1.5-1"
|
|||
import compLib.LogstashLogging
|
||||
import compLib.Spi
|
||||
import compLib.Reset
|
||||
import compLib.Encoder
|
||||
import logging
|
||||
import apt
|
||||
|
||||
|
@ -19,4 +20,5 @@ except Exception as e:
|
|||
|
||||
compLib.Reset.Reset.reset_bot()
|
||||
compLib.Spi.Spi.health_check()
|
||||
compLib.Spi.Spi.start_health_check_loop()
|
||||
compLib.Spi.Spi.start_health_check_loop()
|
||||
compLib.Encoder.Encoder.clear_all()
|
Reference in a new issue