Browse Source

mise a jour dossie de conception

PE Hladik 2 years ago
parent
commit
68ef76587e

+ 37
- 114
doc/sujets/tex/conception/conception_robot.tex View File

@@ -93,7 +93,7 @@
93 93
 {\scriptsize Institut National des Sciences Appliquées de Toulouse}\\
94 94
 ---\\
95 95
 Dossier de conception \\
96
-{\large Version 2.0.$\beta$ (\today)}\\
96
+{\large Version 2.0.1 (\today)}\\
97 97
 {\scriptsize Référent pédagogique : P.-E. Hladik (\texttt{pehladik@insa-toulouse.fr})}\\
98 98
 ---
99 99
 }
@@ -248,19 +248,7 @@ Jusqu'ici tout a été réalisé au brouillon par le concepteur, il faut donc ma
248 248
 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).
249 249
 
250 250
 \subsection{Thread th\_server}
251
-%@startuml
252
-%skinparam monochrome true
253
-%start
254
-%:err = run_nodejs();
255
-%if (err) then (failed)
256
-%    :print("Failed to start nodejs");
257
-%stop
258
-%else (succeed)
259
-%    :open_server();
260
-%    :serverOk!;
261
-%    stop
262
-%endif
263
-%@enduml
251
+
264 252
  \begin{figure}[htbp]
265 253
 \begin{center}
266 254
 \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
270 258
 \FloatBarrier
271 259
 
272 260
 \subsection{Thread th\_sendToMon}
273
-%@startuml
274
-%skinparam monochrome true
275
-%start
276
-%:serverOK?;
277
-%while ()
278
-%  :messageToMon?header,data;
279
-%  :send_message_to_monitor(header,data);
280
-%endwhile
281
-%stop
282
-%@enduml
261
+
283 262
  \begin{figure}[htbp]
284 263
 \begin{center}
285 264
 \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
290 269
 
291 270
 
292 271
 \subsection{Thread th\_receiveFromMon}
293
-%@startuml
294
-%skinparam monochrome true
295
-%start
296
-%:serverOk?;
297
-%while ()
298
-%  :receive_message_from_monitor(header,data);
299
-%  if (header) then (HEADER_MTS_COM_DMB)
300
-%    if (data) then (OPEN_COM_DMB)
301
-%    :openComRobot!;
302
-%    endif
303
-%    else (HEADER_MTS_DMB_ORDER)
304
-%    if (data) then (DMB_START_WITHOUT_WD)
305
-%    :startRobot!;
306
-%    else (DMB_GO_FORWARD || DMB_GO_BACK 
307
-%    || DMB_GO_LEFT || DMB_GO_RIGHT 
308
-%    || DMB_STOP_MOVE)
309
-%    :move = data;
310
-%    endif
311
-%  endif
312
-%endwhile
313
-%stop
314
-%@enduml
315
-%
272
+
316 273
  \begin{figure}[htbp]
317 274
 \begin{center}
318 275
 \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
322 279
 \FloatBarrier
323 280
 
324 281
 \subsection{Thread th\_openComRobot}
325
-%@startuml
326
-%skinparam monochrome true
327
-%start
328
-%while ()
329
-%  :openComRobot?;
330
-%  :err = open_communication_robot();
331
-%  if (err) then (robot_ok)
332
-%  :messageToMon!ACK;
333
-%  else
334
-%  :messageToMon!NAC;
335
-%  endif
336
-%endwhile
337
-%stop
282
+
338 283
  \begin{figure}[htbp]
339 284
 \begin{center}
340 285
 \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
343 288
 \end{figure}
344 289
 \FloatBarrier
345 290
 
346
-\subsection{Thread th\_openStartRobot}
347
-%@startuml
348
-%skinparam monochrome true
349
-%start
350
-%while ()
351
-%  :startRobot?;
352
-%  :err = send_command_robot(START_WITHOUT_WD);
353
-%  if (err) then (robot_ok)
354
-%  :messageToMon!ACK;
355
-%  :robotStarted = true;
356
-%  else
357
-%  :messageToMon!NAC;
358
-%  endif
359
-%endwhile
360
-%stop
361
-%@enduml
362
-%
291
+\subsection{Thread th\_startRobot}
292
+
363 293
  \begin{figure}[htbp]
364 294
 \begin{center}
365 295
 \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
369 299
 \FloatBarrier
370 300
 
371 301
 \subsection{Thread th\_move}
372
-%@startuml
373
-%skinparam monochrome true
374
-%start
375
-%:start_period(100 ms);
376
-%while ()
377
-%  :wait_next_period();
378
-%  if (robotStarted) then (true)
379
-%  :send_command_robot(move);
380
-%  endif
381
-%endwhile
382
-%stop
383
-%@enduml
302
+
384 303
  \begin{figure}[htbp]
385 304
 \begin{center}
386 305
 \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
825 744
 @startuml
826 745
 skinparam monochrome true
827 746
 start
828
-:monitor = new ComMonitor()
829
-:err = monitor.Open();
830
-if (err) then (failed)
831
-    :print("Failed to start server");
747
+:status = monitor.Open();
748
+if (status) then (failed)
749
+    :print("Unable to start server");
832 750
 stop
833 751
 else (succeed)
834 752
     :monitor.AcceptClient();
@@ -862,13 +780,25 @@ skinparam monochrome true
862 780
 start
863 781
 :serverOk?;
864 782
 while ()
865
-  :msg = monitor.Read();
866
-  if (msg.GetId()) then (MESSAGE_ROBOT_COM_OPEN)
867
-    :openComRobot!;
868
-  else (MESSAGE_ROBOT_GO_FORWARD || MESSAGE_ROBOT_GO_BACKWARD 
869
-    || MESSAGE_ROBOT_GO_LEFT || MESSAGE_ROBOT_GO_RIGHT 
870
-    || MESSAGE_ROBOT_STOP)
871
-    :move = msg.GetId();
783
+  :msgRcv = monitor.Read();
784
+  if (msgRcv.CompareID(MESSAGE_MONITOR_LOST)) then (true)
785
+    stop
786
+  else (false)
787
+    if (msgRcv.CompareID(MESSAGE_ROBOT_COM_OPEN)) then (true)
788
+      :openComRobot!;
789
+        else (false)
790
+        if (msgRcv.CompareID(MESSAGE_ROBOT_START_WITHOUT_WD)) then (true)
791
+            :startRobot!;
792
+        else (false)
793
+            if (msgRcv.CompareID(MESSAGE_ROBOT_GO_FORWARD
794
+                || msgRcv.CompareID(MESSAGE_ROBOT_GO_BACKWARD 
795
+                || msgRcv.CompareID(MESSAGE_ROBOT_GO_LEFT
796
+                || msgRcv.CompareID(MESSAGE_ROBOT_GO_RIGHT
797
+                || msgRcv.CompareID(MESSAGE_ROBOT_STOP)) then (true)
798
+                :move = msg.GetId();
799
+            endif
800
+        endif
801
+    endif
872 802
   endif
873 803
 endwhile
874 804
 stop
@@ -885,14 +815,12 @@ start
885 815
 while ()
886 816
   :openComRobot?;
887 817
   :err = robot.Open();
888
-  : msg = new Message();
889 818
   if (err) then (robot_ok)
890
-    :msg.SetId(MESSAGE_ANSWER_ACK);
891
-    :messageToMon!msg;
819
+    :msgSend = new Message(MESSAGE_ANSWER_ACK);
892 820
   else
893
-    :msg.SetId(MESSAGE_ANSWER_NACK);
894
-    :messageToMon!msg;
821
+    :msgSend = new Message(MESSAGE_ANSWER_NACK);
895 822
   endif
823
+  :messageToMon!msgSend;
896 824
 endwhile
897 825
 stop
898 826
 @enduml
@@ -908,15 +836,10 @@ skinparam monochrome true
908 836
 start
909 837
 while ()
910 838
   :startRobot?;
911
-  :err = robot.Write(new Message(MESSAGE_ROBOT_START_WITH_WD));
912
-  : msg = new Message();
913
-  if (err) then (robot_ok)
914
-    :msg.SetId(MESSAGE_ANSWER_ACK);
915
-    :messageToMon!msg;
916
-  :robotStarted = true;
917
-  else
918
-    :msg.SetId(MESSAGE_ANSWER_NACK);
919
-    :messageToMon!msg;
839
+  :msgSend = robot.Write(new Message(MESSAGE_ROBOT_START_WITH_WD));
840
+  :messageToMon!msgSend;
841
+  if (msgSend->getId()) then (MESSAGE_ANSWER_ACK)
842
+    :robotStarted = true;
920 843
   endif
921 844
 endwhile
922 845
 stop

+ 622
- 553
doc/sujets/tex/conception/figures/conception/diag_fonc2.graffle
File diff suppressed because it is too large
View File


BIN
doc/sujets/tex/conception/figures_pdf/activity/th_openComRobot.png View File


BIN
doc/sujets/tex/conception/figures_pdf/activity/th_receiveFromMon.png View File


BIN
doc/sujets/tex/conception/figures_pdf/activity/th_server.png View File


BIN
doc/sujets/tex/conception/figures_pdf/activity/th_startRobot.png View File


BIN
doc/sujets/tex/conception/figures_pdf/fonc/AADL.pdf View File


+ 1
- 1
software/raspberry/superviseur-robot/tasks.cpp View File

@@ -335,7 +335,7 @@ void Tasks::MoveTask(void *arg) {
335 335
     cout << "Start " << __PRETTY_FUNCTION__ << endl << flush;
336 336
     // Synchronization barrier (waiting that all tasks are starting)
337 337
     rt_sem_p(&sem_barrier, TM_INFINITE);
338
-    rt_task_set_periodic(NULL, TM_NOW, 1000000000);
338
+    rt_task_set_periodic(NULL, TM_NOW, 100000000);
339 339
 
340 340
     while (1) {
341 341
         rt_task_wait_period(NULL);

Loading…
Cancel
Save