|
|
|
|
|
|
|
|
import os |
|
|
import os |
|
|
import time |
|
|
import time |
|
|
from raspy_sensors import RaspySensors |
|
|
from raspy_sensors import RaspySensors |
|
|
|
|
|
|
|
|
from software.defines import Topics, RASPI_CLIENT_ID, MQTT_BROKER_GLOBAL |
|
|
from software.defines import Topics, RASPI_CLIENT_ID, MQTT_BROKER_GLOBAL |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region global Varaibles |
|
|
#region global Varaibles |
|
|
|
|
|
|
|
|
sensors: RaspySensors |
|
|
|
|
|
|
|
|
# FIXME Sensor not working |
|
|
|
|
|
#sensors: RaspySensors |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion |
|
|
#endregion |
|
|
|
|
|
|
|
|
#CHECK if working properly |
|
|
#CHECK if working properly |
|
|
|
|
|
|
|
|
print("Measuring Sensors") |
|
|
print("Measuring Sensors") |
|
|
measure_send_data(plantID, actionID, client) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#FIXME Sensor not working |
|
|
|
|
|
# measure_send_data(plantID, actionID, client) |
|
|
|
|
|
|
|
|
print("Robot driving home") |
|
|
print("Robot driving home") |
|
|
if plantID % 2 == 0: |
|
|
if plantID % 2 == 0: |
|
|
|
|
|
|
|
|
Runs forever and controlls all robot functions |
|
|
Runs forever and controlls all robot functions |
|
|
""" |
|
|
""" |
|
|
# CHECK if global |
|
|
# CHECK if global |
|
|
global sensors |
|
|
|
|
|
sensors = RaspySensors() |
|
|
|
|
|
|
|
|
# FIXME Sensor not working |
|
|
|
|
|
# global sensors |
|
|
|
|
|
# sensors = RaspySensors() |
|
|
client = mqtt.Client(RASPI_CLIENT_ID) |
|
|
client = mqtt.Client(RASPI_CLIENT_ID) |
|
|
client.on_connect = on_connect |
|
|
client.on_connect = on_connect |
|
|
client.connect(MQTT_BROKER_GLOBAL) |
|
|
client.connect(MQTT_BROKER_GLOBAL) |