|
|
@@ -14,11 +14,15 @@ import threading |
|
|
|
import os |
|
|
|
import time |
|
|
|
from raspy_sensors import RaspySensors |
|
|
|
|
|
|
|
from software.defines import Topics, RASPI_CLIENT_ID, MQTT_BROKER_GLOBAL |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region global Varaibles |
|
|
|
|
|
|
|
sensors: RaspySensors |
|
|
|
# FIXME Sensor not working |
|
|
|
#sensors: RaspySensors |
|
|
|
|
|
|
|
|
|
|
|
#endregion |
|
|
@@ -56,7 +60,9 @@ def drive_plant_thread(plantID, actionID, client: mqtt.Client): |
|
|
|
#CHECK if working properly |
|
|
|
|
|
|
|
print("Measuring Sensors") |
|
|
|
measure_send_data(plantID, actionID, client) |
|
|
|
|
|
|
|
#FIXME Sensor not working |
|
|
|
# measure_send_data(plantID, actionID, client) |
|
|
|
|
|
|
|
print("Robot driving home") |
|
|
|
if plantID % 2 == 0: |
|
|
@@ -176,8 +182,9 @@ def main(): |
|
|
|
Runs forever and controlls all robot functions |
|
|
|
""" |
|
|
|
# CHECK if global |
|
|
|
global sensors |
|
|
|
sensors = RaspySensors() |
|
|
|
# FIXME Sensor not working |
|
|
|
# global sensors |
|
|
|
# sensors = RaspySensors() |
|
|
|
client = mqtt.Client(RASPI_CLIENT_ID) |
|
|
|
client.on_connect = on_connect |
|
|
|
client.connect(MQTT_BROKER_GLOBAL) |