Browse Source

Merge superviseur/robot depuis la branche dev

Sébastien DI MERCURIO 2 years ago
parent
commit
491fae55d5

+ 1
- 0
software/raspberry/superviseur-robot/README.md View File

@@ -0,0 +1 @@
1
+# TP-RT_C

+ 6
- 0
software/raspberry/superviseur-robot/lib/.gitignore View File

@@ -0,0 +1,6 @@
1
+CMakeFiles/
2
+
3
+libdestjil.a
4
+Makefile
5
+*.cmake
6
+

+ 0
- 7
software/raspberry/superviseur-robot/lib/camera.cpp View File

@@ -22,13 +22,6 @@
22 22
 using namespace cv;
23 23
 
24 24
 /**
25
- * Create an object for accessing camera with default values (size = sm and 
26
- * fps = 10)
27
- */
28
-Camera::Camera():Camera(sm, 10){
29
-}
30
-
31
-/**
32 25
  * Create an object for accessing camera
33 26
  * @param size Size of picture to grab (@see captureSize)
34 27
  * @param fps speed of sampling

+ 0
- 7
software/raspberry/superviseur-robot/lib/camera.h View File

@@ -35,16 +35,9 @@ enum captureSize {xs, sm, md, lg};
35 35
  * Class for camera (image grab)
36 36
  * 
37 37
  * @brief Class for camera (image grab)
38
- * How to grab an image and send it to the monitor:
39
- *  1. Grab an image, for example:
40
- *          Img * img = new Img(cam->Grab());
41
- *  2. Instanciate the message to send the image:
42
- *          MessageImg *msgImg = new MessageImg(MESSAGE_CAM_IMAGE, img);
43 38
  */
44 39
 class Camera {
45 40
 public:
46
-    Camera();
47
-    
48 41
     /**
49 42
      * Create an object for accessing camera
50 43
      * @param size Size of picture to grab (@see captureSize)

+ 5
- 7
software/raspberry/superviseur-robot/lib/messages.cpp View File

@@ -131,7 +131,7 @@ Message* Message::Copy() {
131 131
 }
132 132
 
133 133
 /**
134
- * Check message ID
134
+ * Get message ID
135 135
  * @return Current message ID
136 136
  */
137 137
 bool Message::CheckID(MessageID id) {
@@ -162,6 +162,7 @@ MessageInt::MessageInt() {
162 162
  */
163 163
 MessageInt::MessageInt(MessageID id, int val) {
164 164
     MessageInt::SetID(id);
165
+
165 166
     value = val;
166 167
 }
167 168
 
@@ -281,7 +282,6 @@ bool MessageString::CheckID(MessageID id) {
281 282
  * Create a new, empty image message
282 283
  */
283 284
 MessageImg::MessageImg() {
284
-    this->messageID = MESSAGE_CAM_IMAGE;
285 285
     image = NULL;
286 286
 }
287 287
 
@@ -362,7 +362,6 @@ bool MessageImg::CheckID(MessageID id) {
362 362
  * Create a new, empty battery message
363 363
  */
364 364
 MessageBattery::MessageBattery() {
365
-    this->messageID = MESSAGE_ROBOT_BATTERY_LEVEL;
366 365
     this->level = BATTERY_UNKNOWN;
367 366
 }
368 367
 
@@ -456,10 +455,9 @@ bool MessageBattery::CheckID(MessageID id) {
456 455
 /* class MessagePosition */
457 456
 
458 457
 /**
459
- * Create a new, empty position message
458
+ * Create a new, empty string message
460 459
  */
461 460
 MessagePosition::MessagePosition() {
462
-    this->messageID = MESSAGE_CAM_POSITION;
463 461
     this->pos.angle = 0.0;
464 462
     this->pos.robotId = 0;
465 463
     this->pos.center.x=0.0;
@@ -469,9 +467,9 @@ MessagePosition::MessagePosition() {
469 467
 }
470 468
 
471 469
 /**
472
- * Create a new position message, with given ID and position
470
+ * Create a new string message, with given ID and string
473 471
  * @param id Message ID
474
- * @param pos Message position
472
+ * @param s Message string
475 473
  * @throw std::runtime_error if message ID is incompatible with string data
476 474
  */
477 475
 MessagePosition::MessagePosition(MessageID id, Position& pos) {

+ 2
- 11
software/raspberry/superviseur-robot/lib/messages.h View File

@@ -47,7 +47,7 @@ typedef enum {
47 47
     MESSAGE_ROBOT_COM_OPEN,
48 48
     MESSAGE_ROBOT_COM_CLOSE,
49 49
          
50
-    // Messages for camera from Monitor to Supervisor
50
+    // Messages for camera   
51 51
     MESSAGE_CAM_OPEN,
52 52
     MESSAGE_CAM_CLOSE,
53 53
     MESSAGE_CAM_ASK_ARENA,
@@ -55,8 +55,6 @@ typedef enum {
55 55
     MESSAGE_CAM_ARENA_INFIRM,
56 56
     MESSAGE_CAM_POSITION_COMPUTE_START,
57 57
     MESSAGE_CAM_POSITION_COMPUTE_STOP,
58
-            
59
-    // Messages for camera from Supervisor to Monitor 
60 58
     MESSAGE_CAM_POSITION,
61 59
     MESSAGE_CAM_IMAGE,
62 60
             
@@ -501,14 +499,7 @@ protected:
501 499
  * Message class for holding battery level, based on Message class
502 500
  * 
503 501
  * @brief Battery message class
504
- * How to use:
505
- *  1. Ask the battery level to the robot:
506
- *      MessageBattery * msg;
507
- *      msg = (MessageBattery*)robot.Write(new Message(MESSAGE_ROBOT_BATTERY_GET));
508
- *  2. Send the message, for example:
509
- *          monitor.send(msg);
510
- *      or
511
- *          WriteInQueue(&q_messageToMon, msg);
502
+ * 
512 503
  */
513 504
 class MessageBattery : public Message {
514 505
 public:

+ 1
- 1
software/raspberry/superviseur-robot/nbproject/private/configurations.xml View File

@@ -41,7 +41,7 @@
41 41
     </conf>
42 42
     <conf name="Debug__RPI_" type="1">
43 43
       <toolsSet>
44
-        <developmentServer>pi@10.105.1.08:22</developmentServer>
44
+        <developmentServer>pi@10.105.1.13:22</developmentServer>
45 45
         <platform>2</platform>
46 46
       </toolsSet>
47 47
       <dbx_gdbdebugger version="1">

+ 3
- 3
software/raspberry/superviseur-robot/nbproject/private/private.xml View File

@@ -7,12 +7,12 @@
7 7
     <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
8 8
     <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
9 9
         <group>
10
-            <file>file:/home_pers/pehladik/dumber/software/raspberry/superviseur-robot/lib/camera.h</file>
11
-            <file>file:/home_pers/pehladik/dumber/software/raspberry/superviseur-robot/lib/messages.cpp</file>
10
+            <file>file:/home_pers/pehladik/dumber/software/raspberry/superviseur-robot/main.cpp</file>
12 11
             <file>file:/home_pers/pehladik/dumber/software/raspberry/superviseur-robot/tasks.h</file>
13
-            <file>file:/home_pers/pehladik/dumber/software/raspberry/superviseur-robot/lib/camera.cpp</file>
14 12
             <file>file:/home_pers/pehladik/dumber/software/raspberry/superviseur-robot/tasks.cpp</file>
13
+            <file>file:/home_pers/pehladik/dumber/software/raspberry/superviseur-robot/lib/comrobot.h</file>
15 14
             <file>file:/home_pers/pehladik/dumber/software/raspberry/superviseur-robot/lib/messages.h</file>
15
+            <file>file:/home_pers/pehladik/dumber/software/raspberry/superviseur-robot/lib/commonitor.h</file>
16 16
         </group>
17 17
     </open-files>
18 18
 </project-private>

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

@@ -64,7 +64,7 @@ private:
64 64
     /**********************************************************************/
65 65
     ComMonitor monitor;
66 66
     ComRobot robot;
67
-    int robotStarted = 0;
67
+    int robotStarted;
68 68
     int move = MESSAGE_ROBOT_STOP;
69 69
     
70 70
     /**********************************************************************/

Loading…
Cancel
Save