feat(robot): add turnBack method
This commit is contained in:
parent
69a04a19d5
commit
edcab83d4e
@ -200,6 +200,16 @@ api.create = function(state, givenConfig)
|
|||||||
return ok, err
|
return ok, err
|
||||||
end
|
end
|
||||||
|
|
||||||
|
robot.turnBack = function()
|
||||||
|
local ok, errorMessage = robot.turnLeft()
|
||||||
|
|
||||||
|
if not ok then
|
||||||
|
error('turnBack: cannot turn left because ' .. tostring(errorMessage))
|
||||||
|
end
|
||||||
|
|
||||||
|
return robot.turnLeft()
|
||||||
|
end
|
||||||
|
|
||||||
robot.getState = function()
|
robot.getState = function()
|
||||||
return state
|
return state
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user