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.
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
*/
//#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.