Browse Source

Robot UML update

master
waldluis 8 months ago
parent
commit
5e14633f42
2 changed files with 1118 additions and 187 deletions
  1. 1112
    181
      documentation/SmartGardeningProjekt.mdj
  2. 6
    6
      software/roboter/raspy/functions.py

+ 1112
- 181
documentation/SmartGardeningProjekt.mdj
File diff suppressed because it is too large
View File


+ 6
- 6
software/roboter/raspy/functions.py View File

@@ -68,7 +68,7 @@ def drive_plant_thread(plantID, actionID, client: mqtt.Client):
else:
errorMessage = "Motor or Sensor unplugged"
logging.info(f"{errorMessage}, Drive Plant aborted, Robot at starting position")
logging.error(f"{errorMessage}, Drive Plant aborted, Robot at starting position")
client.publish(Topics["ROBOT_DATA_ERROR"], f"{errorMessage}, Drive Plant aborted, Robot at starting position", qos=1)
client.publish(Topics["ROBOT_DATA_ROBOTREADY"], "True", qos=1)
return
@@ -91,7 +91,7 @@ def drive_plant_thread(plantID, actionID, client: mqtt.Client):
else:
errorMessage = "Motor or Sensor unplugged"
logging.info(f"{errorMessage}, Drive Plant aborted, Robot at starting position")
logging.error(f"{errorMessage}, Drive Plant aborted, Robot at starting position")
client.publish(Topics["ROBOT_DATA_ERROR"], f"{errorMessage}, Drive Plant aborted, Robot at plant {plantID}", qos=1)
client.publish(Topics["ROBOT_DATA_ROBOTREADY"], "True", qos=1)
return
@@ -135,7 +135,7 @@ def drive_plant_all_thread(plantIDs: list, actionID, client: mqtt.Client):
else:
errorMessage = "Motor or Sensor unplugged"
logging.info(f"{errorMessage}, Drive Plant aborted, Robot at starting position")
logging.error(f"{errorMessage}, Drive Plant aborted, Robot at starting position")
client.publish(Topics["ROBOT_DATA_ERROR"], f"{errorMessage}, Drive Plant aborted, Robot at starting position", qos=1)
client.publish(Topics["ROBOT_DATA_ROBOTREADY"], "True", qos=1)
return
@@ -168,7 +168,7 @@ def drive_plant_all_thread(plantIDs: list, actionID, client: mqtt.Client):
else:
errorMessage = "Motor or Sensor unplugged"
logging.info(f"{errorMessage}, Drive Plant aborted, Robot at plant {plant}")
logging.error(f"{errorMessage}, Drive Plant aborted, Robot at plant {plant}")
client.publish(Topics["ROBOT_DATA_ERROR"], f"{errorMessage}, Drive Plant aborted, Robot at plant {plant}", qos=1)
client.publish(Topics["ROBOT_DATA_ROBOTREADY"], "True", qos=1)
return
@@ -188,7 +188,7 @@ def drive_plant_all_thread(plantIDs: list, actionID, client: mqtt.Client):
else:
errorMessage = "Motor or Sensor unplugged"
logging.info(f"{errorMessage}, Drive Plant aborted, Robot at starting position")
logging.error(f"{errorMessage}, Drive Plant aborted, Robot at starting position")
client.publish(Topics["ROBOT_DATA_ERROR"], f"{errorMessage}, Drive Plant aborted, Robot at plant {plant}", qos=1)
client.publish(Topics["ROBOT_DATA_ROBOTREADY"], "True", qos=1)
return
@@ -292,7 +292,7 @@ def get_batteryStatus(client: mqtt.Client, userdata, message: mqtt.MQTTMessage):
batteryLevel = int(os.popen('sshpass -p maker ssh robot@ev3dev.local cat /sys/devices/platform/battery/power_supply/lego-ev3-battery/voltage_now').read())
except:
logging.error("EV3 not connected")
client.publish(Topics["ROBOT_DATA_ERROR"], "Robot not connected", qos=1)
client.publish(Topics["ROBOT_DATA_ERROR"], "EV3 not connected", qos=1)
return

batteryLevel = round(batteryLevel / 1000000, 2) # Conversion to Volt

Loading…
Cancel
Save