mise a jour dossie de conception
|
@ -93,7 +93,7 @@
|
||||||
{\scriptsize Institut National des Sciences Appliquées de Toulouse}\\
|
{\scriptsize Institut National des Sciences Appliquées de Toulouse}\\
|
||||||
---\\
|
---\\
|
||||||
Dossier de conception \\
|
Dossier de conception \\
|
||||||
{\large Version 2.0.$\beta$ (\today)}\\
|
{\large Version 2.0.1 (\today)}\\
|
||||||
{\scriptsize Référent pédagogique : P.-E. Hladik (\texttt{pehladik@insa-toulouse.fr})}\\
|
{\scriptsize Référent pédagogique : P.-E. Hladik (\texttt{pehladik@insa-toulouse.fr})}\\
|
||||||
---
|
---
|
||||||
}
|
}
|
||||||
|
@ -248,19 +248,7 @@ Jusqu'ici tout a été réalisé au brouillon par le concepteur, il faut donc ma
|
||||||
Ensuite, pour chacun des threads, un diagramme d'activité UML est utilisé pour décrire son comportement. Les diagrammes ont été produits avec \href{https://www.planttext.com}{https://www.planttext.com} et les codes sources sont disponibles en annexe (disponibles numériquement sur la page moodle).
|
Ensuite, pour chacun des threads, un diagramme d'activité UML est utilisé pour décrire son comportement. Les diagrammes ont été produits avec \href{https://www.planttext.com}{https://www.planttext.com} et les codes sources sont disponibles en annexe (disponibles numériquement sur la page moodle).
|
||||||
|
|
||||||
\subsection{Thread th\_server}
|
\subsection{Thread th\_server}
|
||||||
%@startuml
|
|
||||||
%skinparam monochrome true
|
|
||||||
%start
|
|
||||||
%:err = run_nodejs();
|
|
||||||
%if (err) then (failed)
|
|
||||||
% :print("Failed to start nodejs");
|
|
||||||
%stop
|
|
||||||
%else (succeed)
|
|
||||||
% :open_server();
|
|
||||||
% :serverOk!;
|
|
||||||
% stop
|
|
||||||
%endif
|
|
||||||
%@enduml
|
|
||||||
\begin{figure}[htbp]
|
\begin{figure}[htbp]
|
||||||
\begin{center}
|
\begin{center}
|
||||||
\includegraphics[scale=0.4]{figures_pdf/activity/th_server}
|
\includegraphics[scale=0.4]{figures_pdf/activity/th_server}
|
||||||
|
@ -270,16 +258,7 @@ Ensuite, pour chacun des threads, un diagramme d'activité UML est utilisé pour
|
||||||
\FloatBarrier
|
\FloatBarrier
|
||||||
|
|
||||||
\subsection{Thread th\_sendToMon}
|
\subsection{Thread th\_sendToMon}
|
||||||
%@startuml
|
|
||||||
%skinparam monochrome true
|
|
||||||
%start
|
|
||||||
%:serverOK?;
|
|
||||||
%while ()
|
|
||||||
% :messageToMon?header,data;
|
|
||||||
% :send_message_to_monitor(header,data);
|
|
||||||
%endwhile
|
|
||||||
%stop
|
|
||||||
%@enduml
|
|
||||||
\begin{figure}[htbp]
|
\begin{figure}[htbp]
|
||||||
\begin{center}
|
\begin{center}
|
||||||
\includegraphics[scale=0.4]{figures_pdf/activity/th_sendToMon}
|
\includegraphics[scale=0.4]{figures_pdf/activity/th_sendToMon}
|
||||||
|
@ -290,29 +269,7 @@ Ensuite, pour chacun des threads, un diagramme d'activité UML est utilisé pour
|
||||||
|
|
||||||
|
|
||||||
\subsection{Thread th\_receiveFromMon}
|
\subsection{Thread th\_receiveFromMon}
|
||||||
%@startuml
|
|
||||||
%skinparam monochrome true
|
|
||||||
%start
|
|
||||||
%:serverOk?;
|
|
||||||
%while ()
|
|
||||||
% :receive_message_from_monitor(header,data);
|
|
||||||
% if (header) then (HEADER_MTS_COM_DMB)
|
|
||||||
% if (data) then (OPEN_COM_DMB)
|
|
||||||
% :openComRobot!;
|
|
||||||
% endif
|
|
||||||
% else (HEADER_MTS_DMB_ORDER)
|
|
||||||
% if (data) then (DMB_START_WITHOUT_WD)
|
|
||||||
% :startRobot!;
|
|
||||||
% else (DMB_GO_FORWARD || DMB_GO_BACK
|
|
||||||
% || DMB_GO_LEFT || DMB_GO_RIGHT
|
|
||||||
% || DMB_STOP_MOVE)
|
|
||||||
% :move = data;
|
|
||||||
% endif
|
|
||||||
% endif
|
|
||||||
%endwhile
|
|
||||||
%stop
|
|
||||||
%@enduml
|
|
||||||
%
|
|
||||||
\begin{figure}[htbp]
|
\begin{figure}[htbp]
|
||||||
\begin{center}
|
\begin{center}
|
||||||
\includegraphics[scale=0.4]{figures_pdf/activity/th_receiveFromMon}
|
\includegraphics[scale=0.4]{figures_pdf/activity/th_receiveFromMon}
|
||||||
|
@ -322,19 +279,7 @@ Ensuite, pour chacun des threads, un diagramme d'activité UML est utilisé pour
|
||||||
\FloatBarrier
|
\FloatBarrier
|
||||||
|
|
||||||
\subsection{Thread th\_openComRobot}
|
\subsection{Thread th\_openComRobot}
|
||||||
%@startuml
|
|
||||||
%skinparam monochrome true
|
|
||||||
%start
|
|
||||||
%while ()
|
|
||||||
% :openComRobot?;
|
|
||||||
% :err = open_communication_robot();
|
|
||||||
% if (err) then (robot_ok)
|
|
||||||
% :messageToMon!ACK;
|
|
||||||
% else
|
|
||||||
% :messageToMon!NAC;
|
|
||||||
% endif
|
|
||||||
%endwhile
|
|
||||||
%stop
|
|
||||||
\begin{figure}[htbp]
|
\begin{figure}[htbp]
|
||||||
\begin{center}
|
\begin{center}
|
||||||
\includegraphics[scale=0.4]{figures_pdf/activity/th_openComRobot}
|
\includegraphics[scale=0.4]{figures_pdf/activity/th_openComRobot}
|
||||||
|
@ -343,23 +288,8 @@ Ensuite, pour chacun des threads, un diagramme d'activité UML est utilisé pour
|
||||||
\end{figure}
|
\end{figure}
|
||||||
\FloatBarrier
|
\FloatBarrier
|
||||||
|
|
||||||
\subsection{Thread th\_openStartRobot}
|
\subsection{Thread th\_startRobot}
|
||||||
%@startuml
|
|
||||||
%skinparam monochrome true
|
|
||||||
%start
|
|
||||||
%while ()
|
|
||||||
% :startRobot?;
|
|
||||||
% :err = send_command_robot(START_WITHOUT_WD);
|
|
||||||
% if (err) then (robot_ok)
|
|
||||||
% :messageToMon!ACK;
|
|
||||||
% :robotStarted = true;
|
|
||||||
% else
|
|
||||||
% :messageToMon!NAC;
|
|
||||||
% endif
|
|
||||||
%endwhile
|
|
||||||
%stop
|
|
||||||
%@enduml
|
|
||||||
%
|
|
||||||
\begin{figure}[htbp]
|
\begin{figure}[htbp]
|
||||||
\begin{center}
|
\begin{center}
|
||||||
\includegraphics[scale=0.4]{figures_pdf/activity/th_startRobot}
|
\includegraphics[scale=0.4]{figures_pdf/activity/th_startRobot}
|
||||||
|
@ -369,18 +299,7 @@ Ensuite, pour chacun des threads, un diagramme d'activité UML est utilisé pour
|
||||||
\FloatBarrier
|
\FloatBarrier
|
||||||
|
|
||||||
\subsection{Thread th\_move}
|
\subsection{Thread th\_move}
|
||||||
%@startuml
|
|
||||||
%skinparam monochrome true
|
|
||||||
%start
|
|
||||||
%:start_period(100 ms);
|
|
||||||
%while ()
|
|
||||||
% :wait_next_period();
|
|
||||||
% if (robotStarted) then (true)
|
|
||||||
% :send_command_robot(move);
|
|
||||||
% endif
|
|
||||||
%endwhile
|
|
||||||
%stop
|
|
||||||
%@enduml
|
|
||||||
\begin{figure}[htbp]
|
\begin{figure}[htbp]
|
||||||
\begin{center}
|
\begin{center}
|
||||||
\includegraphics[scale=0.4]{figures_pdf/activity/th_move}
|
\includegraphics[scale=0.4]{figures_pdf/activity/th_move}
|
||||||
|
@ -825,10 +744,9 @@ Les {\em event} et {\em event data ports} ont par défaut une file associée ave
|
||||||
@startuml
|
@startuml
|
||||||
skinparam monochrome true
|
skinparam monochrome true
|
||||||
start
|
start
|
||||||
:monitor = new ComMonitor()
|
:status = monitor.Open();
|
||||||
:err = monitor.Open();
|
if (status) then (failed)
|
||||||
if (err) then (failed)
|
:print("Unable to start server");
|
||||||
:print("Failed to start server");
|
|
||||||
stop
|
stop
|
||||||
else (succeed)
|
else (succeed)
|
||||||
:monitor.AcceptClient();
|
:monitor.AcceptClient();
|
||||||
|
@ -862,13 +780,25 @@ skinparam monochrome true
|
||||||
start
|
start
|
||||||
:serverOk?;
|
:serverOk?;
|
||||||
while ()
|
while ()
|
||||||
:msg = monitor.Read();
|
:msgRcv = monitor.Read();
|
||||||
if (msg.GetId()) then (MESSAGE_ROBOT_COM_OPEN)
|
if (msgRcv.CompareID(MESSAGE_MONITOR_LOST)) then (true)
|
||||||
:openComRobot!;
|
stop
|
||||||
else (MESSAGE_ROBOT_GO_FORWARD || MESSAGE_ROBOT_GO_BACKWARD
|
else (false)
|
||||||
|| MESSAGE_ROBOT_GO_LEFT || MESSAGE_ROBOT_GO_RIGHT
|
if (msgRcv.CompareID(MESSAGE_ROBOT_COM_OPEN)) then (true)
|
||||||
|| MESSAGE_ROBOT_STOP)
|
:openComRobot!;
|
||||||
:move = msg.GetId();
|
else (false)
|
||||||
|
if (msgRcv.CompareID(MESSAGE_ROBOT_START_WITHOUT_WD)) then (true)
|
||||||
|
:startRobot!;
|
||||||
|
else (false)
|
||||||
|
if (msgRcv.CompareID(MESSAGE_ROBOT_GO_FORWARD
|
||||||
|
|| msgRcv.CompareID(MESSAGE_ROBOT_GO_BACKWARD
|
||||||
|
|| msgRcv.CompareID(MESSAGE_ROBOT_GO_LEFT
|
||||||
|
|| msgRcv.CompareID(MESSAGE_ROBOT_GO_RIGHT
|
||||||
|
|| msgRcv.CompareID(MESSAGE_ROBOT_STOP)) then (true)
|
||||||
|
:move = msg.GetId();
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endwhile
|
endwhile
|
||||||
stop
|
stop
|
||||||
|
@ -885,14 +815,12 @@ start
|
||||||
while ()
|
while ()
|
||||||
:openComRobot?;
|
:openComRobot?;
|
||||||
:err = robot.Open();
|
:err = robot.Open();
|
||||||
: msg = new Message();
|
|
||||||
if (err) then (robot_ok)
|
if (err) then (robot_ok)
|
||||||
:msg.SetId(MESSAGE_ANSWER_ACK);
|
:msgSend = new Message(MESSAGE_ANSWER_ACK);
|
||||||
:messageToMon!msg;
|
|
||||||
else
|
else
|
||||||
:msg.SetId(MESSAGE_ANSWER_NACK);
|
:msgSend = new Message(MESSAGE_ANSWER_NACK);
|
||||||
:messageToMon!msg;
|
|
||||||
endif
|
endif
|
||||||
|
:messageToMon!msgSend;
|
||||||
endwhile
|
endwhile
|
||||||
stop
|
stop
|
||||||
@enduml
|
@enduml
|
||||||
|
@ -908,15 +836,10 @@ skinparam monochrome true
|
||||||
start
|
start
|
||||||
while ()
|
while ()
|
||||||
:startRobot?;
|
:startRobot?;
|
||||||
:err = robot.Write(new Message(MESSAGE_ROBOT_START_WITH_WD));
|
:msgSend = robot.Write(new Message(MESSAGE_ROBOT_START_WITH_WD));
|
||||||
: msg = new Message();
|
:messageToMon!msgSend;
|
||||||
if (err) then (robot_ok)
|
if (msgSend->getId()) then (MESSAGE_ANSWER_ACK)
|
||||||
:msg.SetId(MESSAGE_ANSWER_ACK);
|
:robotStarted = true;
|
||||||
:messageToMon!msg;
|
|
||||||
:robotStarted = true;
|
|
||||||
else
|
|
||||||
:msg.SetId(MESSAGE_ANSWER_NACK);
|
|
||||||
:messageToMon!msg;
|
|
||||||
endif
|
endif
|
||||||
endwhile
|
endwhile
|
||||||
stop
|
stop
|
||||||
|
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 18 KiB |
|
@ -335,7 +335,7 @@ void Tasks::MoveTask(void *arg) {
|
||||||
cout << "Start " << __PRETTY_FUNCTION__ << endl << flush;
|
cout << "Start " << __PRETTY_FUNCTION__ << endl << flush;
|
||||||
// Synchronization barrier (waiting that all tasks are starting)
|
// Synchronization barrier (waiting that all tasks are starting)
|
||||||
rt_sem_p(&sem_barrier, TM_INFINITE);
|
rt_sem_p(&sem_barrier, TM_INFINITE);
|
||||||
rt_task_set_periodic(NULL, TM_NOW, 1000000000);
|
rt_task_set_periodic(NULL, TM_NOW, 100000000);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
rt_task_wait_period(NULL);
|
rt_task_wait_period(NULL);
|
||||||
|
|