]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
shapedet: Include examples in documentation directly from sources
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 17 Mar 2011 07:57:01 +0000 (08:57 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 17 Mar 2011 07:57:01 +0000 (08:57 +0100)
This ensures that the documentation is up-to-date and in a compilable
state.

src/Doxyfile
src/Makefile [new file with mode: 0644]
src/hokuyo/shape-detect/offline.cc
src/hokuyo/shape-detect/online.cc
src/hokuyo/shape-detect/shape_detect.h

index b6c883c6293215b55dfbd121d31dd52046d55bd3..b6d2cbe595947e8bd6dd9682d5f4ab0739cb6727 100644 (file)
@@ -603,7 +603,8 @@ EXCLUDE_SYMBOLS        =
 # the \include command).
 
 EXAMPLE_PATH           = pathplan/test/ \
-                         fsm/example
+                         fsm/example \
+                        .
 
 # If the value of the EXAMPLE_PATH tag contains directories, you can use the 
 # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
@@ -617,7 +618,7 @@ EXAMPLE_PATTERNS       =
 # commands irrespective of the value of the RECURSIVE tag. 
 # Possible values are YES and NO. If left blank NO is used.
 
-EXAMPLE_RECURSIVE      = NO
+EXAMPLE_RECURSIVE      = YES
 
 # The IMAGE_PATH tag can be used to specify one or more files or 
 # directories that contain image that are included in the documentation (see 
diff --git a/src/Makefile b/src/Makefile
new file mode 100644 (file)
index 0000000..0571221
--- /dev/null
@@ -0,0 +1,2 @@
+all doc:
+       doxygen
index 61d13dc286f4b426f59c4a204c1fd44b57aa6ce6..639bd1539eaf337aa91ce19600f3578c8f7db218 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * @file main.cc
+ * @file
  * @author Martin Synek
  * @author Michal Sojka
  * @date 11/02/25
index 192193f29e1d2028f11486ff0966e563c9508121..0e75299bb399e2c22846ef7f430bacd8c9660786 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * @file main.cc
+ * @file
  * @author Martin Synek
  * @author Michal Sojka
  * @date 11/02/25
  * @ingroup shapedet
  */
 
-/* Copyright: TODO
- *
- */
-
-
 #include <shape_detect.h>
 #include <roboorte_robottype.h>
 
-struct robottype_orte_data orte;
-
 void rcv_hokuyo_scan_cb(const ORTERecvInfo *info, void *vinstance,
                        void *recvCallBackParam)
 {
@@ -49,6 +42,8 @@ void rcv_hokuyo_scan_cb(const ORTERecvInfo *info, void *vinstance,
        }
 }
 
+struct robottype_orte_data orte;
+
 int robot_init_orte()
 {
        int rv = 0;
index 0a7a7cc3394cef01ad5284a7181875f48ca713be..89ac1f71c7779462c5c61ecb4ac05967c64866fe 100644 (file)
@@ -48,7 +48,7 @@ or from scanned data, which are saved in a file. GNUPLOT can be used for graphic
 output in debug mode or output vector can be saved in a file for next processing
 in any application.
 
-For setting above properties is used directives define GNUPLOT and OFFLINE.
+For setting above properties is used directives define GNUPLOT.
 
 For debugging can be used methods introduced in file main.cc.
 
@@ -62,68 +62,7 @@ shape_detect with applicable parameters.
 
 The first example is work illustration with connected laser scanner Hokuyo.
 
-\code
-void rcv_hokuyo_scan_cb(const ORTERecvInfo *info, void *vinstance,
-                       void *recvCallBackParam)
-{
-       Shape_detect sd;
-
-       struct hokuyo_scan_type *instance = (struct hokuyo_scan_type *)vinstance;
-       static int count = 0;
-
-       switch (info->status) {
-               case NEW_DATA: {
-                       printf("Scan\n");
-                       if (++count >= 2) {
-                               printf("Detect\n");
-                               count = 0;
-                               
-                               std::vector<Shape_detect::Line> output;
-
-                               sd.prepare((unsigned short) instance->data);
-                               sd.line_detect(output);
-                       }
-                       break;
-               }
-               case DEADLINE:
-                       printf("Deadline\n");
-                       break;
-       }
-}
-\endcode
-
-The second example shows values reading from datafile.
-
-\code
-Shape_detect sd;
-
-unsigned short laser_scan[HOKUYO_ARRAY_SIZE];
-std::ifstream infile(argv[1], std::ios_base::in);
-
-// line input file
-std::string line;
-
-// number from input file
-int number;
-
-int idx = 0;
-    
-while (std::getline(infile, line, '\n')) {
-       std::stringstream strStream(line);
-       strStream >> number;
-       laser_scan[idx] = number;
-       idx++;
-}
-       
-std::vector<Shape_detect::Line> lines;
-std::vector<Shape_detect::Arc> arcs;
-
-// shape detect
-sd.prepare(laser_scan);
-sd.line_detect(lines);
-
-\endcode
+\include hokuyo/shape-detect/online.cc
 
 \section shapedet_ref References
 
@@ -160,14 +99,6 @@ http://mathpages.com/home/kmath110.htm
  */
 //#define GNUPLOT
 
-/**
- * Debug mode with connect Hokuyo.
- * True  -> Hokuyo not connect and input data vector is reading from file.
- * False -> Hokuyo is connect.
- * @ingroup shapedet
- */
-#define OFFLINE 1
-
 /**
  * There are detected line segments in input array of measured data (laser_scan)
  * by using perpendicular line regression.