very-dumb/conception/th_move.txt

24 lines
559 B
Text

@startuml
skinparam monochrome true
start
:counter = 0;
:start_period(100 ms);
while ()
:wait_next_period();
if (robotStarted) then (true)
:msgSend = robot.Write(new Message(move));
if (msgSend->getId()) then (MESSAGE_ANSWER_ACK)
:counter = 0;
:robotStarted = true;
else (MESSAGE_ANSWER_ROBOT_TIMEOUT || \nMESSAGE_ANSWER_ROBOT_UNKNOWN_COMMAND || \nMESSAGE_ANSWER_ROBOT_ERROR)
:counter++;
if (counter) then (3)
:stopRobot!;
:monitor.write(Message(MESSAGE_ANSWER_COM_ERROR));
else ()
endif
endif
endif
endwhile
stop
@enduml