defines updated
This commit is contained in:
parent
93b4075c35
commit
b70d445480
Binary file not shown.
@ -71,23 +71,23 @@ def action_drive(client: mqtt.Client, userdata, message: mqtt.MQTTMessage, mydat
|
|||||||
"ActionID": action_id
|
"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)
|
robot.add_order(drive_data)
|
||||||
client.publish(Topics['ROBOT_ACTION_DRIVE'], json.dumps(drive_data))
|
client.publish(Topics['ROBOT_ACTION_DRIVE'], json.dumps(drive_data))
|
||||||
logging.info("BACKEND_ACTION_DRIVE Drive Command published: " + json.dumps(drive_data))
|
logging.info("BACKEND_ACTION_DRIVE Drive Command published: " + json.dumps(drive_data))
|
||||||
else:
|
else:
|
||||||
if robot.get_order_number() < 5:
|
if robot.get_order_number() < 6:
|
||||||
robot.add_order(drive_data)
|
robot.add_order(drive_data)
|
||||||
logging.info("BACKEND_ACTION_DRIVE New data added to order list: " + str(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")
|
logging.error("Could not add Order to list. Order discarded")
|
||||||
client.publish(Topics['BACKEND_DATA_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,
|
def action_driveall(client: mqtt.Client, userdata, message: mqtt.MQTTMessage, mydatabase: PlantDataBase,
|
||||||
robot: Robot):
|
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):
|
def action_getposition(client: mqtt.Client, userdata, message: mqtt.MQTTMessage, mydatabase: PlantDataBase):
|
||||||
|
Binary file not shown.
@ -72,9 +72,13 @@ BATTERY = {
|
|||||||
|
|
||||||
DRIVE = {
|
DRIVE = {
|
||||||
"PlantID": 0,
|
"PlantID": 0,
|
||||||
"ActionID": 0
|
"ActionID": ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DRIVEALL = {
|
||||||
|
"PlantID": [0, 0], # List containing PlantIDs sorted ascending
|
||||||
|
"ActionID": ""
|
||||||
|
}
|
||||||
# GETPOSITION -> no message needed
|
# GETPOSITION -> no message needed
|
||||||
|
|
||||||
# GETBATTERY -> no message needed
|
# GETBATTERY -> no message needed
|
||||||
|
Loading…
x
Reference in New Issue
Block a user