Commit eff0195a authored by Mariano Lizarraga's avatar Mariano Lizarraga

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

parents a7688a04 02c420a7
......@@ -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){
#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){
void SlugsMAV::emitPidSignal()
{
qDebug() << "\nSLUGS RECEIVED PID Message";
// qDebug() << "\nSLUGS RECEIVED PID Message";
emit slugsPidValues(uasId, mlSinglePid);
}
......
......@@ -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)
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;
}
}
......
......@@ -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,
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;
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -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)
{
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)
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)
// distancia = (float) hipotenusa;
}
/**
* Esta funcin 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
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);
......
......@@ -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);
......
......@@ -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 @@
</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 @@
</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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment