Browse Source

Robot UML update

master
waldluis 1 year 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

else: else:
errorMessage = "Motor or Sensor unplugged" 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_ERROR"], f"{errorMessage}, Drive Plant aborted, Robot at starting position", qos=1)
client.publish(Topics["ROBOT_DATA_ROBOTREADY"], "True", qos=1) client.publish(Topics["ROBOT_DATA_ROBOTREADY"], "True", qos=1)
return return
else: else:
errorMessage = "Motor or Sensor unplugged" 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_ERROR"], f"{errorMessage}, Drive Plant aborted, Robot at plant {plantID}", qos=1)
client.publish(Topics["ROBOT_DATA_ROBOTREADY"], "True", qos=1) client.publish(Topics["ROBOT_DATA_ROBOTREADY"], "True", qos=1)
return return
else: else:
errorMessage = "Motor or Sensor unplugged" 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_ERROR"], f"{errorMessage}, Drive Plant aborted, Robot at starting position", qos=1)
client.publish(Topics["ROBOT_DATA_ROBOTREADY"], "True", qos=1) client.publish(Topics["ROBOT_DATA_ROBOTREADY"], "True", qos=1)
return return
else: else:
errorMessage = "Motor or Sensor unplugged" 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_ERROR"], f"{errorMessage}, Drive Plant aborted, Robot at plant {plant}", qos=1)
client.publish(Topics["ROBOT_DATA_ROBOTREADY"], "True", qos=1) client.publish(Topics["ROBOT_DATA_ROBOTREADY"], "True", qos=1)
return return
else: else:
errorMessage = "Motor or Sensor unplugged" 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_ERROR"], f"{errorMessage}, Drive Plant aborted, Robot at plant {plant}", qos=1)
client.publish(Topics["ROBOT_DATA_ROBOTREADY"], "True", qos=1) client.publish(Topics["ROBOT_DATA_ROBOTREADY"], "True", qos=1)
return return
batteryLevel = int(os.popen('sshpass -p maker ssh robot@ev3dev.local cat /sys/devices/platform/battery/power_supply/lego-ev3-battery/voltage_now').read()) 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: except:
logging.error("EV3 not connected") 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 return


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

Loading…
Cancel
Save