fix: orient the robot in the correct direction when returning to home

This commit is contained in:
Guillaume ARM 2024-05-08 22:43:36 +02:00
parent a923fe846d
commit 8351bf16aa

View File

@ -196,6 +196,10 @@ local function returnHomeProcedure()
if robotState.x == 0 and robotState.y == 0 and robotState.z == 0 then if robotState.x == 0 and robotState.y == 0 and robotState.z == 0 then
miner.mission = 'unload' miner.mission = 'unload'
elseif robotState.x == 0 and robotState.z == 0 then elseif robotState.x == 0 and robotState.z == 0 then
while miner.robot.getState().dir ~= 'FORWARD' do
miner.robot.turnRight()
end
miner.robot.up() miner.robot.up()
elseif robotState.x > 0 then elseif robotState.x > 0 then
if robotState.dir == 'FORWARD' then if robotState.dir == 'FORWARD' then