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