fix: orient the robot in the correct direction when returning to home
This commit is contained in:
parent
a923fe846d
commit
8351bf16aa
@ -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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user