Minor fixes
This commit is contained in:
parent
3fe3139961
commit
aac99a11ba
4 changed files with 8 additions and 4 deletions
|
@ -74,11 +74,12 @@ class MetricsLogging():
|
||||||
global EXTENSIVE_LOGGING
|
global EXTENSIVE_LOGGING
|
||||||
if EXTENSIVE_LOGGING:
|
if EXTENSIVE_LOGGING:
|
||||||
if MetricsLogging.is_influx_reachable():
|
if MetricsLogging.is_influx_reachable():
|
||||||
EXTENSIVE_LOGGING = False
|
|
||||||
for i in range(CONCURRENCY):
|
for i in range(CONCURRENCY):
|
||||||
worker = threading.Thread(target=MetricsLogging.worker, daemon=True)
|
worker = threading.Thread(target=MetricsLogging.worker, daemon=True)
|
||||||
worker.start()
|
worker.start()
|
||||||
workers.append(worker)
|
workers.append(worker)
|
||||||
|
else:
|
||||||
|
EXTENSIVE_LOGGING = False
|
||||||
|
|
||||||
|
|
||||||
MetricsLogging.start_workers()
|
MetricsLogging.start_workers()
|
||||||
|
|
|
@ -89,8 +89,8 @@ class Motor(object):
|
||||||
elif percent < 0:
|
elif percent < 0:
|
||||||
raw_power = -Motor.__linearizePower(MOTOR_CURVE, -percent)
|
raw_power = -Motor.__linearizePower(MOTOR_CURVE, -percent)
|
||||||
|
|
||||||
MetricsLogging.put("Motor", percent, port, False)
|
MetricsLogging.put("Motor", percent, port)
|
||||||
Motor.power_raw(port, raw_power)
|
Motor.power_raw(port, raw_power, False)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def all_off():
|
def all_off():
|
||||||
|
|
|
@ -3,15 +3,17 @@ import time
|
||||||
|
|
||||||
GPIO.setwarnings(False)
|
GPIO.setwarnings(False)
|
||||||
RESET_PIN = 23
|
RESET_PIN = 23
|
||||||
|
BOOT_PIN = 17
|
||||||
|
|
||||||
class Reset:
|
class Reset:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def reset_bot():
|
def reset_bot():
|
||||||
GPIO.setmode(GPIO.BCM)
|
GPIO.setmode(GPIO.BCM)
|
||||||
GPIO.setup(RESET_PIN, GPIO.OUT)
|
GPIO.setup(RESET_PIN, GPIO.OUT)
|
||||||
|
GPIO.setup(BOOT_PIN, GPIO.OUT)
|
||||||
|
|
||||||
GPIO.output(RESET_PIN, GPIO.LOW)
|
GPIO.output(RESET_PIN, GPIO.LOW)
|
||||||
|
GPIO.output(BOOT_PIN, GPIO.LOW)
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
GPIO.output(RESET_PIN, GPIO.HIGH)
|
GPIO.output(RESET_PIN, GPIO.HIGH)
|
||||||
time.sleep(1.5)
|
time.sleep(1.5)
|
||||||
|
|
|
@ -2,6 +2,7 @@ __version__ = "0.1.5-1"
|
||||||
|
|
||||||
import importlib
|
import importlib
|
||||||
import compLib.LogstashLogging
|
import compLib.LogstashLogging
|
||||||
|
import compLib.MetricsLogging
|
||||||
|
|
||||||
|
|
||||||
apt_found = importlib.util.find_spec("apt") is not None
|
apt_found = importlib.util.find_spec("apt") is not None
|
||||||
|
|
Reference in a new issue