From 80e1204f97844598711ebe1ec58fe9a5e5d4b3af Mon Sep 17 00:00:00 2001 From: lm Date: Tue, 1 Jun 2010 22:08:20 +0200 Subject: [PATCH] GPS MAV visualization and moving map tested and working --- src/uas/PxQuadMAV.cc | 2 +- src/uas/UAS.cc | 2 +- src/ui/MapWidget.cc | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/uas/PxQuadMAV.cc b/src/uas/PxQuadMAV.cc index 4afbef9..72beac8 100644 --- a/src/uas/PxQuadMAV.cc +++ b/src/uas/PxQuadMAV.cc @@ -19,7 +19,7 @@ void PxQuadMAV::receiveMessage(LinkInterface* link, mavlink_message_t message) UAS::receiveMessage(link, message); mavlink_message_t* msg = &message; - qDebug() << "PX RECEIVED" << msg->sysid << msg->compid << msg->msgid; + //qDebug() << "PX RECEIVED" << msg->sysid << msg->compid << msg->msgid; // Handle your special messages diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index 5ec3f53..32ee336 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -117,7 +117,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) addLink(link); } - qDebug() << "UAS RECEIVED" << message.sysid << message.compid << message.msgid; + //qDebug() << "UAS RECEIVED" << message.sysid << message.compid << message.msgid; if (message.sysid == uasId) { diff --git a/src/ui/MapWidget.cc b/src/ui/MapWidget.cc index e5cda8a..c077bd3 100644 --- a/src/ui/MapWidget.cc +++ b/src/ui/MapWidget.cc @@ -74,7 +74,7 @@ MapWidget::MapWidget(QWidget *parent) : QPushButton* zoomout = new QPushButton(QIcon(":/images/actions/list-remove.svg"), "", this); followgps = new QPushButton(QIcon(":/images/actions/system-lock-screen.svg"), "", this); followgps->setCheckable(true); - //gpsposition = new QLabel(); + // gpsposition = new QLabel(); zoomin->setMaximumWidth(50); zoomout->setMaximumWidth(50); followgps->setMaximumWidth(50); @@ -114,6 +114,7 @@ MapWidget::~MapWidget() void MapWidget::addUAS(UASInterface* uas) { mav = uas; + connect(uas, SIGNAL(globalPositionChanged(UASInterface*,double,double,double,quint64)), this, SLOT(updateGlobalPosition(UASInterface*,double,double,double,quint64))); } void MapWidget::updateGlobalPosition(UASInterface* uas, double lat, double lon, double alt, quint64 usec) @@ -123,7 +124,7 @@ void MapWidget::updateGlobalPosition(UASInterface* uas, double lat, double lon, QList points; // Points with a circle // A QPen can be used to customize the - QPen* pointpen = new QPen(QColor(0,255,0)); + QPen* pointpen = new QPen(uas->getColor()); pointpen->setWidth(3); points.append(new CirclePoint(lat, lon, alt, uas->getUASName(), Point::Middle, pointpen)); // points.append(new CirclePoint(8.275145, 50.016992, 15, "Wiesbaden-Mainz-Kastel, Johannes-Goßner-Straße", Point::Middle, pointpen)); @@ -156,7 +157,7 @@ void MapWidget::updateGlobalPosition(UASInterface* uas, double lat, double lon, void MapWidget::updatePosition(float time, double lat, double lon) { - gpsposition->setText(QString::number(time) + " / " + QString::number(lat) + " / " + QString::number(lon)); + //gpsposition->setText(QString::number(time) + " / " + QString::number(lat) + " / " + QString::number(lon)); if (followgps->isChecked()) { mc->setView(QPointF(lat, lon));