#include <roboorte_robottype.h>
// gnuplot graph
-#define GNUPLOT 1
+//#define GNUPLOT 0
// debug mode with connect Hokuyo
#define OFFLINE 1
connect(showMap, SIGNAL(toggled( bool )), robomonAtlantis, SLOT(showMap(bool)));
connect(showTrails, SIGNAL(toggled( bool )), robomonAtlantis, SLOT(showTrails(bool)));
connect(resetTrails, SIGNAL(triggered()), robomonAtlantis, SLOT(resetTrails()));
+ connect(showShapeDetect, SIGNAL(toggled( bool )), robomonAtlantis, SLOT(showShapeDetect(bool)));
connect(useOpenGL, SIGNAL(toggled( bool )), robomonAtlantis, SLOT(useOpenGL(bool)));
connect(showRobotRef, SIGNAL(toggled(bool)), robomonAtlantis->robotRefPos, SLOT(mySetVisible(bool)));
showTrails->setCheckable(true);
showMap = new QAction("Show &map", this);
showMap->setCheckable(true);
+ showShapeDetect = new QAction("Show s&hape detect", this);
+ showShapeDetect->setCheckable(true);
resetTrails = new QAction("Re&set trails", this);
useOpenGL = new QAction("Use &OpenGL", this);
m->addAction(showMap);
m->addAction(showTrails);
m->addAction(resetTrails);
+ m->addAction(showShapeDetect);
QMenu *robot = m->addMenu(tr("&Robot"));
m->addAction(useOpenGL);
QAction *resetTrails;
QAction *showTrails;
QAction *showMap;
+ QAction *showShapeDetect;
QAction *showRobotRef;
QAction *showRobotEst;
QAction *showRobotEstOdo;
trailPosIndepOdo->setVisible(show && robotEstPosIndepOdo->isVisible());
trailOdoPos->setVisible(show && robotEstPosOdo->isVisible());
}
+
+void RobomonAtlantis::showShapeDetect(bool show)
+{
+ if (show)
+ {
+
+ } else {
+
+ }
+}
void showMap(bool show);
void useOpenGL(bool use);
void showTrails(bool show);
+ void showShapeDetect(bool show);
void resetTrails();
private slots:
/************************************************************
return QRectF(tl, br);
}
+void HokuyoScan::drawShapeDetect(QPainter * painter)
+{
+ Shape_detect sd;
+
+ std::vector<int> input(HOKUYO_ARRAY_SIZE);
+
+ for (unsigned i = 0; i < HOKUYO_ARRAY_SIZE; i++)
+ input[i] = (int) data.data[i];
+
+ std::vector<Shape_detect::Line> output;
+ sd.shape_detect(input, output);
+
+ painter->setPen(QPen(Qt::green));
+
+ for (unsigned i = 0; i < output.size(); i++)
+ painter->drawLine(output[i].a.x, output[i].a.y, output[i].b.x, output[i].b.y);
+}
+
void HokuyoScan::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget)
{
int d;
point_num = 0;
}
}
+
+ drawShapeDetect(painter);
+
painter->drawPolygon(points, point_num);
}
#define HOKUYOSCAN_H
#include <robottype.h>
+#include <shape_detect.h>
#include <QRectF>
#include <QPainter>
#include <QStyleOptionGraphicsItem>
void setPosition(double x, double y, double phi);
void newScan(struct hokuyo_scan_type *scan);
+ void drawShapeDetect(QPainter * painter);
+
~HokuyoScan();
};
hokuyoscan.h
LIBS += -lm -lpthread -lmcl -llaser-nav -lrobodim -lrobomath -lroboorte \
- -lrobottype -lorte -lsharp -lmap -lactlib -lcornslib
+ -lrobottype -lorte -lsharp -lmap -lactlib -lcornslib -lshape_detect