Merge remote-tracking branch 'origin/cmake' into cmake

This commit is contained in:
Arnaud Vergnet 2021-03-12 15:09:55 +01:00
commit 9f2bbe5bdf
4 changed files with 24 additions and 12 deletions

View file

@ -0,0 +1,18 @@
@startuml
skinparam monochrome true
start
while ()
:openComRobot?;
:err = robot.Open();
if (err) then (robot_ok)
:msgSend = new Message(MESSAGE_ANSWER_ACK);
else
:msgSend = new Message(MESSAGE_ANSWER_NACK);
endif
:messageToMon!msgSend;
:closeComRobot?;
:robot.Close();
endwhile
stop
@enduml

View file

@ -3,14 +3,6 @@ skinparam monochrome true
start start
while () while ()
:startRobot?; :startRobot?;
:err = robot.Open();
if (err) then (robot_ok)
:msgSend = new Message(MESSAGE_ANSWER_ACK);
else
:msgSend = new Message(MESSAGE_ANSWER_NACK);
endif
:messageToMon!msgSend;
if (watchdogMode) then (WITH_WATCHDOG) if (watchdogMode) then (WITH_WATCHDOG)
:msgSend = robot.Write(new Message(MESSAGE_ROBOT_START_WITH_WD)); :msgSend = robot.Write(new Message(MESSAGE_ROBOT_START_WITH_WD));
@ -26,7 +18,6 @@ while ()
:stopRobot? :stopRobot?
:ordre = STOP_MOVE; :ordre = STOP_MOVE;
:robot.Close();
endwhile endwhile
stop stop

View file

@ -9,11 +9,11 @@ while ()
:msgSend = robot.Write(new Message(move)); :msgSend = robot.Write(new Message(move));
if (msgSend->getId()) then (MESSAGE_ANSWER_ACK) if (msgSend->getId()) then (MESSAGE_ANSWER_ACK)
:counter = 0; :counter = 0;
:robotStarted = true;
else (MESSAGE_ANSWER_ROBOT_TIMEOUT || \nMESSAGE_ANSWER_ROBOT_UNKNOWN_COMMAND || \nMESSAGE_ANSWER_ROBOT_ERROR) else (MESSAGE_ANSWER_ROBOT_TIMEOUT || \nMESSAGE_ANSWER_ROBOT_UNKNOWN_COMMAND || \nMESSAGE_ANSWER_ROBOT_ERROR)
:counter++; :counter++;
if (counter) then (3) if (counter) then (3)
:stopRobot!; :stopRobot!;
:closeComRobot!;
:monitor.write(Message(MESSAGE_ANSWER_COM_ERROR)); :monitor.write(Message(MESSAGE_ANSWER_COM_ERROR));
else () else ()
endif endif

View file

@ -8,16 +8,19 @@ while ()
:printf("Connection avec le moniteur perdue"); :printf("Connection avec le moniteur perdue");
:stopCamera!; :stopCamera!;
:stopRobot!; :stopRobot!;
:stopComRobot!;
:stopServer!; :stopServer!;
endif endif
if (msgRcv.CompareID(MESSAGE_ROBOT_COM_OPEN)) then (true) if (msgRcv.CompareID(MESSAGE_ROBOT_COM_OPEN)) then (true)
:openComRobot!; :openComRobot!;
endif endif
if (msgRcv.CompareID(MESSAGE_ROBOT_START_WITHOUT_WD)) then (true) if (msgRcv.CompareID(MESSAGE_ROBOT_START_WITHOUT_WD)) then (true)
:startRobotWithoutWd!; :watchdogMode = WITHOUT_WATCHDOG;
:startRobot!;
endif endif
if (msgRcv.CompareID(MESSAGE_ROBOT_START_WITH_WD)) then (true) if (msgRcv.CompareID(MESSAGE_ROBOT_START_WITH_WD)) then (true)
:startRobotWithWd!; :watchdogMode = WITH_WATCHDOG;
:startRobot!;
endif endif
if (msgRcv.CompareID(MESSAGE_ROBOT_GO_FORWARD if (msgRcv.CompareID(MESSAGE_ROBOT_GO_FORWARD
|| msgRcv.CompareID(MESSAGE_ROBOT_GO_BACKWARD || msgRcv.CompareID(MESSAGE_ROBOT_GO_BACKWARD