|
@@ -11,7 +11,7 @@ import logHandler
|
|
|
conn = globalArduinoSlave()
|
|
|
|
|
|
|
|
|
-class AcusticSensor:
|
|
|
+class AcousticSensor:
|
|
|
def __init__(self, conf, ac_queue, calibration_state):
|
|
|
self.conf = conf
|
|
|
self.ac_queue = ac_queue
|
|
@@ -30,7 +30,7 @@ class AcusticSensor:
|
|
|
self.overhead_right = float(conf["ac_sensor"]["overhead_right"])
|
|
|
|
|
|
self.log_handler = logHandler.get_log_handler()
|
|
|
- self.log_handler.log_and_print("start acustic sensor")
|
|
|
+ self.log_handler.log_and_print("start acoustic sensor")
|
|
|
|
|
|
# temporary calibration variables
|
|
|
self.time_vals = [[],[]]
|
|
@@ -55,12 +55,12 @@ class AcusticSensor:
|
|
|
self.calibration_state.next_state()
|
|
|
|
|
|
def stop(self):
|
|
|
- self.log_handler.log_and_print("stop acustic sensor")
|
|
|
+ self.log_handler.log_and_print("stop acoustic sensor")
|
|
|
self.dummyActive = False
|
|
|
conn.close()
|
|
|
|
|
|
def _readCb_dummy(self):
|
|
|
- self.log_handler.log_and_print("acustic sensor: generating test values")
|
|
|
+ self.log_handler.log_and_print("acoustic sensor: generating test values")
|
|
|
while self.dummyActive:
|
|
|
if self.n % 4 < 1:
|
|
|
dummyPosition = (0, self.n%1 * self.field_height)
|
|
@@ -87,12 +87,12 @@ class AcusticSensor:
|
|
|
if position != None:
|
|
|
self.pass_to_gui(position + dummyValue)
|
|
|
time.sleep(0.012)
|
|
|
- self.log_handler.log_and_print("acustic sensor: disabled test mode")
|
|
|
+ self.log_handler.log_and_print("acoustic sensor: disabled test mode")
|
|
|
|
|
|
def _readCb(self, raw):
|
|
|
if self.dummyActive == True:
|
|
|
self.dummyActive = False
|
|
|
- value = conn.getAcusticRTTs()
|
|
|
+ value = conn.getAcousticRTTs()
|
|
|
# partially missing values will be ignored
|
|
|
if value[0] >= 0 and value[1] >= 0:
|
|
|
self.calibrate(value)
|
|
@@ -159,7 +159,7 @@ class AcusticSensor:
|
|
|
self.calibration_state.next_state()
|
|
|
|
|
|
def read(self):
|
|
|
- value = conn.getAcusticRTTs()
|
|
|
+ value = conn.getAcousticRTTs()
|
|
|
return value
|
|
|
|
|
|
def calculate_position(self, values):
|