This commit is contained in:
Max 2021-09-21 15:52:55 +01:00
parent 09f564086b
commit 26cf31f29f

View File

@ -31,7 +31,7 @@ DO_FORK_ALIGN = True
DO_PICKUP_CARGO = True
DO_REVERSE_TURN = False
DO_GPS_RETURN = False
DO_DROPOFF_CARGO = False
DO_DROPOFF_CARGO = True
DO_RETURN_TO_NEUTRAL = False
DO_LOOP = True
@ -111,13 +111,6 @@ def __put_down_cargo(vehicle_ctrl):
return True
def __put_cargo_down_and_reverse_turn(vehicle_ctrl):
executor_logger.info(f"Dropping cargo")
__put_down_cargo(vehicle_ctrl)
__reverse_turn(vehicle_ctrl)
return True
def __reverse_turn(vehicle_ctrl):
executor_logger.info(f"performing reverse turn")
vehicle_ctrl.nudge_drive(False, 5, 2000)
@ -233,7 +226,7 @@ def queue_executor_thread():
if DO_DROPOFF_CARGO:
FORKLIFT.set_state("MANIPULATING_CARGO")
cargo_down_success = __put_cargo_down_and_reverse_turn(FORKLIFT)
cargo_down_success = __put_down_cargo(FORKLIFT)
if not cargo_down_success:
executor_logger.critical("Problem with cargo put down, check logs !")
FORKLIFT.set_state("OTHER_ERROR")
@ -241,7 +234,14 @@ def queue_executor_thread():
else:
executor_logger.warning("DO_DROPOFF_CARGO flag is false, skipping dropping off cargo")
if DO_REVERSE_TURN:
reverse_turn = reverse_turn(FORKLIFT)
if not reverse_turn:
executor_logger.critical("Problem with reverse turn, check logs !")
FORKLIFT.set_state("OTHER_ERROR")
return False
else:
executor_logger.warning("DO_REVERSE_TURN flag is false, skipping reverse turn")
if current_job['on_finish']['goto'] == True:
if DO_RETURN_TO_NEUTRAL: