void ReadRobotMessages::initializeFixedLandmarks() { addLandmark(0, 6.0, 4.5); addLandmark(1, 6.0, -4.5); addLandmark(2, 0.0, -4.5); addLandmark(3, 0.0, 4.5); addLandmark(4, 0.0, -1.5); addLandmark(5, 0.0, 1.5); addLandmark(6, 3.0, -4.5); addLandmark(7, 3.0, 4.5); addLandmark(8, 3.75, -2.25); addLandmark(9, 3.75, 2.25); }
int TriangulationSidebar::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: drawLine((*reinterpret_cast< QPointF(*)>(_a[1])),(*reinterpret_cast< QPointF(*)>(_a[2]))); break; case 1: intersectLines(); break; case 2: selectPoint((*reinterpret_cast< QPointF(*)>(_a[1])),(*reinterpret_cast< bool(*)>(_a[2]))); break; case 3: clearSelectedPoints(); break; case 4: selectLines((*reinterpret_cast< QList<QPair<QPointF,QPointF> >(*)>(_a[1]))); break; case 5: clearSelectedLines(); break; case 6: deletePoints(); break; case 7: deleteLines(); break; case 8: addPoint((*reinterpret_cast< QPointF(*)>(_a[1]))); break; case 9: addLine((*reinterpret_cast< QPointF(*)>(_a[1])),(*reinterpret_cast< QPointF(*)>(_a[2]))); break; case 10: addLandmark((*reinterpret_cast< QPointF(*)>(_a[1]))); break; case 11: on_landmarksListWidget_itemSelectionChanged(); break; case 12: on_deleteLines_clicked(); break; case 13: on_deletePoints_clicked(); break; case 14: on_intersectLinesButton_clicked(); break; case 15: on_linesListWidget_itemSelectionChanged(); break; case 16: on_drawLinesButton_clicked(); break; case 17: on_pointsListWidget_itemSelectionChanged(); break; case 18: recalculateDistanceAltitiude(); break; case 19: newBarometerData((*reinterpret_cast< ushort(*)>(_a[1])),(*reinterpret_cast< ulong(*)>(_a[2]))); break; case 20: newAccelerometerData((*reinterpret_cast< short(*)>(_a[1])),(*reinterpret_cast< short(*)>(_a[2])),(*reinterpret_cast< short(*)>(_a[3]))); break; case 21: newRobotElevation((*reinterpret_cast< double(*)>(_a[1])),(*reinterpret_cast< double(*)>(_a[2]))); break; default: ; } _id -= 22; } return _id; }
/* -------------------------------------------------------------------- */ void setLandmarks(const std::string lm_str) { std::string rest = lm_str; std::string current; while (rest.size() > 0) { size_t pos = rest.find(','); current = rest.substr(0, pos); if (pos == std::string::npos) rest.clear(); else rest = rest.substr(pos+1); addLandmark(current.c_str()); } } /* END SETLANDMARKS */
NavigationWidget::NavigationWidget(QWidget *parent) : QWidget(parent) { setupUi(this); //navView = new NavigationView(this); //verticalLayout->insertWidget(0, navView); connect(navView, SIGNAL(mouseAtGeoPos(QPointF)), this, SLOT(displayCoordinates(QPointF))); triangulationWidget = new TriangulationWidget(); connect(triangulationButton, SIGNAL(clicked()), triangulationWidget, SLOT(show())); connect(connectLineButton, SIGNAL(clicked()), navView, SLOT(plotLineForSelected())); connect(markIsectButton, SIGNAL(clicked()), navView, SLOT(plotLineIntersection())); connect(requestGPSButton, SIGNAL(clicked()), this, SLOT(sendGPSRequest())); connect(RobotController::gpsController(), SIGNAL(gotPositionUpdate(GPSPositionData)), this, SLOT(gotGPSUpdate(GPSPositionData))); connect(navView, SIGNAL(newPointAdded(QPointF)), triangulationSidebar, SLOT(addPoint(QPointF))); connect(navView, SIGNAL(newLineAdded(QPointF,QPointF)), triangulationSidebar, SLOT(addLine(QPointF,QPointF))); connect(navView, SIGNAL(newLandmarkAdded(QPointF)), triangulationSidebar, SLOT(addLandmark(QPointF))); connect(triangulationSidebar, SIGNAL(selectPoint(QPointF, bool)), navView, SLOT(selectPoint(QPointF, bool))); connect(triangulationSidebar, SIGNAL(clearSelectedPoints()), navView, SLOT(clearSelectedPoints())); connect(triangulationSidebar, SIGNAL(drawLine(QPointF,QPointF)), navView, SLOT(plotLineForPoints(QPointF,QPointF))); connect(triangulationSidebar, SIGNAL(selectLines(QList<QPair<QPointF,QPointF> >)), navView, SLOT(selectLines(QList<QPair<QPointF,QPointF> >))); connect(triangulationSidebar, SIGNAL(clearSelectedLines()), navView, SLOT(clearSelectedLines())); connect(triangulationSidebar, SIGNAL(intersectLines()), navView, SLOT(plotLineIntersection())); connect(triangulationSidebar, SIGNAL(deleteLines()), navView, SLOT(deleteSelectedLines())); connect(triangulationSidebar, SIGNAL(deletePoints()), navView, SLOT(deleteSelectedPoints())); // Test rover slots /*navView->setRoverPosition(QPointF(-110.791497, 38.406392)); navView->setRoverPosition(QPointF(-110.790889, 38.406158)); navView->setRoverPosition(QPointF(-110.790469, 38.405850)); navView->setRoverPosition(QPointF(-110.790257, 38.405575)); navView->setRoverPosition(QPointF(-110.790161, 38.405359)); navView->setRoverPosition(QPointF(-110.790177, 38.405195)); navView->setRoverPosition(QPointF(-110.790037, 38.404941)); navView->setRoverPosition(QPointF(-110.789840, 38.404890)); navView->setRoverPosition(QPointF(-110.789420, 38.404986)); navView->setRoverPosition(QPointF(-110.789219, 38.404973)); navView->setRoverHeading(92.334915);*/ //navView->setRoverPosition(QPointF(-123.212968,44.674917)); // adair //navView->setRoverPosition(QPointF(-123.274951,44.567328)); // covell parking lot }
void ParticleFilterLocalizer::addLandmark(std::string name, float x, float y) { addLandmark(new Landmark(name, x, y)); }