Browse Source

Merge branch 'experimental' of git://github.com/tecnosapiens/qgroundcontrol into mergeRemote

QGC4.4
Mariano Lizarraga 15 years ago
parent
commit
eff0195a8d
  1. 6
      src/uas/SlugsMAV.cc
  2. 7
      src/uas/UASWaypointManager.cc
  3. 4
      src/ui/SlugsDataSensorView.cc
  4. 3032
      src/ui/SlugsDataSensorView.ui
  5. 32
      src/ui/SlugsPadCameraControl.cpp
  6. 4
      src/ui/SlugsPadCameraControl.h
  7. 26
      src/ui/SlugsVideoCamControl.ui

6
src/uas/SlugsMAV.cc

@ -137,7 +137,7 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message) @@ -137,7 +137,7 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
case MAVLINK_MSG_ID_PID: //182
memset(&mlSinglePid,0,sizeof(mavlink_pid_t));
mavlink_msg_pid_decode(&message, &mlSinglePid);
qDebug() << "\nSLUGS RECEIVED PID Message = "<<mlSinglePid.idx;
// qDebug() << "\nSLUGS RECEIVED PID Message = "<<mlSinglePid.idx;
emit slugsPidValues(uasId, mlSinglePid);
@ -220,7 +220,7 @@ void SlugsMAV::emitSignals (void){ @@ -220,7 +220,7 @@ void SlugsMAV::emitSignals (void){
#ifdef MAVLINK_ENABLED_SLUGS
void SlugsMAV::emitGpsSignals (void){
qDebug()<<"After Emit GPS Signal"<<mlGpsData.fix_type;
// qDebug()<<"After Emit GPS Signal"<<mlGpsData.fix_type;
//ToDo Uncomment if. it was comment only to test
@ -248,7 +248,7 @@ void SlugsMAV::emitGpsSignals (void){ @@ -248,7 +248,7 @@ void SlugsMAV::emitGpsSignals (void){
void SlugsMAV::emitPidSignal()
{
qDebug() << "\nSLUGS RECEIVED PID Message";
// qDebug() << "\nSLUGS RECEIVED PID Message";
emit slugsPidValues(uasId, mlSinglePid);
}

7
src/uas/UASWaypointManager.cc

@ -31,6 +31,7 @@ This file is part of the QGROUNDCONTROL project @@ -31,6 +31,7 @@ This file is part of the QGROUNDCONTROL project
#include "UASWaypointManager.h"
#include "UAS.h"
#include "mavlink_types.h"
#define PROTOCOL_TIMEOUT_MS 2000 ///< maximum time to wait for pending messages until timeout
#define PROTOCOL_DELAY_MS 40 ///< minimum delay between sent messages
@ -600,22 +601,26 @@ void UASWaypointManager::sendWaypointRequest(quint16 seq) @@ -600,22 +601,26 @@ void UASWaypointManager::sendWaypointRequest(quint16 seq)
void UASWaypointManager::sendWaypoint(quint16 seq)
{
mavlink_message_t message;
qDebug() <<" WP Buffer count: "<<waypoint_buffer.count();
if (seq < waypoint_buffer.count())
{
mavlink_waypoint_t *wp;
wp = waypoint_buffer.at(seq);
wp->target_system = uas.getUASID();
wp->target_component = MAV_COMP_ID_WAYPOINTPLANNER;
emit updateStatusString(QString("sending waypoint ID %1 of %2 total").arg(wp->seq).arg(current_count));
qDebug() << "sent waypoint (" << wp->seq << ") to ID " << wp->target_system<<" WP Buffer count: "<<waypoint_buffer.count();
mavlink_msg_waypoint_encode(uas.mavlink->getSystemId(), uas.mavlink->getComponentId(), &message, wp);
uas.sendMessage(message);
MG::SLEEP::usleep(PROTOCOL_DELAY_MS * 1000);
qDebug() << "sent waypoint (" << wp->seq << ") to ID " << wp->target_system;
}
}

4
src/ui/SlugsDataSensorView.cc

@ -104,7 +104,7 @@ void SlugsDataSensorView::slugsGlobalPositionChanged(UASInterface *uas, @@ -104,7 +104,7 @@ void SlugsDataSensorView::slugsGlobalPositionChanged(UASInterface *uas,
ui->m_GpsLongitude->setText(QString::number(lon));
ui->m_GpsHeight->setText(QString::number(alt));
qDebug()<<"GPS Position = "<<lat<<" - "<<lon<<" - "<<alt;
//qDebug()<<"GPS Position = "<<lat<<" - "<<lon<<" - "<<alt;
}
@ -154,7 +154,7 @@ void SlugsDataSensorView::slugAttitudeChanged(UASInterface* uas, @@ -154,7 +154,7 @@ void SlugsDataSensorView::slugAttitudeChanged(UASInterface* uas,
ui->m_Pitch->setPlainText(QString::number(slugpitch));
ui->m_Yaw->setPlainText(QString::number(slugyaw));
qDebug()<<"Attitude change = "<<slugroll<<" - "<<slugpitch<<" - "<<slugyaw;
// qDebug()<<"Attitude change = "<<slugroll<<" - "<<slugpitch<<" - "<<slugyaw;
}

3032
src/ui/SlugsDataSensorView.ui

File diff suppressed because it is too large Load Diff

32
src/ui/SlugsPadCameraControl.cpp

@ -27,15 +27,12 @@ SlugsPadCameraControl::~SlugsPadCameraControl() @@ -27,15 +27,12 @@ SlugsPadCameraControl::~SlugsPadCameraControl()
void SlugsPadCameraControl::mouseMoveEvent(QMouseEvent *event)
{
//emit mouseMoveCoord(event->x(),event->y());
if(dragging)
{
if(abs(x1-event->x())>20 || abs(y1-event->y())>20)
{
getDeltaPositionPad(event->x(), event->y());
x1 = event->x();
y1 = event->y();
}
// getDeltaPositionPad(event->x(), event->y());
}
@ -54,7 +51,7 @@ void SlugsPadCameraControl::mouseReleaseEvent(QMouseEvent *event) @@ -54,7 +51,7 @@ void SlugsPadCameraControl::mouseReleaseEvent(QMouseEvent *event)
{
dragging = false;
//emit mouseReleaseCoord(event->x(),event->y());
//getDeltaPositionPad(event->x(), event->y());
getDeltaPositionPad(event->x(), event->y());
xFin = event->x();
yFin = event->y();
@ -105,6 +102,10 @@ void SlugsPadCameraControl::getDeltaPositionPad(int x2, int y2) @@ -105,6 +102,10 @@ void SlugsPadCameraControl::getDeltaPositionPad(int x2, int y2)
double bearing = localMeasures.x();
double dist = getDistPixel(y1,x1,y2,x2);
// this only convert real bearing to frame widget bearing
bearing = bearing +90;
if(bearing>= 360) bearing = bearing - 360;
if(((bearing > 330)&&(bearing < 360)) || ((bearing >= 0)&&(bearing <= 30)))
@ -210,16 +211,9 @@ double SlugsPadCameraControl::getDistPixel(int x1, int y1, int x2, int y2) @@ -210,16 +211,9 @@ double SlugsPadCameraControl::getDistPixel(int x1, int y1, int x2, int y2)
// distancia = (float) hipotenusa;
}
/**
* Esta función xxxxxxxxx
* @param double lat1 -->
* @param double lon1 -->
* @param double lat2 -->
* @param double lon2 -->
* @param ref double rumbo -->
* @param ref double distancia -->
*/
QPointF SlugsPadCameraControl::ObtenerMarcacionDistanciaPixel(double lon1, double lat1, double lon2, double lat2)
QPointF SlugsPadCameraControl::ObtenerMarcacionDistanciaPixel(double lon1, double lat1,
double lon2, double lat2)
{
double cateto_opuesto,cateto_adyacente, hipotenusa, distancia, marcacion;
@ -256,9 +250,7 @@ QPointF SlugsPadCameraControl::ObtenerMarcacionDistanciaPixel(double lon1, doubl @@ -256,9 +250,7 @@ QPointF SlugsPadCameraControl::ObtenerMarcacionDistanciaPixel(double lon1, doubl
else if((lat1 == lat2) && (lon1 == lon2)) //0
marcacion = 0.0;
// this only convert real bearing to frame widget bearing
marcacion = marcacion +90;
if(marcacion>= 360) marcacion = marcacion - 360;
return QPointF(marcacion,distancia);

4
src/ui/SlugsPadCameraControl.h

@ -19,12 +19,16 @@ public: @@ -19,12 +19,16 @@ public:
public slots:
void getDeltaPositionPad(int x, int y);
double getDistPixel(int x1, int y1, int x2, int y2);
QPointF ObtenerMarcacionDistanciaPixel(double lon1, double lat1, double lon2, double lat2);
QPointF getPointBy_BearingDistance(double lat1, double lon1, double rumbo, double distancia);
signals:
void mouseMoveCoord(int x, int y);
void mousePressCoord(int x, int y);

26
src/ui/SlugsVideoCamControl.ui

@ -22,10 +22,10 @@ @@ -22,10 +22,10 @@
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_x">
<property name="mouseTracking">
<bool>true</bool>
@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
</property>
</widget>
</item>
<item>
<item row="0" column="1">
<widget class="QLabel" name="label_y">
<property name="mouseTracking">
<bool>true</bool>
@ -45,21 +45,17 @@ @@ -45,21 +45,17 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_dir">
<item row="1" column="1">
<widget class="QCheckBox" name="viewCamBordeatMap_checkBox">
<property name="text">
<string>Camera Pos</string>
<string>Camera at Map</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="viewCamBordeatMap_checkBox">
<item row="1" column="0">
<widget class="QLabel" name="label_dir">
<property name="text">
<string>Camera at Map</string>
<string>Camera Pos</string>
</property>
</widget>
</item>

Loading…
Cancel
Save