|
|
@@ -71,23 +71,23 @@ def action_drive(client: mqtt.Client, userdata, message: mqtt.MQTTMessage, mydat |
|
|
|
"ActionID": action_id |
|
|
|
} |
|
|
|
|
|
|
|
if robot.get_order_number() < 5 and robot.get_robot_status() is True: |
|
|
|
if robot.get_order_number() < 6 and robot.get_robot_status() is True: |
|
|
|
robot.add_order(drive_data) |
|
|
|
client.publish(Topics['ROBOT_ACTION_DRIVE'], json.dumps(drive_data)) |
|
|
|
logging.info("BACKEND_ACTION_DRIVE Drive Command published: " + json.dumps(drive_data)) |
|
|
|
else: |
|
|
|
if robot.get_order_number() < 5: |
|
|
|
if robot.get_order_number() < 6: |
|
|
|
robot.add_order(drive_data) |
|
|
|
logging.info("BACKEND_ACTION_DRIVE New data added to order list: " + str(drive_data)) |
|
|
|
elif robot.get_order_number() >= 5: |
|
|
|
elif robot.get_order_number() >= 6: |
|
|
|
logging.error("Could not add Order to list. Order discarded") |
|
|
|
client.publish(Topics['BACKEND_DATA_ERROR'], "Could not add Order to list. Order discarded") |
|
|
|
|
|
|
|
|
|
|
|
def action_driveall(client: mqtt.Client, userdata, message: mqtt.MQTTMessage, mydatabase: PlantDataBase, |
|
|
|
robot: Robot): |
|
|
|
# TODO: Implement here |
|
|
|
print("HELLO") |
|
|
|
|
|
|
|
client.publish(Topics['ROBOT_ACTION_DRIVEALL']) |
|
|
|
|
|
|
|
|
|
|
|
def action_getposition(client: mqtt.Client, userdata, message: mqtt.MQTTMessage, mydatabase: PlantDataBase): |