Commit 4c6bd390 authored by Mariano Lizarraga's avatar Mariano Lizarraga

Merge branch 'dev' of git://github.com/pixhawk/qgroundcontrol into dev

parents 84dfb69d ac8a86ef
...@@ -27,3 +27,7 @@ deploy/linux ...@@ -27,3 +27,7 @@ deploy/linux
controller_log* controller_log*
user_config.pri user_config.pri
*.app *.app
*.ncb
*.vcproj
*.sln
\ No newline at end of file
[rgb] [rgb]
principal_point\x=313.67245 principal_point\x=314.70228964
principal_point\y=264.06175 principal_point\y=264.30478827
focal_length\x=527.44654 focal_length\x=527.91246131
focal_length\y=527.40652 focal_length\y=527.91246131
distortion\k1=0.20780 distortion\k1=0.20496745
distortion\k2=-0.34320 distortion\k2=-0.36341243
distortion\k3=0.00139 distortion\k3=0.00000000
distortion\k4=0.00061 distortion\k4=0.00000000
distortion\k5=0.00000 distortion\k5=0.00000000
[depth] [depth]
principal_point\x=313.23400 principal_point\x=311.88621344
principal_point\y=246.13447 principal_point\y=247.63447078
focal_length\x=587.62150 focal_length\x=593.89813561
focal_length\y=587.51184 focal_length\y=593.89813561
distortion\k1=0.01063 distortion\k1=0.00000000
distortion\k2=-0.04479 distortion\k2=0.00000000
distortion\k3=-0.00073 distortion\k3=0.00000000
distortion\k4=0.00081 distortion\k4=0.00000000
distortion\k5=0.00000 distortion\k5=0.00000000
[transform] [transform]
R11=0.99994 R11=0.999982
R12=0.00098102 R12=0.000556
R13=0.010900 R13=0.005927
R21=-0.00097894 R21=-0.000563
R22=1.0 R22=0.999999
R23=-0.00019534 R23=0.001235
R33=-0.010900 R33=-0.005926
R32=0.00018466 R32=-0.001239
R33=0.99994 R33=0.999982
Tx=-0.02581986 Tx=-0.024287
Ty=-0.0130948 Ty=0.001018
Tz=-0.0047681 Tz=-0.015195
baseline=0.06061
disparity_offset=1092.3403
...@@ -34,10 +34,10 @@ release { ...@@ -34,10 +34,10 @@ release {
# DEFINES += QT_NO_WARNING_OUTPUT # DEFINES += QT_NO_WARNING_OUTPUT
} }
QMAKE_PRE_LINK += echo "Copying files" QMAKE_POST_LINK += echo "Copying files"
#QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/debug/. #QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/debug/.
#QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/release/. #QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/release/.
# MAC OS X # MAC OS X
macx { macx {
...@@ -77,11 +77,11 @@ macx { ...@@ -77,11 +77,11 @@ macx {
ICON = $$BASEDIR/images/icons/macx.icns ICON = $$BASEDIR/images/icons/macx.icns
# Copy audio files if needed # Copy audio files if needed
QMAKE_PRE_LINK += && cp -rf $$BASEDIR/audio $$TARGETDIR/qgroundcontrol.app/Contents/MacOs/. QMAKE_POST_LINK += && cp -rf $$BASEDIR/audio $$TARGETDIR/qgroundcontrol.app/Contents/MacOs/.
# Copy google earth starter file # Copy google earth starter file
QMAKE_PRE_LINK += && cp -f $$BASEDIR/images/earth.html $$TARGETDIR/qgroundcontrol.app/Contents/MacOs/. QMAKE_POST_LINK += && cp -f $$BASEDIR/images/earth.html $$TARGETDIR/qgroundcontrol.app/Contents/MacOs/.
# Copy model files # Copy model files
#QMAKE_PRE_LINK += && cp -f $$BASEDIR/models/*.dae $$TARGETDIR/qgroundcontrol.app/Contents/MacOs/. #QMAKE_POST_LINK += && cp -f $$BASEDIR/models/*.dae $$TARGETDIR/qgroundcontrol.app/Contents/MacOs/.
exists(/Library/Frameworks/osg.framework):exists(/Library/Frameworks/OpenThreads.framework) { exists(/Library/Frameworks/osg.framework):exists(/Library/Frameworks/OpenThreads.framework) {
# No check for GLUT.framework since it's a MAC default # No check for GLUT.framework since it's a MAC default
...@@ -155,7 +155,7 @@ linux-g++ { ...@@ -155,7 +155,7 @@ linux-g++ {
#DESTDIR = $$BUILDDIR/release #DESTDIR = $$BUILDDIR/release
} }
QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/. QMAKE_POST_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
INCLUDEPATH += /usr/include \ INCLUDEPATH += /usr/include \
/usr/include/qt4/phonon /usr/include/qt4/phonon
...@@ -179,7 +179,8 @@ linux-g++ { ...@@ -179,7 +179,8 @@ linux-g++ {
message("Building support for OpenSceneGraph") message("Building support for OpenSceneGraph")
DEPENDENCIES_PRESENT += osg DEPENDENCIES_PRESENT += osg
# Include OpenSceneGraph libraries # Include OpenSceneGraph libraries
LIBS += -losg LIBS += -losg \
-losgViewer
DEFINES += QGC_OSG_ENABLED DEFINES += QGC_OSG_ENABLED
} }
...@@ -187,8 +188,7 @@ linux-g++ { ...@@ -187,8 +188,7 @@ linux-g++ {
message("Building support for osgEarth") message("Building support for osgEarth")
DEPENDENCIES_PRESENT += osgearth DEPENDENCIES_PRESENT += osgearth
# Include osgEarth libraries # Include osgEarth libraries
LIBS += -losgViewer \ LIBS += -losgEarth \
-losgEarth \
-losgEarthUtil -losgEarthUtil
DEFINES += QGC_OSGEARTH_ENABLED DEFINES += QGC_OSGEARTH_ENABLED
} }
...@@ -202,10 +202,15 @@ linux-g++ { ...@@ -202,10 +202,15 @@ linux-g++ {
DEFINES += QGC_LIBFREENECT_ENABLED DEFINES += QGC_LIBFREENECT_ENABLED
} }
QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/debug/. debug {
QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/release/. QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/debug/.
QMAKE_PRE_LINK += && cp -rf $$BASEDIR/data $$TARGETDIR/debug/. QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$TARGETDIR/debug/.
QMAKE_PRE_LINK += && cp -rf $$BASEDIR/data $$TARGETDIR/release/. }
release {
QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/release/.
QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$TARGETDIR/release/.
}
# osg/osgEarth dynamic casts might fail without this compiler option. # osg/osgEarth dynamic casts might fail without this compiler option.
# see http://osgearth.org/wiki/FAQ for details. # see http://osgearth.org/wiki/FAQ for details.
...@@ -223,7 +228,7 @@ linux-g++-64 { ...@@ -223,7 +228,7 @@ linux-g++-64 {
#DESTDIR = $$BUILDDIR/release #DESTDIR = $$BUILDDIR/release
} }
QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/. QMAKE_POST_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
INCLUDEPATH += /usr/include \ INCLUDEPATH += /usr/include \
/usr/include/qt4/phonon /usr/include/qt4/phonon
...@@ -248,7 +253,8 @@ linux-g++-64 { ...@@ -248,7 +253,8 @@ linux-g++-64 {
message("Building support for OpenSceneGraph") message("Building support for OpenSceneGraph")
DEPENDENCIES_PRESENT += osg DEPENDENCIES_PRESENT += osg
# Include OpenSceneGraph libraries # Include OpenSceneGraph libraries
LIBS += -losg LIBS += -losg \
-losgViewer
DEFINES += QGC_OSG_ENABLED DEFINES += QGC_OSG_ENABLED
} }
...@@ -256,8 +262,7 @@ linux-g++-64 { ...@@ -256,8 +262,7 @@ linux-g++-64 {
message("Building support for osgEarth") message("Building support for osgEarth")
DEPENDENCIES_PRESENT += osgearth DEPENDENCIES_PRESENT += osgearth
# Include osgEarth libraries # Include osgEarth libraries
LIBS += -losgViewer \ LIBS += -losgEarth \
-losgEarth \
-losgEarthUtil -losgEarthUtil
DEFINES += QGC_OSGEARTH_ENABLED DEFINES += QGC_OSGEARTH_ENABLED
} }
...@@ -325,16 +330,19 @@ exists($$BASEDIR/lib/osgEarth123) { ...@@ -325,16 +330,19 @@ exists($$BASEDIR/lib/osgEarth123) {
BASEDIR_WIN = $$replace(BASEDIR,"/","\\") BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\") TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\")
QMAKE_PRE_LINK += && copy /Y \"$$BASEDIR_WIN\lib\sdl\win32\SDL.dll\" \"$$TARGETDIR_WIN\debug\SDL.dll\" debug {
QMAKE_PRE_LINK += && copy /Y \"$$BASEDIR_WIN\lib\sdl\win32\SDL.dll\" \"$$TARGETDIR_WIN\release\SDL.dll\" QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll\" \"$$TARGETDIR_WIN\\debug\\SDL.dll\"
QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\debug\audio\" /S /E /Y QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\debug\audio\" /S /E /Y
QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\release\audio\" /S /E /Y QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\debug\models\" /S /E /Y
QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\debug\models\" /S /E /Y QMAKE_POST_LINK += && copy /Y \"$$BASEDIR/images/earth.html $$TARGETDIR_WIN\debug\"
QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\release\models\" /S /E /Y }
# Copy google earth starter file release {
QMAKE_PRE_LINK += && copy /Y \"$$BASEDIR/images/earth.html $$TARGETDIR_WIN\release\" QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\lib\sdl\win32\SDL.dll\" \"$$TARGETDIR_WIN\release\SDL.dll\"
QMAKE_PRE_LINK += && copy /Y \"$$BASEDIR/images/earth.html $$TARGETDIR_WIN\debug\" QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\release\audio\" /S /E /Y
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\release\models\" /S /E /Y
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR/images/earth.html $$TARGETDIR_WIN\release\"
}
} }
...@@ -366,15 +374,18 @@ win32-g++ { ...@@ -366,15 +374,18 @@ win32-g++ {
RC_FILE = $$BASEDIR/qgroundcontrol.rc RC_FILE = $$BASEDIR/qgroundcontrol.rc
# Copy dependencies # Copy dependencies
BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\")
QMAKE_PRE_LINK += && copy /Y \"$$BASEDIR_WIN\lib\sdl\win32\SDL.dll\" \"$$TARGETDIR_WIN\debug\SDL.dll\" debug {
QMAKE_PRE_LINK += && copy /Y \"$$BASEDIR_WIN\lib\sdl\win32\SDL.dll\" \"$$TARGETDIR_WIN\release\SDL.dll\" QMAKE_POST_LINK += && cp $$BASEDIR/lib/sdl/win32/SDL.dll $$TARGETDIR/debug/SDL.dll
QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\debug\audio\" /S /E /Y QMAKE_POST_LINK += && cp -r $$BASEDIR/audio $$TARGETDIR/debug/audio
QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\release\audio\" /S /E /Y QMAKE_POST_LINK += && cp -r $$BASEDIR/models $$TARGETDIR/debug/models
QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\debug\models\" /S /E /Y }
QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\release\models\" /S /E /Y
release {
QMAKE_POST_LINK += && cp $$BASEDIR/lib/sdl/win32/SDL.dll $$TARGETDIR/release/SDL.dll
QMAKE_POST_LINK += && cp -r $$BASEDIR/audio $$TARGETDIR/release/audio
QMAKE_POST_LINK += && cp -r $$BASEDIR/models $$TARGETDIR/release/models
}
# osg/osgEarth dynamic casts might fail without this compiler option. # osg/osgEarth dynamic casts might fail without this compiler option.
# see http://osgearth.org/wiki/FAQ for details. # see http://osgearth.org/wiki/FAQ for details.
......
...@@ -208,8 +208,9 @@ Freenect::get3DPointCloudData(void) ...@@ -208,8 +208,9 @@ Freenect::get3DPointCloudData(void)
{ {
if (data[i] > 0 && data[i] <= 2048) if (data[i] > 0 && data[i] <= 2048)
{ {
// see www.ros.org/wiki/kinect_node for details double range = baseline * depthCameraParameters.fx
double range = 1.0f / (-0.00307f * static_cast<float>(data[i]) + 3.33f); / (1.0 / 8.0 * (disparityOffset
- static_cast<double>(data[i])));
if (range > 0.0f) if (range > 0.0f)
{ {
...@@ -341,6 +342,9 @@ Freenect::readConfigFile(void) ...@@ -341,6 +342,9 @@ Freenect::readConfigFile(void)
settings.value("transform/Tz").toDouble(), settings.value("transform/Tz").toDouble(),
0.0, 0.0, 0.0, 1.0); 0.0, 0.0, 0.0, 1.0);
transformMatrix = transformMatrix.transposed(); transformMatrix = transformMatrix.transposed();
baseline = settings.value("transform/baseline").toDouble();
disparityOffset = settings.value("transform/disparity_offset").toDouble();
} }
void void
......
...@@ -119,6 +119,8 @@ private: ...@@ -119,6 +119,8 @@ private:
IntrinsicCameraParameters depthCameraParameters; IntrinsicCameraParameters depthCameraParameters;
QMatrix4x4 transformMatrix; QMatrix4x4 transformMatrix;
double baseline;
double disparityOffset;
// tilt angle of Kinect camera // tilt angle of Kinect camera
int tiltAngle; int tiltAngle;
......
...@@ -637,7 +637,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) ...@@ -637,7 +637,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
for (int i=0; i<MAVLINK_MSG_RADIO_CALIBRATION_FIELD_THROTTLE_LEN; ++i) for (int i=0; i<MAVLINK_MSG_RADIO_CALIBRATION_FIELD_THROTTLE_LEN; ++i)
throttle << radioMsg.throttle[i]; throttle << radioMsg.throttle[i];
QPointer<RadioCalibrationData> radioData = new RadioCalibrationData(aileron, QPointer<RadioCalibrationData> radioData = new RadioCalibrationData(aileron, elevator, rudder, gyro, pitch, throttle);
emit radioCalibrationReceived(radioData); emit radioCalibrationReceived(radioData);
delete radioData; delete radioData;
} }
......
...@@ -70,7 +70,7 @@ This file is part of the QGROUNDCONTROL project ...@@ -70,7 +70,7 @@ This file is part of the QGROUNDCONTROL project
#include "SlugsPIDControl.h" #include "SlugsPIDControl.h"
#include "slugshilsim.h" #include "SlugsHilSim.h"
#include "SlugsVideoCamControl.h" #include "SlugsVideoCamControl.h"
......
...@@ -28,8 +28,8 @@ This file is part of the QGROUNDCONTROL project ...@@ -28,8 +28,8 @@ This file is part of the QGROUNDCONTROL project
*/ */
#include "slugshilsim.h" #include "SlugsHilSim.h"
#include "ui_slugshilsim.h" #include "ui_SlugsHilSim.h"
#include "LinkManager.h" #include "LinkManager.h"
SlugsHilSim::SlugsHilSim(QWidget *parent) : SlugsHilSim::SlugsHilSim(QWidget *parent) :
...@@ -143,6 +143,8 @@ void SlugsHilSim::processHilDatagram(const QByteArray* datagram){ ...@@ -143,6 +143,8 @@ void SlugsHilSim::processHilDatagram(const QByteArray* datagram){
// GPS // GPS
mavlink_gps_raw_t tmpGpsRaw; mavlink_gps_raw_t tmpGpsRaw;
#ifdef MAVLINK_ENABLED_SLUGS
mavlink_gps_date_time_t tmpGpsTime; mavlink_gps_date_time_t tmpGpsTime;
tmpGpsTime.year = datagram->at(i++); tmpGpsTime.year = datagram->at(i++);
...@@ -165,6 +167,7 @@ void SlugsHilSim::processHilDatagram(const QByteArray* datagram){ ...@@ -165,6 +167,7 @@ void SlugsHilSim::processHilDatagram(const QByteArray* datagram){
mavlink_msg_gps_date_time_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &tmpGpsTime); mavlink_msg_gps_date_time_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &tmpGpsTime);
activeUas->sendMessage(hilLink, msg); activeUas->sendMessage(hilLink, msg);
#endif
memset(&msg, 0, sizeof(mavlink_message_t)); memset(&msg, 0, sizeof(mavlink_message_t));
......
...@@ -46,9 +46,9 @@ SlugsPIDControl::SlugsPIDControl(QWidget *parent) : ...@@ -46,9 +46,9 @@ SlugsPIDControl::SlugsPIDControl(QWidget *parent) :
*/ */
void SlugsPIDControl::activeUasSet(UASInterface* uas) void SlugsPIDControl::activeUasSet(UASInterface* uas)
{ {
#ifdef MAVLINK_ENABLED_SLUGS
SlugsMAV* slugsMav = dynamic_cast<SlugsMAV*>(uas); SlugsMAV* slugsMav = dynamic_cast<SlugsMAV*>(uas);
#ifdef MAVLINK_ENABLED_SLUGS
if (slugsMav != NULL) if (slugsMav != NULL)
{ {
connect(slugsMav,SIGNAL(slugsActionAck(int,const mavlink_action_ack_t&)),this,SLOT(recibeMensaje(int,mavlink_action_ack_t))); connect(slugsMav,SIGNAL(slugsActionAck(int,const mavlink_action_ack_t&)),this,SLOT(recibeMensaje(int,mavlink_action_ack_t)));
...@@ -187,6 +187,7 @@ void SlugsPIDControl::changeColor_GREEN_AirSpeed_groupBox() ...@@ -187,6 +187,7 @@ void SlugsPIDControl::changeColor_GREEN_AirSpeed_groupBox()
{ {
//create the packet //create the packet
#ifdef MAVLINK_ENABLED_SLUGS
pidMessage.target = activeUAS->getUASID(); pidMessage.target = activeUAS->getUASID();
pidMessage.idx = 0; pidMessage.idx = 0;
pidMessage.pVal = ui->dT_P_set->text().toFloat(); pidMessage.pVal = ui->dT_P_set->text().toFloat();
...@@ -197,6 +198,7 @@ void SlugsPIDControl::changeColor_GREEN_AirSpeed_groupBox() ...@@ -197,6 +198,7 @@ void SlugsPIDControl::changeColor_GREEN_AirSpeed_groupBox()
mavlink_msg_pid_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &pidMessage); mavlink_msg_pid_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &pidMessage);
slugsMav->sendMessage(msg); slugsMav->sendMessage(msg);
#endif
ui->AirSpeedHold_groupBox->setStyleSheet(GREENcolorStyle); ui->AirSpeedHold_groupBox->setStyleSheet(GREENcolorStyle);
} }
...@@ -232,6 +234,7 @@ void SlugsPIDControl::changeColor_GREEN_PitchFollowei_groupBox() ...@@ -232,6 +234,7 @@ void SlugsPIDControl::changeColor_GREEN_PitchFollowei_groupBox()
if (slugsMav != NULL) if (slugsMav != NULL)
{ {
#ifdef MAVLINK_ENABLED_SLUGS
//create the packet //create the packet
pidMessage.target = activeUAS->getUASID(); pidMessage.target = activeUAS->getUASID();
pidMessage.idx = 2; pidMessage.idx = 2;
...@@ -243,6 +246,7 @@ void SlugsPIDControl::changeColor_GREEN_PitchFollowei_groupBox() ...@@ -243,6 +246,7 @@ void SlugsPIDControl::changeColor_GREEN_PitchFollowei_groupBox()
mavlink_msg_pid_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &pidMessage); mavlink_msg_pid_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &pidMessage);
slugsMav->sendMessage(msg); slugsMav->sendMessage(msg);
#endif
ui->PitchFlowei_groupBox->setStyleSheet(GREENcolorStyle); ui->PitchFlowei_groupBox->setStyleSheet(GREENcolorStyle);
} }
...@@ -280,6 +284,7 @@ void SlugsPIDControl::changeColor_GREEN_RollControl_groupBox() ...@@ -280,6 +284,7 @@ void SlugsPIDControl::changeColor_GREEN_RollControl_groupBox()
if (slugsMav != NULL) if (slugsMav != NULL)
{ {
#ifdef MAVLINK_ENABLED_SLUGS
//create the packet //create the packet
pidMessage.target = activeUAS->getUASID(); pidMessage.target = activeUAS->getUASID();
pidMessage.idx = 4; pidMessage.idx = 4;
...@@ -291,6 +296,7 @@ void SlugsPIDControl::changeColor_GREEN_RollControl_groupBox() ...@@ -291,6 +296,7 @@ void SlugsPIDControl::changeColor_GREEN_RollControl_groupBox()
mavlink_msg_pid_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &pidMessage); mavlink_msg_pid_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &pidMessage);
slugsMav->sendMessage(msg); slugsMav->sendMessage(msg);
#endif
ui->RollControl_groupBox->setStyleSheet(GREENcolorStyle); ui->RollControl_groupBox->setStyleSheet(GREENcolorStyle);
} }
...@@ -340,6 +346,7 @@ void SlugsPIDControl::changeColor_GREEN_HeigthError_groupBox() ...@@ -340,6 +346,7 @@ void SlugsPIDControl::changeColor_GREEN_HeigthError_groupBox()
if (slugsMav != NULL) if (slugsMav != NULL)
{ {
#ifdef MAVLINK_ENABLED_SLUGS
//create the packet //create the packet
pidMessage.target = activeUAS->getUASID(); pidMessage.target = activeUAS->getUASID();
pidMessage.idx = 1; pidMessage.idx = 1;
...@@ -351,6 +358,7 @@ void SlugsPIDControl::changeColor_GREEN_HeigthError_groupBox() ...@@ -351,6 +358,7 @@ void SlugsPIDControl::changeColor_GREEN_HeigthError_groupBox()
mavlink_msg_pid_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &pidMessage); mavlink_msg_pid_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &pidMessage);
slugsMav->sendMessage(msg); slugsMav->sendMessage(msg);
#endif
ui->HeightErrorLoPitch_groupBox->setStyleSheet(GREENcolorStyle); ui->HeightErrorLoPitch_groupBox->setStyleSheet(GREENcolorStyle);
} }
...@@ -399,6 +407,7 @@ void SlugsPIDControl::changeColor_GREEN_YawDamper_groupBox() ...@@ -399,6 +407,7 @@ void SlugsPIDControl::changeColor_GREEN_YawDamper_groupBox()
if (slugsMav != NULL) if (slugsMav != NULL)
{ {
#ifdef MAVLINK_ENABLED_SLUGS
//create the packet //create the packet
pidMessage.target = activeUAS->getUASID(); pidMessage.target = activeUAS->getUASID();
pidMessage.idx = 3; pidMessage.idx = 3;
...@@ -410,6 +419,7 @@ void SlugsPIDControl::changeColor_GREEN_YawDamper_groupBox() ...@@ -410,6 +419,7 @@ void SlugsPIDControl::changeColor_GREEN_YawDamper_groupBox()
mavlink_msg_pid_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &pidMessage); mavlink_msg_pid_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &pidMessage);
slugsMav->sendMessage(msg); slugsMav->sendMessage(msg);
#endif
ui->YawDamper_groupBox->setStyleSheet(GREENcolorStyle); ui->YawDamper_groupBox->setStyleSheet(GREENcolorStyle);
} }
...@@ -460,6 +470,7 @@ void SlugsPIDControl::changeColor_GREEN_Pitch2dT_groupBox() ...@@ -460,6 +470,7 @@ void SlugsPIDControl::changeColor_GREEN_Pitch2dT_groupBox()
if (slugsMav != NULL) if (slugsMav != NULL)
{ {
#ifdef MAVLINK_ENABLED_SLUGS
//create the packet //create the packet
pidMessage.target = activeUAS->getUASID(); pidMessage.target = activeUAS->getUASID();
pidMessage.idx = 8; pidMessage.idx = 8;
...@@ -471,6 +482,7 @@ void SlugsPIDControl::changeColor_GREEN_Pitch2dT_groupBox() ...@@ -471,6 +482,7 @@ void SlugsPIDControl::changeColor_GREEN_Pitch2dT_groupBox()
mavlink_msg_pid_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &pidMessage); mavlink_msg_pid_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &pidMessage);
slugsMav->sendMessage(msg); slugsMav->sendMessage(msg);
#endif
ui->Pitch2dTFFterm_groupBox->setStyleSheet(GREENcolorStyle); ui->Pitch2dTFFterm_groupBox->setStyleSheet(GREENcolorStyle);
} }
} }
...@@ -541,10 +553,12 @@ void SlugsPIDControl::receivePidValues(int systemId, const mavlink_pid_t &pidVal ...@@ -541,10 +553,12 @@ void SlugsPIDControl::receivePidValues(int systemId, const mavlink_pid_t &pidVal
} }
} }
#endif // MAVLINK_ENABLED_SLUG
void SlugsPIDControl::sendMessagePIDStatus(int PIDtype) void SlugsPIDControl::sendMessagePIDStatus(int PIDtype)
{ {
#ifdef MAVLINK_ENABLED_SLUGS
//ToDo remplace actionId values //ToDo remplace actionId values
...@@ -626,6 +640,7 @@ void SlugsPIDControl::sendMessagePIDStatus(int PIDtype) ...@@ -626,6 +640,7 @@ void SlugsPIDControl::sendMessagePIDStatus(int PIDtype)
} }
} }
#endif // MAVLINK_ENABLED_SLUG
} }
void SlugsPIDControl::slugsGetGeneral() void SlugsPIDControl::slugsGetGeneral()
...@@ -695,6 +710,8 @@ void SlugsPIDControl::slugsSetGeneral() ...@@ -695,6 +710,8 @@ void SlugsPIDControl::slugsSetGeneral()
counterRefreshSet++; counterRefreshSet++;
valuesMutex.unlock(); valuesMutex.unlock();
} }
void SlugsPIDControl::slugsTimerStartSet() void SlugsPIDControl::slugsTimerStartSet()
{ {
counterRefreshSet = 1; counterRefreshSet = 1;
...@@ -714,4 +731,3 @@ void SlugsPIDControl::slugsTimerStop() ...@@ -714,4 +731,3 @@ void SlugsPIDControl::slugsTimerStop()
// counterRefresh = 1; // counterRefresh = 1;
} }
#endif // MAVLINK_ENABLED_SLUGS
...@@ -277,8 +277,10 @@ private: ...@@ -277,8 +277,10 @@ private:
QString ORIGINcolorStyle; QString ORIGINcolorStyle;
//SlugsMav Message //SlugsMav Message
#ifdef MAVLINK_ENABLED_SLUGS
mavlink_pid_t pidMessage; mavlink_pid_t pidMessage;
mavlink_slugs_action_t actionSlugs; mavlink_slugs_action_t actionSlugs;
#endif
QTimer* refreshTimerSet; ///< The main timer, controls the update view QTimer* refreshTimerSet; ///< The main timer, controls the update view
QTimer* refreshTimerGet; ///< The main timer, controls the update view QTimer* refreshTimerGet; ///< The main timer, controls the update view
......
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