]> rtime.felk.cvut.cz Git - eurobot/public.git/blobdiff - src/hokuyo/shape-detect/shape_detect.h
shapedet: Include examples in documentation directly from sources
[eurobot/public.git] / src / hokuyo / shape-detect / shape_detect.h
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.