|
@@ -12,10 +12,11 @@ conn = globalArduinoSlave()
|
|
|
|
|
|
class AcusticSensor:
|
|
|
def __init__(self, conf, ac_queue, calibration_state):
|
|
|
+ self.conf = conf
|
|
|
self.ac_queue = ac_queue
|
|
|
self.calibration_state = calibration_state
|
|
|
self.field_height = float(conf["field"]["y"])
|
|
|
- self.field_width = float(conf["field"]["x"])
|
|
|
+ self.field_width = float(conf["field"]["x"])
|
|
|
self.sensor_y_offset = float(conf["ac_sensor"]["y_offset"])
|
|
|
self.left_sensor_x_offset = float(conf["ac_sensor"]["left_x_offset"])
|
|
|
self.right_sensor_x_offset = float(conf["ac_sensor"]["right_x_offset"])
|
|
@@ -34,7 +35,7 @@ class AcusticSensor:
|
|
|
|
|
|
def start(self):
|
|
|
if not conn.isConnected():
|
|
|
- conn.open()
|
|
|
+ conn.open(port = self.conf["arduino"]["port"], baudrate = int(self.conf["arduino"]["baudrate"]))
|
|
|
conn.addRecvCallback(self._readCb)
|
|
|
# generate dummy values until arduino is ready
|
|
|
self.dummyActive = True
|