import QtQuick 1.0
-
import com.nokia.meego 1.0
Page {
property color textColor:"black"
import QtDesktop 0.1
Rectangle {
- property int textSize:12
+ property int textSize:20
+ property color textColor:"black"
id:dialog
+ CalibrateDialogDesktop {
+ id:joyStickCalibrator
+ }
anchors.fill: parent
- Flickable {
- id: dialogscrolarea
+ TabFrame {
+ Tab {
+ title: "Display"
+ id: displayTab
anchors.fill: parent
// anchors.leftMargin:50;anchors.rightMargin:50
- contentHeight: dialogcontent.height
- contentWidth: parent.width
Grid {
columns:2
anchors.leftMargin:50;anchors.rightMargin:50
spacing: 20
- Text {
+/* Text {
font.pixelSize :textSize
text:"UI Style"
}
- ComboBox {
+ ComboBox {
id: activeUICombo;
model: ListModel {
id: choices
ListElement { text: "Desktop";file:"ardrone_desktop.qml" }
}
onSelectedIndexChanged: {
- console.debug(selectedText + ", " + choices.get(selectedIndex).file);
+ console.debug("onSelectedIndexChanged " + selectedText + ", " + choices.get(selectedIndex).file);
drone.confActiveUI=choices.get(selectedIndex).file
}
-
+ selectedText:drone.confActiveUI
KeyNavigation.tab: t1
KeyNavigation.backtab: button2
}
-
+*/
Text {
width:200
text: "Drone IP"
onCheckedChanged:{drone.confFullScreen=checked;}
}
Text {
- text: "Acceleration Sensor for controll"
- color:textColor
- font.pixelSize :textSize
- }
- CheckBox {
- id: useAccelSw
- checked:drone.confUseAccel
- anchors.right:parent.right
- onCheckedChanged:{drone.confUseAccel=checked;}
- }
- Text {
- text: "Joystick for controll"
- color:textColor
- font.pixelSize :textSize
- }
- CheckBox {
- id: useJoySw
- checked:drone.confUseJoyStick
- anchors.right:parent.right
- enabled:drone.confHaveJoyStick
- onCheckedChanged:{drone.confUseJoyStick=checked;}
- }
- Text {
- color:textColor
+ color:textColor
text: "Show debug"
font.pixelSize :textSize
}
Text {
text: "Show engine gauges"
- color:textColor
+ color:textColor
font.pixelSize :textSize
}
Text {
text: "Show horizon"
- color:textColor
+ color:textColor
font.pixelSize :textSize
}
anchors.right:parent.right
onCheckedChanged:{drone.confShowHorizon=checked;}
}
+ } // Grid
+ } // tab
+ Tab {
+ title: "Control"
+ Grid {
+ columns:2
+ anchors.leftMargin:50;anchors.rightMargin:50
+ spacing: 20
+ Text {
+ text: "Acceleration Sensor for controll"
+ color:textColor
+ font.pixelSize :textSize
+ }
+ CheckBox {
+ id: useAccelSw
+ checked:drone.confUseAccel
+ anchors.right:parent.right
+ onCheckedChanged:{drone.confUseAccel=checked;}
+ }
+
+ Text {
+ text: "Joystick"
+ color:textColor
+ font.pixelSize :textSize
+ }
+ CheckBox {
+ id: useJoySw
+ checked:drone.confUseJoyStick
+ anchors.right:parent.right
+ enabled:js.haveJoyStick
+ onCheckedChanged:{drone.confUseJoyStick=checked;}
+ }
+
+ Text {
+ visible:drone.confUseJoyStick
+ font.pixelSize :textSize
+ text:"\"" + js.joyStickName + "\""
+
+ }
+ Button {
+ visible:drone.confUseJoyStick
+ text:"Calibrate"
+ anchors.right:parent.right
+ onClicked:{ joyStickCalibrator.visible = true;
+ js.calibrate=true
+ }
+ }
+ Text {
+ visible:drone.confUseJoyStick
+ font.pixelSize :textSize
+ text:"Show JoyStick Indicators"
+
+ }
+ CheckBox {
+ visible:drone.confUseJoyStick
+ checked:drone.confShowJSIndicators
+ anchors.right:parent.right
+ enabled:js.haveJoyStick
+ onCheckedChanged:{drone.confShowJSIndicators=checked;}
+
+ }
+
Text {
text: "Forward/backward gain"
}
}
}
+ }
}
height: 800
property int textSize:22
property int ctrlSize:40
+ // JoyStick:js
Menu {
id:js1map
visualParent:pageStack
width: 200
height: 200
- Rectangle {
- id:knob
- x:parent.width/2-width/2
- y:parent.width/2-height/2
- width:20;
- height:20;
Image {
- anchors.centerIn:parent
- id: knobimage
+ id:knob
+ x:parent.width/2-width/2
+ y:parent.width/2-height/2
source: "joyknob.png"
}
- }
TouchArea {
id: joyarea
onTouchMove: {
// console.log("TouchArea:ontouchMove " + joyarea.changedTouches.length);
var touch = joyarea.changedTouches[0];
- // console.log("touchMove",touch.id," at ",touch.y,touch.x);
- knob.x=touch.x;
- knob.y=touch.y;
+ // console.log("touchMove",touch.id," at ",touch.y,touch.x);
+ if((touch.x<width) && (touch.x>0)) knob.x=touch.x;
+ if((touch.y<height) && (touch.y>0))knob.y=touch.y;
}
onTouchEnd: {
#############################################################################
# Makefile for building: mardrone
-# Generated by qmake (2.01a) (Qt 4.7.0) on: Wed Jan 5 16:02:29 2011
+# Generated by qmake (2.01a) (Qt 4.7.4) on: Wed Jan 25 14:08:11 2012
# Project: mardrone.pro
# Template: app
-# Command: /usr/bin/qmake -o Makefile mardrone.pro
+# Command: /usr/bin/qmake-qt4 -spec /usr/share/qt4/mkspecs/linux-g++ -o Makefile mardrone.pro
#############################################################################
####### Compiler, tools and options
CC = gcc
CXX = g++
-DEFINES = -DQT_GL_NO_SCISSOR_TEST -DQT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH=1024 -DQT_NO_DEBUG -DQT_DECLARATIVE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
-CFLAGS = -pipe -O3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wall -W -D_REENTRANT $(DEFINES)
-CXXFLAGS = -pipe -O3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wall -W -D_REENTRANT $(DEFINES)
-INCPATH = -I/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/linux-g++-maemo5 -I. -I/targets/FREMANTLE_ARMEL/usr/include/QtCore -I/targets/FREMANTLE_ARMEL/usr/include/QtNetwork -I/targets/FREMANTLE_ARMEL/usr/include/QtGui -I/targets/FREMANTLE_ARMEL/usr/include/QtDeclarative -I/targets/FREMANTLE_ARMEL/usr/include -I/targets/FREMANTLE_ARMEL/usr/include/QtSensors -I../../../../ARDrone_SDK_1_5_Version_20101004/ARDroneLib/Soft/Common -I../../../../ARDrone_SDK_1_5_Version_20101004/ARDroneLib/VP_SDK -I../../../../ARDrone_SDK_1_5_Version_20101004/ARDroneLib/VP_SDK/VP_Os/linux -I../../../../ARDrone_SDK_1_5_Version_20101004/ARDroneLib/VP_SDK/VP_Os -I../../../../ARDrone_SDK_1_5_Version_20101004/ARDroneLib/Soft/Lib -I../../../../ARDrone_SDK_1_5_Version_20101004/ARDroneLib/VLIB -I../../../../ARDrone_SDK_1_5_Version_20101004/ARDroneLib -I/targets/FREMANTLE_ARMEL/usr/include -I.
+DEFINES = -DQT_WEBKIT -DHAVE_SDL -DQT_NO_DEBUG -DQT_DECLARATIVE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
+CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
+CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
+INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtDeclarative -I/usr/include/qt4 -Idronelib -Igauges -IARDrone_SDK_Version_1_8_20110726/ARDroneLib/Soft/Common -IARDrone_SDK_Version_1_8_20110726/ARDroneLib/VP_SDK -IARDrone_SDK_Version_1_8_20110726/ARDroneLib/VP_SDK/VP_Os/linux -IARDrone_SDK_Version_1_8_20110726/ARDroneLib/VP_SDK/VP_Os -IARDrone_SDK_Version_1_8_20110726/ARDroneLib/Soft/Lib -IARDrone_SDK_Version_1_8_20110726/ARDroneLib/VLIB -IARDrone_SDK_Version_1_8_20110726/ARDroneLib -I.
LINK = g++
-LFLAGS = -Wl,-rpath-link,/usr/lib -Wl,-O1 -Wl,--hash-style=gnu -Wl,-rpath,/usr/lib
-LIBS = $(SUBLIBS) -L/usr/lib -lQtComponents -L/home/kathy/ARDrone_SDK_1_5_Version_20101004/lib -lvlib -lsdk -L/usr/lib -lQtSensors -lQtDeclarative -L/usr/X11R6/lib -lQtScript -lQtSvg -lQtSql -lQtXmlPatterns -lQtOpenGL -lQtGui -lQtNetwork -lQtDBus -lQtXml -lQtCore -lpthread
+LFLAGS = -Wl,-O1
+LIBS = $(SUBLIBS) -L/usr/lib/i386-linux-gnu -lSDL -lQtDeclarative -lQtGui -lQtNetwork -lQtCore -lpthread
AR = ar cqs
RANLIB =
-QMAKE = /usr/bin/qmake
+QMAKE = /usr/bin/qmake-qt4
TAR = tar -cf
COMPRESS = gzip -9f
COPY = cp -f
####### Files
SOURCES = main.cpp \
- dronecontrol.cpp \
- navdata.cpp \
- video.cpp \
- gauge.cpp \
- gaugelabel.cpp \
- gaugehorizon.cpp moc_dronecontrol.cpp \
+ dronelib/dronecontrol.cpp \
+ dronelib/navdata.cpp \
+ dronelib/video.cpp \
+ gauges/gauge.cpp \
+ gauges/gaugelabel.cpp \
+ gauges/gaugetape.cpp \
+ gauges/gaugehorizon.cpp \
+ dronelib/joystick.cpp \
+ qdeclarativetoucharea.cpp moc_dronecontrol.cpp \
moc_navdata.cpp \
moc_video.cpp \
moc_gauge.cpp \
moc_gaugelabel.cpp \
+ moc_gaugetape.cpp \
moc_gaugehorizon.cpp \
+ moc_joystick.cpp \
+ moc_qdeclarativetoucharea.cpp \
qrc_ardrone.cpp
OBJECTS = main.o \
dronecontrol.o \
video.o \
gauge.o \
gaugelabel.o \
+ gaugetape.o \
gaugehorizon.o \
+ joystick.o \
+ qdeclarativetoucharea.o \
moc_dronecontrol.o \
moc_navdata.o \
moc_video.o \
moc_gauge.o \
moc_gaugelabel.o \
+ moc_gaugetape.o \
moc_gaugehorizon.o \
+ moc_joystick.o \
+ moc_qdeclarativetoucharea.o \
qrc_ardrone.o
-DIST = /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/unix.conf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/linux.conf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/qconfig.pri \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/modules/qt_webkit_version.pri \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_functions.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_config.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_pre.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/release.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_post.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/mobility.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/warn_on.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/unix/thread.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/moc.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/resources.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/uic.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/yacc.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/lex.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/include_source_dir.prf \
+DIST = /usr/share/qt4/mkspecs/common/g++.conf \
+ /usr/share/qt4/mkspecs/common/unix.conf \
+ /usr/share/qt4/mkspecs/common/linux.conf \
+ /usr/share/qt4/mkspecs/qconfig.pri \
+ /usr/share/qt4/mkspecs/modules/qt_webkit_version.pri \
+ /usr/share/qt4/mkspecs/features/qt_functions.prf \
+ /usr/share/qt4/mkspecs/features/qt_config.prf \
+ /usr/share/qt4/mkspecs/features/exclusive_builds.prf \
+ /usr/share/qt4/mkspecs/features/default_pre.prf \
+ /usr/share/qt4/mkspecs/features/release.prf \
+ /usr/share/qt4/mkspecs/features/default_post.prf \
+ /usr/share/qt4/mkspecs/features/link_pkgconfig.prf \
+ /usr/share/qt4/mkspecs/features/warn_on.prf \
+ /usr/share/qt4/mkspecs/features/qt.prf \
+ /usr/share/qt4/mkspecs/features/unix/thread.prf \
+ /usr/share/qt4/mkspecs/features/moc.prf \
+ /usr/share/qt4/mkspecs/features/resources.prf \
+ /usr/share/qt4/mkspecs/features/uic.prf \
+ /usr/share/qt4/mkspecs/features/yacc.prf \
+ /usr/share/qt4/mkspecs/features/lex.prf \
+ /usr/share/qt4/mkspecs/features/include_source_dir.prf \
mardrone.pro
QMAKE_TARGET = mardrone
DESTDIR =
$(TARGET): $(OBJECTS)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
-Makefile: mardrone.pro /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/linux-g++-maemo5/qmake.conf /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/unix.conf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/linux.conf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/qconfig.pri \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/modules/qt_webkit_version.pri \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_functions.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_config.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_pre.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/release.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_post.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/mobility.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/warn_on.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/unix/thread.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/moc.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/resources.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/uic.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/yacc.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/lex.prf \
- /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/include_source_dir.prf \
- /usr/lib/libQtDeclarative.prl \
- /usr/lib/libQtScript.prl \
- /usr/lib/libQtCore.prl \
- /usr/lib/libQtSvg.prl \
- /usr/lib/libQtGui.prl \
- /usr/lib/libQtDBus.prl \
- /usr/lib/libQtXml.prl \
- /usr/lib/libQtSql.prl \
- /usr/lib/libQtXmlPatterns.prl \
- /usr/lib/libQtNetwork.prl \
- /usr/lib/libQtOpenGL.prl
- $(QMAKE) -o Makefile mardrone.pro
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/unix.conf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/linux.conf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/qconfig.pri:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/modules/qt_webkit_version.pri:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_functions.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_config.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/exclusive_builds.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_pre.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/release.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_post.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/mobility.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/warn_on.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/unix/thread.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/moc.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/resources.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/uic.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/yacc.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/lex.prf:
-/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/include_source_dir.prf:
-/usr/lib/libQtDeclarative.prl:
-/usr/lib/libQtScript.prl:
-/usr/lib/libQtCore.prl:
-/usr/lib/libQtSvg.prl:
-/usr/lib/libQtGui.prl:
-/usr/lib/libQtDBus.prl:
-/usr/lib/libQtXml.prl:
-/usr/lib/libQtSql.prl:
-/usr/lib/libQtXmlPatterns.prl:
-/usr/lib/libQtNetwork.prl:
-/usr/lib/libQtOpenGL.prl:
+Makefile: mardrone.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/g++.conf \
+ /usr/share/qt4/mkspecs/common/unix.conf \
+ /usr/share/qt4/mkspecs/common/linux.conf \
+ /usr/share/qt4/mkspecs/qconfig.pri \
+ /usr/share/qt4/mkspecs/modules/qt_webkit_version.pri \
+ /usr/share/qt4/mkspecs/features/qt_functions.prf \
+ /usr/share/qt4/mkspecs/features/qt_config.prf \
+ /usr/share/qt4/mkspecs/features/exclusive_builds.prf \
+ /usr/share/qt4/mkspecs/features/default_pre.prf \
+ /usr/share/qt4/mkspecs/features/release.prf \
+ /usr/share/qt4/mkspecs/features/default_post.prf \
+ /usr/share/qt4/mkspecs/features/link_pkgconfig.prf \
+ /usr/share/qt4/mkspecs/features/warn_on.prf \
+ /usr/share/qt4/mkspecs/features/qt.prf \
+ /usr/share/qt4/mkspecs/features/unix/thread.prf \
+ /usr/share/qt4/mkspecs/features/moc.prf \
+ /usr/share/qt4/mkspecs/features/resources.prf \
+ /usr/share/qt4/mkspecs/features/uic.prf \
+ /usr/share/qt4/mkspecs/features/yacc.prf \
+ /usr/share/qt4/mkspecs/features/lex.prf \
+ /usr/share/qt4/mkspecs/features/include_source_dir.prf \
+ /usr/lib/i386-linux-gnu/libQtDeclarative.prl \
+ /usr/lib/i386-linux-gnu/libQtGui.prl \
+ /usr/lib/i386-linux-gnu/libQtNetwork.prl \
+ /usr/lib/i386-linux-gnu/libQtCore.prl
+ $(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -o Makefile mardrone.pro
+/usr/share/qt4/mkspecs/common/g++.conf:
+/usr/share/qt4/mkspecs/common/unix.conf:
+/usr/share/qt4/mkspecs/common/linux.conf:
+/usr/share/qt4/mkspecs/qconfig.pri:
+/usr/share/qt4/mkspecs/modules/qt_webkit_version.pri:
+/usr/share/qt4/mkspecs/features/qt_functions.prf:
+/usr/share/qt4/mkspecs/features/qt_config.prf:
+/usr/share/qt4/mkspecs/features/exclusive_builds.prf:
+/usr/share/qt4/mkspecs/features/default_pre.prf:
+/usr/share/qt4/mkspecs/features/release.prf:
+/usr/share/qt4/mkspecs/features/default_post.prf:
+/usr/share/qt4/mkspecs/features/link_pkgconfig.prf:
+/usr/share/qt4/mkspecs/features/warn_on.prf:
+/usr/share/qt4/mkspecs/features/qt.prf:
+/usr/share/qt4/mkspecs/features/unix/thread.prf:
+/usr/share/qt4/mkspecs/features/moc.prf:
+/usr/share/qt4/mkspecs/features/resources.prf:
+/usr/share/qt4/mkspecs/features/uic.prf:
+/usr/share/qt4/mkspecs/features/yacc.prf:
+/usr/share/qt4/mkspecs/features/lex.prf:
+/usr/share/qt4/mkspecs/features/include_source_dir.prf:
+/usr/lib/i386-linux-gnu/libQtDeclarative.prl:
+/usr/lib/i386-linux-gnu/libQtGui.prl:
+/usr/lib/i386-linux-gnu/libQtNetwork.prl:
+/usr/lib/i386-linux-gnu/libQtCore.prl:
qmake: FORCE
- @$(QMAKE) -o Makefile mardrone.pro
+ @$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -o Makefile mardrone.pro
dist:
@$(CHK_DIR_EXISTS) .tmp/mardrone1.0.0 || $(MKDIR) .tmp/mardrone1.0.0
- $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/mardrone1.0.0/ && $(COPY_FILE) --parents dronecontrol.h navdata.h video.h gauge.h gaugelabel.h gaugehorizon.h .tmp/mardrone1.0.0/ && $(COPY_FILE) --parents ardrone.qrc .tmp/mardrone1.0.0/ && $(COPY_FILE) --parents main.cpp dronecontrol.cpp navdata.cpp video.cpp gauge.cpp gaugelabel.cpp gaugehorizon.cpp .tmp/mardrone1.0.0/ && (cd `dirname .tmp/mardrone1.0.0` && $(TAR) mardrone1.0.0.tar mardrone1.0.0 && $(COMPRESS) mardrone1.0.0.tar) && $(MOVE) `dirname .tmp/mardrone1.0.0`/mardrone1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/mardrone1.0.0
+ $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/mardrone1.0.0/ && $(COPY_FILE) --parents dronelib/dronecontrol.h dronelib/navdata.h dronelib/video.h gauges/gauge.h gauges/gaugelabel.h gauges/gaugetape.h gauges/gaugehorizon.h dronelib/joystick.h qdeclarativetoucharea.h .tmp/mardrone1.0.0/ && $(COPY_FILE) --parents ardrone.qrc .tmp/mardrone1.0.0/ && $(COPY_FILE) --parents main.cpp dronelib/dronecontrol.cpp dronelib/navdata.cpp dronelib/video.cpp gauges/gauge.cpp gauges/gaugelabel.cpp gauges/gaugetape.cpp gauges/gaugehorizon.cpp dronelib/joystick.cpp qdeclarativetoucharea.cpp .tmp/mardrone1.0.0/ && (cd `dirname .tmp/mardrone1.0.0` && $(TAR) mardrone1.0.0.tar mardrone1.0.0 && $(COMPRESS) mardrone1.0.0.tar) && $(MOVE) `dirname .tmp/mardrone1.0.0`/mardrone1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/mardrone1.0.0
clean:compiler_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
-compiler_moc_header_make_all: moc_dronecontrol.cpp moc_navdata.cpp moc_video.cpp moc_gauge.cpp moc_gaugelabel.cpp moc_gaugehorizon.cpp
+compiler_moc_header_make_all: moc_dronecontrol.cpp moc_navdata.cpp moc_video.cpp moc_gauge.cpp moc_gaugelabel.cpp moc_gaugetape.cpp moc_gaugehorizon.cpp moc_joystick.cpp moc_qdeclarativetoucharea.cpp
compiler_moc_header_clean:
- -$(DEL_FILE) moc_dronecontrol.cpp moc_navdata.cpp moc_video.cpp moc_gauge.cpp moc_gaugelabel.cpp moc_gaugehorizon.cpp
-moc_dronecontrol.cpp: navdata.h \
- dronecontrol.h
- /usr/bin/moc $(DEFINES) $(INCPATH) dronecontrol.h -o moc_dronecontrol.cpp
+ -$(DEL_FILE) moc_dronecontrol.cpp moc_navdata.cpp moc_video.cpp moc_gauge.cpp moc_gaugelabel.cpp moc_gaugetape.cpp moc_gaugehorizon.cpp moc_joystick.cpp moc_qdeclarativetoucharea.cpp
+moc_dronecontrol.cpp: dronelib/dronecontrol.h
+ /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) dronelib/dronecontrol.h -o moc_dronecontrol.cpp
-moc_navdata.cpp: navdata.h
- /usr/bin/moc $(DEFINES) $(INCPATH) navdata.h -o moc_navdata.cpp
+moc_navdata.cpp: dronelib/navdata.h
+ /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) dronelib/navdata.h -o moc_navdata.cpp
-moc_video.cpp: dronecontrol.h \
- navdata.h \
- video.h
- /usr/bin/moc $(DEFINES) $(INCPATH) video.h -o moc_video.cpp
+moc_video.cpp: dronelib/dronecontrol.h \
+ dronelib/video.h
+ /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) dronelib/video.h -o moc_video.cpp
-moc_gauge.cpp: gauge.h
- /usr/bin/moc $(DEFINES) $(INCPATH) gauge.h -o moc_gauge.cpp
+moc_gauge.cpp: gauges/gauge.h
+ /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) gauges/gauge.h -o moc_gauge.cpp
-moc_gaugelabel.cpp: gauge.h \
- gaugelabel.h
- /usr/bin/moc $(DEFINES) $(INCPATH) gaugelabel.h -o moc_gaugelabel.cpp
+moc_gaugelabel.cpp: gauges/gauge.h \
+ gauges/gaugelabel.h
+ /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) gauges/gaugelabel.h -o moc_gaugelabel.cpp
-moc_gaugehorizon.cpp: gauge.h \
- gaugehorizon.h
- /usr/bin/moc $(DEFINES) $(INCPATH) gaugehorizon.h -o moc_gaugehorizon.cpp
+moc_gaugetape.cpp: gauges/gauge.h \
+ gauges/gaugetape.h
+ /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) gauges/gaugetape.h -o moc_gaugetape.cpp
+
+moc_gaugehorizon.cpp: gauges/gauge.h \
+ gauges/gaugehorizon.h
+ /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) gauges/gaugehorizon.h -o moc_gaugehorizon.cpp
+
+moc_joystick.cpp: dronelib/joystick.h
+ /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) dronelib/joystick.h -o moc_joystick.cpp
+
+moc_qdeclarativetoucharea.cpp: qdeclarativetoucharea.h
+ /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) qdeclarativetoucharea.h -o moc_qdeclarativetoucharea.cpp
compiler_rcc_make_all: qrc_ardrone.cpp
compiler_rcc_clean:
-$(DEL_FILE) qrc_ardrone.cpp
qrc_ardrone.cpp: ardrone.qrc \
+ gauges/ati1.png \
+ gauges/HeadingGauge.qml \
+ ConfigDialogDesktop.qml \
+ ardrone_harmattan.qml \
+ gauges/AltGauge.qml \
+ gear32x32.png \
+ gauges/EfisPFD.qml \
+ gauges/hdg2.png \
+ gauges/glareshield1.png \
joyknob.png \
- joybox.png \
+ CalibrateDialog.qml \
BarGauge.qml \
+ gauges/ati6.png \
+ gauges/ati2.png \
+ gauges/needle2.png \
+ ardrone_symbian.qml \
+ JoyStickTouch.qml \
+ ConfigDialogSymbian.qml \
+ JoyStickCalibrator.qml \
+ CalibrateDialogDesktop.qml \
+ gauges/ati3.png \
+ gauges/needle1.png \
+ gauges/AttitudeGauge.qml \
+ JoyStickIndicator.qml \
+ joybox.png \
+ ardrone_desktop.qml \
+ gauges/ati4.png \
+ gauges/bezel.png \
+ gauges/alt2.png \
ConfigDialog.qml \
- ardrone.qml \
- JoyStick.qml
+ gauges/hdg1.png \
+ gauges/ati5.png \
+ JoyStickCalibratorDesktop.qml \
+ gauges/EfisPFD.qml \
+ gauges/AltGauge.qml \
+ gauges/qmldir
/usr/bin/rcc -name ardrone ardrone.qrc -o qrc_ardrone.cpp
compiler_image_collection_make_all: qmake_image_collection.cpp
####### Compile
-main.o: main.cpp dronecontrol.h \
- navdata.h \
- video.h \
- gaugehorizon.h \
- gauge.h
+main.o: main.cpp qdeclarativetoucharea.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
-dronecontrol.o: dronecontrol.cpp dronecontrol.h \
- navdata.h
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o dronecontrol.o dronecontrol.cpp
+dronecontrol.o: dronelib/dronecontrol.cpp dronelib/dronecontrol.h \
+ dronelib/navdata.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o dronecontrol.o dronelib/dronecontrol.cpp
+
+navdata.o: dronelib/navdata.cpp dronelib/navdata.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o navdata.o dronelib/navdata.cpp
+
+video.o: dronelib/video.cpp dronelib/video.h \
+ dronelib/dronecontrol.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o video.o dronelib/video.cpp
+
+gauge.o: gauges/gauge.cpp gauges/gauge.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o gauge.o gauges/gauge.cpp
-navdata.o: navdata.cpp navdata.h
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o navdata.o navdata.cpp
+gaugelabel.o: gauges/gaugelabel.cpp gauges/gaugelabel.h \
+ gauges/gauge.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o gaugelabel.o gauges/gaugelabel.cpp
-video.o: video.cpp video.h \
- dronecontrol.h \
- navdata.h
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o video.o video.cpp
+gaugetape.o: gauges/gaugetape.cpp gauges/gaugetape.h \
+ gauges/gauge.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o gaugetape.o gauges/gaugetape.cpp
-gauge.o: gauge.cpp gauge.h
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o gauge.o gauge.cpp
+gaugehorizon.o: gauges/gaugehorizon.cpp gauges/gaugehorizon.h \
+ gauges/gauge.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o gaugehorizon.o gauges/gaugehorizon.cpp
-gaugelabel.o: gaugelabel.cpp gaugelabel.h \
- gauge.h
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o gaugelabel.o gaugelabel.cpp
+joystick.o: dronelib/joystick.cpp dronelib/joystick.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o joystick.o dronelib/joystick.cpp
-gaugehorizon.o: gaugehorizon.cpp gaugehorizon.h \
- gauge.h
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o gaugehorizon.o gaugehorizon.cpp
+qdeclarativetoucharea.o: qdeclarativetoucharea.cpp qdeclarativetoucharea.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o qdeclarativetoucharea.o qdeclarativetoucharea.cpp
moc_dronecontrol.o: moc_dronecontrol.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_dronecontrol.o moc_dronecontrol.cpp
moc_gaugelabel.o: moc_gaugelabel.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_gaugelabel.o moc_gaugelabel.cpp
+moc_gaugetape.o: moc_gaugetape.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_gaugetape.o moc_gaugetape.cpp
+
moc_gaugehorizon.o: moc_gaugehorizon.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_gaugehorizon.o moc_gaugehorizon.cpp
+moc_joystick.o: moc_joystick.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_joystick.o moc_joystick.cpp
+
+moc_qdeclarativetoucharea.o: moc_qdeclarativetoucharea.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_qdeclarativetoucharea.o moc_qdeclarativetoucharea.cpp
+
qrc_ardrone.o: qrc_ardrone.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_ardrone.o qrc_ardrone.cpp
####### Install
install_target: first FORCE
- @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/opt/usr/bin/ || $(MKDIR) $(INSTALL_ROOT)/opt/usr/bin/
- -$(INSTALL_PROGRAM) "$(QMAKE_TARGET)" "$(INSTALL_ROOT)/opt/usr/bin/$(QMAKE_TARGET)"
- -$(STRIP) "$(INSTALL_ROOT)/opt/usr/bin/$(QMAKE_TARGET)"
+ @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/local/bin/ || $(MKDIR) $(INSTALL_ROOT)/usr/local/bin/
+ -$(INSTALL_PROGRAM) "$(QMAKE_TARGET)" "$(INSTALL_ROOT)/usr/local/bin/$(QMAKE_TARGET)"
+ -$(STRIP) "$(INSTALL_ROOT)/usr/local/bin/$(QMAKE_TARGET)"
uninstall_target: FORCE
- -$(DEL_FILE) "$(INSTALL_ROOT)/opt/usr/bin/$(QMAKE_TARGET)"
- -$(DEL_DIR) $(INSTALL_ROOT)/opt/usr/bin/
-
-
-install_icon64: first FORCE
- @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/ || $(MKDIR) $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/
- -$(INSTALL_FILE) /home/kathy/sb/harmattan/mardrone/mardrone/mardrone.png $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/
-
-
-uninstall_icon64: FORCE
- -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/mardrone.png
- -$(DEL_DIR) $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/
+ -$(DEL_FILE) "$(INSTALL_ROOT)/usr/local/bin/$(QMAKE_TARGET)"
+ -$(DEL_DIR) $(INSTALL_ROOT)/usr/local/bin/
install_desktopfile: first FORCE
- @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/share/applications/hildon/ || $(MKDIR) $(INSTALL_ROOT)/usr/share/applications/hildon/
- -$(INSTALL_FILE) /home/kathy/sb/harmattan/mardrone/mardrone/mardrone.desktop $(INSTALL_ROOT)/usr/share/applications/hildon/
+ @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/share/applications/ || $(MKDIR) $(INSTALL_ROOT)/usr/share/applications/
+ -$(INSTALL_FILE) /mnt/hgfs/scratchbox/harmattan/mardrone/mardrone/mardrone.desktop $(INSTALL_ROOT)/usr/share/applications/
uninstall_desktopfile: FORCE
- -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/share/applications/hildon/mardrone.desktop
- -$(DEL_DIR) $(INSTALL_ROOT)/usr/share/applications/hildon/
+ -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/share/applications/mardrone.desktop
+ -$(DEL_DIR) $(INSTALL_ROOT)/usr/share/applications/
-install: install_target install_icon64 install_desktopfile FORCE
+install: install_target install_desktopfile FORCE
-uninstall: uninstall_target uninstall_icon64 uninstall_desktopfile FORCE
+uninstall: uninstall_target uninstall_desktopfile FORCE
FORCE:
<RCC>
- <qresource>
- <file>ardrone.qml</file>
+ <qresource prefix="/">
<file>BarGauge.qml</file>
<file>ConfigDialog.qml</file>
- <file>JoyStick.qml</file>
<file>joybox.png</file>
<file>joyknob.png</file>
+ <file>gear32x32.png</file>
+ <file>ardrone_harmattan.qml</file>
+ <file>ardrone_desktop.qml</file>
+ <file>ConfigDialogDesktop.qml</file>
+ <file alias="AltGauge.qml">gauges/AltGauge.qml</file>
+ <file alias="alt2.png">gauges/alt2.png</file>
+ <file alias="needle1.png">gauges/needle1.png</file>
+ <file alias="needle2.png">gauges/needle2.png</file>
+ <file alias="EfisPFD.qml">gauges/EfisPFD.qml</file>
+ <file>CalibrateDialog.qml</file>
+ <file>JoyStickCalibrator.qml</file>
+ <file>JoyStickIndicator.qml</file>
+ <file>JoyStickTouch.qml</file>
+ <file alias="ati1.png">gauges/ati1.png</file>
+ <file alias="ati2.png">gauges/ati2.png</file>
+ <file alias="ati3.png">gauges/ati3.png</file>
+ <file alias="ati4.png">gauges/ati4.png</file>
+ <file alias="ati5.png">gauges/ati5.png</file>
+ <file alias="ati6.png">gauges/ati6.png</file>
+ <file alias="AttitudeGauge.qml">gauges/AttitudeGauge.qml</file>
+ <file>CalibrateDialogDesktop.qml</file>
+ <file>JoyStickCalibratorDesktop.qml</file>
+ <file>ardrone_symbian.qml</file>
+ <file>ConfigDialogSymbian.qml</file>
+ <file alias="bezel.png">gauges/bezel.png</file>
+ <file alias="HeadingGauge.qml">gauges/HeadingGauge.qml</file>
+ <file alias="hdg1.png">gauges/hdg1.png</file>
+ <file alias="hdg2.png">gauges/hdg2.png</file>
+ <file alias="glareshield1.png">gauges/glareshield1.png</file>
+ </qresource>
+ <qresource prefix="/gauges">
+ <file>gauges/EfisPFD.qml</file>
+ <file>gauges/qmldir</file>
+ <file>gauges/AltGauge.qml</file>
</qresource>
</RCC>
import Drone 1.0
import QtQuick 1.0
import QtDesktop 0.1
-import gauges 1.0
+//import gauges 1.0
import JoyStick 1.0
Window {
title: "MArdrone"
-
+ id:mainWindow
width: 1024
- height: 480
+ height: 800
maximumHeight: mainWindow.height
- minimumHeight: 480
+ minimumHeight: 800
maximumWidth: 1280
minimumWidth: 800
visible: true
+
MenuBar {
Menu {
text: "File"
}
+ Column {
+ width:parent.width
+ spacing:5
Rectangle {
- id:mainWindow
- width:640
+ id:mainWiew
+ width:parent.width
height:480
//onEntered:(mainWindow.fullscreen=true)
DroneVideo {
id:droneVideo
y:0
- x:0
+ anchors.horizontalCenter: parent
// anchors.horizontalCenter:parent.horizontalCenter
- width:drone.confFullScreen? parent.width:640 ;height:480*width/640;
+ width:drone.confFullScreen? parent.width:640 ;height:width<=640 ?480*width/640:480;
}
EfisPFD {
id:hudPDF
y:0
- x:0
+ anchors.horizontalCenter: parent
visible:drone.confShowHorizon
roll:drone.droneRoll
pitch:drone.dronePitch
ias:drone.droneSpeed
- alt:drone.droneAltitude
+ alt:drone.droneAltitude/10
indicatorColor:"green"
skyColor:"#00000000"
groundColor:"#00000000"
Text {
y:100
+
// visible:drone.confUseAccel
color: "#00FF00"
id: droneCtrlValues
font.pixelSize:20
text: drone.decodedStatus
}
- Button {
+ /* Button {
y:150;x:0
height: 50
width: 50
iconSource: "gear32x32.png"
onClicked:{ configDialog.visible = true }
}
-
+*/
JoyStickIndicator {
- x:200;y:350
- visible:drone.showJSIndivators
+
+ anchors.left:parent.left
+ anchors.bottom:parent.bottom
+ anchors.margins:10
+ visible:drone.confShowJSIndicators&js.haveJoyStick&drone.confUseJoyStick
border.width:1
color:"transparent"
width:100;height:100
JoyStickIndicator {
- x:500;y:350
- visible:drone.showJSIndivators
+
+ anchors.right:parent.right
+ anchors.bottom:parent.bottom
+ anchors.margins:10
+ visible:drone.confShowJSIndicators&js.haveJoyStick&drone.confUseJoyStick
border.width:1
color:"transparent"
width:100;height:100
onXvChanged:{drone.yaw=xv/200.0;}
onPressedChanged: { drone.ctrlActive=pressed;}
}
- Column {
- anchors.left: droneVideo.right
+ }
+ Row {
+ spacing:5
+
EfisPFD {
id:pDF
width:320
height:240
- // visible:drone.confShowHorizon
roll:drone.droneRoll
pitch:drone.dronePitch
ias:drone.droneSpeed
- alt:drone.droneAltitude
+ alt:drone.droneAltitude/10
+ // bezel:"glareshield1.png"
}
+ Grid {
+ columns: 4
+
+
+ AltGauge {
+ width:150
+ height:150
+ id:altGauge
+ value:drone.droneAltitude/10
+ bezel:"bezel.png"
+ }
+ AttitudeGauge {
+ width:150
+ height:150
+ id:attGauge
+ roll:drone.droneRoll
+ pitch:drone.dronePitch
+ bezel:"bezel.png"
+ }
+ HeadingGauge {
+ width:150
+ height:150
+ id:hdgGauge
+ value:drone.droneYaw
+ bezel:"bezel.png"
+ }
Row {
spacing: 5
- anchors.right:parent.right
anchors.rightMargin: 10
- y:100
height:100
BarGauge {
val:drone.pwm_motor1;
height:100
}
}
- AltGauge {
- width:150
- height:150
- id:altGauge
- // value:drone.altitude
- value:testAlt.value
- }
- Slider {
- id: testAlt
- maximumValue:1000
- }
+ } // Grid if instruments
+ } // Column ( Main window content )
- }
Dialog {
id:configDialog
width:800
height:600
data:ConfigDialogDesktop {}
}
-
- } // Main page
}
+ } // Main page
+
import QtQuick 1.0
import com.nokia.meego 1.0
import Drone 1.0
-import gauges 1.0
+//import gauges 1.0
import JoyStick 1.0
PageStackWindow {
DroneControl {
id:drone
-
}
JoyStick {
id:js
onElevatorChanged:{if(drone.confUseJoyStick) drone.pitch=elevator;}
- onAileronChanged: {if(drone.confUseJoyStick) drone.roll=aileron;}
+ onAileronChanged: {if(drone.confUseJoyStick) drone.roll=-1.0*aileron;}
onThrotleChanged: {if(drone.confUseJoyStick) drone.vVelocity=throtle;}
onRudderChanged: {if(drone.confUseJoyStick) drone.yaw=rudder;}
Component {
id: mainpageComponent
+
Page {
id:mainPage
+ property bool connectingBoxVisible:true
//onEntered:(mainWindow.fullscreen=true)
state:"Landscape"
// anchors.horizontalCenter:parent.horizontalCenter
width:drone.confFullScreen? parent.width:640 ;height:480*width/640;
}
+
EfisPFD {
id:hudPDF
y:0
Text {
- y:100
+ y:50
// visible:drone.confUseAccel
color: "#00FF00"
id: droneCtrlValues
- font.pixelSize:20
+ font.pixelSize:25
text: "cmd:pitch=" + drone.pitch.toFixed(2) + " roll= " + drone.roll.toFixed(2) + " yaw=" + drone.yaw.toFixed(2) + " vv= " + drone.vVelocity.toFixed(2)
}
Text {
- y:115
+ y:70
visible:drone.confShowDebug
color: "#00FF00"
id: droneNavData
- font.pixelSize:20
- text: "pitch=" + Math.round(drone.dronePitch) + " roll= " + Math.round(drone.droneRoll) + "yaw=" + Math.round(drone.droneYaw) + " alt= " + Math.round(drone.droneAltitude)
+ font.pixelSize:25
+ text: "pitch=" + drone.dronePitch.toFixed(2) + " roll= " + drone.droneRoll.toFixed(2) + "yaw=" + drone.droneYaw.toFixed(2) + " alt= " + drone.droneAltitude.toFixed(2)
}
Text {
- y:130
+ y:100
visible:drone.confShowDebug
color: "#00FF00"
id: droneStatus
y:150;x:0
height: 50
width: 50
+ z:2 // This is visible even connecting to drone
iconSource: "gear32x32.png"
onClicked:{ //mainWindow.fullscreen = false ;
pageStack.push(dialogComponent);
JoyStickTouch {
id:lj
- width:280;height:280;
- y:200
+ width:200;height:200;
+
visible: !drone.confUseAccel & !drone.confUseJoyStick
anchors.left:parent.left
- anchors.margins:50
- onYvChanged:{drone.pitch=yv/200.0;}
- onXvChanged:{drone.roll=xv/200.0;}
-
-
+ anchors.bottom:parent.bottom
+ anchors.margins:10
+ // joyBackground: ""
+ onYvChanged:{drone.vVelocity=-1*yv/200.0;}
+ onXvChanged:{drone.yaw=xv/200.0;}
+ onPressedChanged: { drone.ctrlActive=pressed;}
}
JoyStickTouch {
visible: !drone.confUseJoyStick
id:rj
- y:200
+
+ // joyBackground: ""
anchors.right:parent.right
- width:280;height:280;
+ anchors.bottom:parent.bottom
+ width:200;height:200;
anchors.margins:10
- onYvChanged:{drone.vVelocity=-1*yv/200.0;}
- onXvChanged:{drone.yaw=xv/200.0;}
- onPressedChanged: { drone.ctrlActive=pressed;}
+ onYvChanged:{drone.pitch=yv/200.0;}
+ onXvChanged:{drone.roll=xv/200.0;}
}
Row {
width:120
id:emergencyButton
anchors.top:parent.top
+
anchors.margins:15
text:"Energency";
checkable:true
onClicked:{drone.emergency=checked;}
}
+
+ Connections {
+ target:drone
+ onConnectedChanged:{
+ console.log("Connected to drone");
+ connectingDialog.accept();}
+ }
+ QueryDialog {
+ id:connectingDialog
+ message:"Connecting to Drone "+ drone.confDroneIp
+ acceptButtonText:"OK"
+ Component.onCompleted: {
+ console.log("ConectionDialog Opened");
+ if(!drone.connected) open(); }
+ }
} // Main page
}
dialogComponent = Qt.createComponent("ConfigDialog.qml");
}
-// Component.onCompleted: {
-// mainWindow.fullscreen = true ;
-// dialogComponent = Qt.createComponent("ConfigDialog.qml");
-// mainWindow.nextPage(mainpageComponent)
-// }
}
+mardrone (0.2.0) unstable; urgency=low
+
+ * Updated support added for desktop Qt components and Joystick
+
+ -- Kate Alhola <kate.alhola@nokia.com> Tue, 17 Nov 2011 17:16:48 +0200
+
+mardrone (0.1.0) unstable; urgency=low
+
+ * Updated to release version of MeeGo Qt Quick components and ArDronelib included to build.
+
+ -- Kate Alhola <kate.alhola@nokia.com> Tue, 30 Aug 2011 15:06:48 +0200
+
mardrone (0.0.1) unstable; urgency=low
* Initial Release.
-mardrone_0.0.1_armel.deb user/hidden optional
+mardrone_0.2.0_i386.deb user/hidden optional
dh_testdir
# Add here commands to compile the package.
+ qmake
$(MAKE)
#docbook-to-man debian/mardrone.sgml > mardrone.1
# dh_perl
# dh_makeshlibs
dh_installdeb
- # dh_shlibdeps
+ dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
+++ /dev/null
-/*==================================================================
- !
- ! mardrone application AR-Drone for MeeGo
-
- ! Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
- ! All rights reserved.
- !
- ! Author:Kate Alhola kate.alhola@nokia.com
- !
- ! GNU Lesser General Public License Usage
- ! This file may be used under the terms of the GNU Lesser
- ! General Public License version 2.1 as published by the Free Software
- ! Foundation and appearing in the file LICENSE.LGPL included in the
- ! packaging of this file. Please review the following information to
- ! ensure the GNU Lesser General Public License version 2.1 requirements
- ! will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
- !
- !
- !
- *===================================================================*/
-#include "dronecontrol.h"
-#include <QDebug>
-
-DroneControl::DroneControl():QObject()
-{
- qDebug() << "DroneControl::DroneControl";
-
-// ctlSock=new QTcpSocket();
-// ctlSock->bind(QHostAddress::Any,5559);
-// navSock=new QUdpSocket();
-// navSock->bind(QHostAddress::Any,5554)
- //connect(navSocket,SIGNAL(readyRead()),SLOT(navDataReady()));
- droneHost.setAddress("192.168.1.1");
- droneThread=new DroneThread(this,droneHost);
- connect(droneThread->navData(),SIGNAL(navDataUpdated()),this,SLOT(navDataUpdated()));
- connect(droneThread->navData(),SIGNAL(stateUpdated()),this,SLOT(statusUpdated()));
- droneSettings=new QSettings("katix.org","ardrone");
- m_ctrlActive=false;
- m_pitch=0;
- m_roll=0;
- m_yaw=0;
- m_vv=0;
- m_useAccel=droneSettings->value("useAccel",false).toBool();
- m_ctrlTrsh=droneSettings->value("ctrlTreshold",10.0).toFloat();
- rSensor=new QRotationSensor();
- rSensor->start();
- connect(rSensor,SIGNAL(readingChanged()),this,SLOT(rotationReadingsChanged()));
- droneThread->setDroneGain(confForwardGain(),confBackwardGain(),confLeftGain(),confRightGain());
-
-}
-
-void DroneControl::rotationReadingsChanged()
-{
- if(m_useAccel && m_ctrlActive) {
- m_pitch=rSensor->reading()->x()-m_rotRefX;
- m_roll =rSensor->reading()->y()-m_rotRefY;
- m_pitch=(fabs(m_pitch)<m_ctrlTrsh ) ? 0:(m_pitch>0 ? m_pitch-m_ctrlTrsh:m_pitch+m_ctrlTrsh);
- m_roll =(fabs(m_roll )<m_ctrlTrsh ) ? 0:(m_roll>0 ? m_roll- m_ctrlTrsh:m_roll+ m_ctrlTrsh);
- droneThread->setDroneControl(m_pitch,m_roll,m_yaw,m_vv);
- emit pitchRollChanged();
- //m_rotRefZ=rSensor->reading()->z();
- //qDebug("setCtrlActive ref(%3.1f,%3.1f,%3.1f)",m_rotRefX,m_rotRefY,m_rotRefZ);
- }
-}
-
-void DroneControl::navDataUpdated()
-{
- emit navDataChanged();
-
-}
-void DroneControl::statusUpdated()
-{
- emit statusChanged();
-
-}
-
-void DroneControl::setPitch(float val_)
-{
- m_pitch=val_;
-// qDebug() << "setPitch=" << val_;
- droneThread->setDroneControl(m_pitch,m_roll,m_yaw,m_vv);
-};
-float DroneControl::pitch() {return m_pitch;};
-
-void DroneControl::setRoll(float val_)
-{
- m_roll=val_;
-// qDebug() << "setRoll=" << val_;
- droneThread->setDroneControl(m_pitch,m_roll,m_yaw,m_vv);
-};
-float DroneControl::roll() {return m_roll;};
-void DroneControl::setYaw(float val) {
- m_yaw=val;
- // qDebug() << "setYaw=" << val;
- if(m_useAccel && m_ctrlActive) m_yaw=(fabs(m_yaw)<(m_ctrlTrsh*2) ) ? 0:(m_yaw>0 ? m_yaw-(m_ctrlTrsh*2):m_yaw+(m_ctrlTrsh*2));
- droneThread->setDroneControl(m_pitch,m_roll,m_yaw,m_vv);
-};
-float DroneControl::yaw() {return m_yaw;};
-void DroneControl::setVVelocity(float val) {
- m_vv=val;
- if(m_useAccel && m_ctrlActive) m_vv=(fabs(m_vv)<(m_ctrlTrsh*2) ) ? 0:(m_vv>0? m_vv-(m_ctrlTrsh*2):m_vv+(m_ctrlTrsh*2));
-// qDebug() << "setVv=" << val_;
- droneThread->setDroneControl(m_pitch,m_roll,m_yaw,m_vv);
-};
-float DroneControl::vVelocity() {return m_vv;};
-void DroneControl::setAltitude(float val_) {
- m_altitude=val_;
-};
-float DroneControl::altitude() {return m_altitude;};
-void DroneControl::setEnabled(int val_) { m_enabled=val_;};
-int DroneControl::enabled() {return m_enabled;};
-
-bool DroneControl::ctrlActive()
-{
- return m_ctrlActive;
-};
-void DroneControl::setCtrlActive(bool val_)
-{
- if(val_ && !m_ctrlActive) { // Ctrl switched to active
- m_rotRefX=rSensor->reading()->x();
- m_rotRefY=rSensor->reading()->y();
- m_rotRefZ=rSensor->reading()->z();
- qDebug("setCtrlActive ref(%3.1f,%3.1f,%3.1f)",m_rotRefX,m_rotRefY,m_rotRefZ);
- }
- m_ctrlActive=val_;
- if(!m_ctrlActive) { m_pitch=0;m_roll=0; };
- droneThread->setDroneControl(m_pitch,m_roll,m_yaw,m_vv);
- emit pitchRollChanged();
-
-};
-
-
-void DroneControl::setFly(bool val_)
-{
- m_fly=val_;
- qDebug() << "setFly=" << val_;
- droneThread->setFly(m_fly);
-};
-bool DroneControl::fly() {return m_fly;};
-void DroneControl::setEmergency(bool val_)
-{
- m_emergency=val_;
- qDebug() << "setEmergency=" << val_;
- droneThread->setEmergency(m_emergency);
-};
-bool DroneControl::emergency() {return m_emergency;};
-
-
-// Getters to drone actual valyes sent by drone
-float DroneControl::droneAltitude()
-{
- return droneThread->navData()->altitude;
-};
-float DroneControl::dronePitch()
-{
- return droneThread->navData()->pitch;
-};
-float DroneControl::droneRoll()
-{
- return droneThread->navData()->roll;
-};
-float DroneControl::droneYaw()
-{
- return droneThread->navData()->yaw;
-};
-float DroneControl::droneVBat()
-{
- return droneThread->navData()->vbat;
-};
-QString DroneControl::decodedStatus()
-{
- return droneThread->navData()->decodedState;
-};
-int DroneControl::pwm_motor1()
-{
- return droneThread->navData()->pwm_motor1;
-};
-int DroneControl::pwm_motor2()
-{
- return droneThread->navData()->pwm_motor2;
-};
-int DroneControl::pwm_motor3()
-{
- return droneThread->navData()->pwm_motor3;
-};
-int DroneControl::pwm_motor4()
-{
- return droneThread->navData()->pwm_motor4;
-};
-
-
-
-
-
-QString DroneControl::confDroneIp()
-{
- qDebug() << "confDroneIp:" << droneSettings->value("droneIp","192.168.1.1").toString();
- return droneSettings->value("droneIp","192.168.1.1").toString();
-};
-void DroneControl::setConfDroneIp(QString ip)
-{
- qDebug() << "setConfDroneIp:" << ip;
- droneSettings->setValue("droneIp",ip);
- emit configChanged();
-};
-bool DroneControl::confShowDebug()
-{
-return droneSettings->value("showDebug",true).toBool();
-};
-void DroneControl::setConfShowDebug(bool val)
-{
- droneSettings->setValue("showDebug",val);
- emit configChanged();
-};
-bool DroneControl::confShowHorizon()
-{
- return droneSettings->value("showHorizon",true).toBool();
-};
-void DroneControl::setConfShowHorizon(bool val)
-{
- droneSettings->setValue("showHorizon",val);
- emit configChanged();
-};
-bool DroneControl::confShowGauges()
-{
- return droneSettings->value("showGuges",true).toBool();
-};
-void DroneControl::setConfShowGauges(bool val)
-{
- droneSettings->setValue("showGauges",val);
- emit configChanged();
-};
-bool DroneControl::confUseAccel()
-{
- //return droneSettings->value("useAccel",false).toBool();
- return m_useAccel; // return cached value
-};
-void DroneControl::setConfUseAccel(bool val)
-{
- droneSettings->setValue("useAccel",val);
- m_useAccel=val;
- emit configChanged();
-};
-bool DroneControl::confUseJoyStick()
-{
- return droneSettings->value("useJouStick",false).toBool();
-};
-void DroneControl::setConfUseJoyStick(bool val)
-{
- droneSettings->setValue("useJoyStick",val);
- emit configChanged();
-};
-
-bool DroneControl::confFullScreen()
-{
- return droneSettings->value("fullScreen",true).toBool();
-};
-void DroneControl::setConfFullScreen(bool val)
-{
- droneSettings->setValue("fullScreen",val);
- emit configChanged();
-};
-
-float DroneControl::confForwardGain()
-{
- return droneSettings->value("forwardGain",1.0).toFloat();
-};
-void DroneControl::setConfForwardGain(float val)
-{
- droneSettings->setValue("forwardGain",val);
- droneThread->setDroneGain(confForwardGain(),confBackwardGain(),confLeftGain(),confRightGain());
- emit configChanged();
-};
-float DroneControl::confCtrlTrsh()
-{
- return m_ctrlTrsh;
-};
-void DroneControl::setConfCtrlTrsh(float val)
-{
- droneSettings->setValue("ctrlTreshold",val);
- m_ctrlTrsh=val;
- emit configChanged();
-};
-
-float DroneControl::confBackwardGain()
-{
- return droneSettings->value("backwardGain",1.0).toFloat();
-};
-void DroneControl::setConfBackwardGain(float val)
-{
- droneSettings->setValue("backwardGain",val);
- droneThread->setDroneGain(confForwardGain(),confBackwardGain(),confLeftGain(),confRightGain());
- emit configChanged();
-};
-
-float DroneControl::confLeftGain()
-{
- return droneSettings->value("leftGain",1.0).toFloat();
-};
-void DroneControl::setConfLeftGain(float val)
-{
- droneSettings->setValue("leftGain",val);
- droneThread->setDroneGain(confForwardGain(),confBackwardGain(),confLeftGain(),confRightGain());
- emit configChanged();
-};
-float DroneControl::confRightGain()
-{
- return droneSettings->value("rightGain",1.0).toFloat();
-};
-void DroneControl::setConfRightGain(float val)
-{
- droneSettings->setValue("rightGain",val);
- droneThread->setDroneGain(confForwardGain(),confBackwardGain(),confLeftGain(),confRightGain());
- emit configChanged();
-};
-
-/*=================================================
-
- DroneThread class starts here
-
-==================================================*/
-
-
-void DroneThread::setFly(bool fly)
-{
- if(state==ready) {
- m_fly=fly;
- state=flying;
- stateTimer->setInterval(50); // More frequent updates
- sendCmd(QString("AT*FTRIM=%1\r").arg(seq++));
-
- }
- if(state==flying) {
- if(!fly) {
- stateTimer->setInterval(200); // Less frequent updates
- state=ready;
- }
- m_fly=fly;
- }
- sendCmd(QString("AT*REF=%1,%2\r").arg(seq++).arg((1<<18) + (1<<20) + (1<<22) + (1<<24) +(1<<28) +(state==flying ? 1<<9:0)));
-};
-
-void DroneThread::setEmergency(bool emg)
-{
- m_emergency=emg;
- sendCmd(QString("AT*REF=%1,%2\r").arg(seq++).arg((1<<18) + (1<<20) + (1<<22) + (1<<24) +(1<<28) + (m_emergency ? 1<<8:0)));
- // if(m_emergency==1)
- state=ready;
-} ;
-void DroneThread::setDroneControl(float pitch,float roll,float yaw,float vv)
-{
- m_pitch=pitch/200.0*m_fgain;
- m_roll=roll/200.0*m_rgain;
- m_yaw=yaw/200.0;
- m_vv=vv/200.0;
- qDebug() << QString("pitch=%1 roll=%2 yaw=%3 vv=%4\r").arg(m_pitch,3,'F',2).arg(m_roll,3,'F',2).arg(m_yaw,3,'F',2).arg(m_vv,3,'F',2);
-};
-
-void DroneThread::setDroneGain(float fgain,float bgain,float lgain,float rgain)
-{
- m_fgain=fgain;
- m_bgain=bgain;
- m_rgain=rgain;
- m_lgain=lgain;
-};
-
-void DroneThread::sendCmd(QString cmd)
-{
- QByteArray dgram;
- QString seqCmd=cmd;
- if(cmd.contains("%")) seqCmd=cmd.arg(seq++);
- dgram=seqCmd.toLatin1();
- cmdSock->writeDatagram(dgram.data(),dgram.size(),droneHost,5556);
- seqCmd.chop(1); // Remove training cr
- qDebug() << "DroneThread::sendCmd= " << seqCmd << "to " << droneHost ;
-}
-
-void DroneThread::navDataReady()
-{
- qint64 l;
- char buf[2048];
- QHostAddress host;
- quint16 port;
- while(navSock->hasPendingDatagrams()) l=navSock->readDatagram(buf,sizeof(buf),&host,&port);
-// qDebug() << "DroneThread::navDataReady state=" << state <<" l=" << l << "read=" << buf << "from" << host ;
- nd.parseRawNavData((char *)&buf,l);
- if(nd.state& (ARDRONE_COM_WATCHDOG_MASK ))
- sendCmd(QString("AT*COMWDG=%1\r").arg(seq++));
- switch(state) {
- case notInitialized:
- sendCmd("AT*CONFIG=%1,\"general:navdata_demo\",\"FALSE\"\r");
- state=initialized;
- break;
- case initialized:
- sendCmd("AT*CTRL=0\r");
- sendCmd("AT*CONFIG=%1,\"detect:detect_type\",\"2\"\r");
- state=ready;
- break;
- case ready:
- break;
- }
-}
-
-void DroneThread::sendNav(QString cmd)
-{
- QByteArray dgram;
- dgram=cmd.toLatin1();
- qDebug() << "DroneThread::sendNav= " << cmd+"\n" << "to " << droneHost ;
- navSock->writeDatagram(dgram.data(),dgram.size(),droneHost,5554);
-}
-
-
-DroneThread::DroneThread(DroneControl *parentp,QHostAddress host)
-{
- qDebug() << "DroneThread::DroneThread";
- stopped=false;
- state=notInitialized;
- parent=parentp;
- navSock=new QUdpSocket();
- navSock->bind(QHostAddress::Any,5554);
- cmdSock=new QUdpSocket();
- cmdSock->bind(QHostAddress::Any,5556);
- droneHost=host;
- seq=1;
- m_pitch=0;
- m_roll=0;
- m_yaw=0;
- m_vv=0;
- m_fgain=1.0;
- m_bgain=1.0;
- m_rgain=1.0;
- m_lgain=1.0;
- start();
-
-
-};
-
-void DroneThread::run()
-{
- qDebug() << "DroneThread::DroneThread";
- stateTimer=new QTimer(this);
- connect(stateTimer,SIGNAL(timeout()),this,SLOT(timer()));
- connect(navSock,SIGNAL(readyRead()),this,SLOT(navDataReady()));
- stateTimer->start(1000);
- while(!stopped) {
- exec();
- }
-
-}
-
-void DroneThread::timer()
-{
- // qDebug() << "thread Timer";
- switch(state) {
- case notInitialized:
- sendNav("AT");
- break;
- case initialized:
- break;
- case ready:
- sendCmd(QString("AT*REF=%1,%2\r").arg(seq++).arg((1<<18) + (1<<20) + (1<<22) + (1<<24) +(1<<28)));
- break;
- case flying: {
- float_or_int_t _pitch,_roll,_yaw,_vv;
- int r=(m_pitch!=0.0 || m_roll!=0.0)?1:0;
-
-
- _pitch.f=m_pitch;
- _roll.f=m_roll;
- _yaw.f=m_yaw;
- _vv.f=m_vv;
-// qDebug() << QString("AT*PCMD=%1,0,%2,%3,%4,%5\r").arg(seq).arg(_roll.f,3,'F',2).arg(_pitch.f,3,'F',2).arg(_vv.f,3,'F',2).arg(_yaw.f,3,'F',2);
-// qDebug() << QString("AT*PCMD=%1,0,%2,%3,%4,%5\r").arg(seq).arg(_roll.i,8,16).arg(_pitch.i,8,16).arg(_vv.i,8,16).arg(_yaw.i,8,16);
- sendCmd(QString("AT*COMWDG=%1\r").arg(seq++));
- sendCmd(QString("AT*PCMD=%1,%2,%3,%4,%5,%6\r").arg(seq++).arg(r).arg(_roll.i).arg(_pitch.i).arg(_vv.i).arg(_yaw.i));
-
-
- break;
- }
-}
-}
-
-
-
+++ /dev/null
-#ifndef DRONECONTROL_H
-#define DRONECONTROL_H
-
-#include <QGraphicsWidget>
-#include <QGraphicsItem>
-#include <QPainter>
-#include <QUdpSocket>
-#include <QTcpSocket>
-#include <QThread>
-#include <QTimer>
-#include <QSettings>
-#include <QRotationSensor>
-#undef _GNU_SOURCE // just get rid of error message double definition
-#include <navdata.h>
-
-class DroneThread;
-
-QTM_USE_NAMESPACE
-
-class DroneControl : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(float pitch READ pitch WRITE setPitch NOTIFY pitchRollChanged)
- Q_PROPERTY(float roll READ roll WRITE setRoll NOTIFY pitchRollChanged)
- Q_PROPERTY(float yaw READ yaw WRITE setYaw NOTIFY pitchRollChanged)
- Q_PROPERTY(float altitude READ altitude WRITE setAltitude)
- Q_PROPERTY(float vVelocity READ vVelocity WRITE setVVelocity NOTIFY pitchRollChanged)
- Q_PROPERTY(int enabled READ enabled WRITE setEnabled)
- Q_PROPERTY(bool fly READ fly WRITE setFly)
- Q_PROPERTY(bool ctrlActive READ ctrlActive WRITE setCtrlActive)
- Q_PROPERTY(float dronePitch READ dronePitch NOTIFY navDataChanged)
- Q_PROPERTY(float droneRoll READ droneRoll NOTIFY navDataChanged)
- Q_PROPERTY(float droneYaw READ droneYaw NOTIFY navDataChanged)
- Q_PROPERTY(float droneVBat READ droneVBat NOTIFY navDataChanged)
- Q_PROPERTY(float droneAltitude READ droneAltitude NOTIFY navDataChanged)
- Q_PROPERTY(bool emergency READ emergency WRITE setEmergency)
- Q_PROPERTY(QString decodedStatus READ decodedStatus NOTIFY statusChanged)
- Q_PROPERTY(int pwm_motor1 READ pwm_motor1 NOTIFY navDataChanged)
- Q_PROPERTY(int pwm_motor2 READ pwm_motor1 NOTIFY navDataChanged)
- Q_PROPERTY(int pwm_motor3 READ pwm_motor1 NOTIFY navDataChanged)
- Q_PROPERTY(int pwm_motor4 READ pwm_motor1 NOTIFY navDataChanged)
-
-
- // Config variables from QSettings
- Q_PROPERTY(QString confDroneIp READ confDroneIp WRITE setConfDroneIp NOTIFY configChanged)
- Q_PROPERTY(bool confShowDebug READ confShowDebug WRITE setConfShowDebug NOTIFY configChanged)
- Q_PROPERTY(bool confShowHorizon READ confShowHorizon WRITE setConfShowHorizon NOTIFY configChanged)
- Q_PROPERTY(bool confShowGauges READ confShowGauges WRITE setConfShowGauges NOTIFY configChanged)
- Q_PROPERTY(bool confUseAccel READ confUseAccel WRITE setConfUseAccel NOTIFY configChanged)
- Q_PROPERTY(bool confUseJoyStick READ confUseJoyStick WRITE setConfUseJoyStick NOTIFY configChanged)
- Q_PROPERTY(bool confFullScreen READ confFullScreen WRITE setConfFullScreen NOTIFY configChanged)
- Q_PROPERTY(float confForwardGain READ confForwardGain WRITE setConfForwardGain NOTIFY configChanged)
- Q_PROPERTY(float confBackwardGain READ confBackwardGain WRITE setConfBackwardGain NOTIFY configChanged)
- Q_PROPERTY(float confLeftGain READ confLeftGain WRITE setConfLeftGain NOTIFY configChanged)
- Q_PROPERTY(float confRightGain READ confRightGain WRITE setConfRightGain NOTIFY configChanged)
- Q_PROPERTY(float confCtrlTrsh READ confCtrlTrsh WRITE setConfCtrlTrsh NOTIFY configChanged)
-
-public:
- explicit DroneControl();
-
-
- float pitch(); void setPitch(float val_);
- float roll() ; void setRoll(float val_);
- float yaw() ; void setYaw(float val_);
- float altitude(); void setAltitude(float val_) ;
- float vVelocity();void setVVelocity(float val_) ;
- int enabled() ; void setEnabled(int val_) ;
- bool emergency();void setEmergency(bool val_) ;
- bool fly() ; void setFly(bool val_) ;
- bool ctrlActive();void setCtrlActive(bool val_) ;
-
-// Read only telemetry and drone status
- QString decodedStatus();
- int pwm_motor1();
- int pwm_motor2();
- int pwm_motor3();
- int pwm_motor4();
- float droneAltitude();
- float dronePitch();
- float droneRoll();
- float droneYaw();
- float droneVBat();
-
-//Config variables
- QString confDroneIp(); void setConfDroneIp(QString ip);
- bool confShowDebug(); void setConfShowDebug(bool val);
- bool confShowHorizon(); void setConfShowHorizon(bool val);
- bool confShowGauges(); void setConfShowGauges(bool val);
- bool confUseAccel(); void setConfUseAccel(bool val);
- bool confFullScreen(); void setConfFullScreen(bool val);
- bool confUseJoyStick(); void setConfUseJoyStick(bool val);
- float confForwardGain(); void setConfForwardGain(float val);
- float confBackwardGain(); void setConfBackwardGain(float val);
- float confLeftGain(); void setConfLeftGain(float val);
- float confRightGain(); void setConfRightGain(float val);
- float confCtrlTrsh(); void setConfCtrlTrsh(float val);
-signals:
- void navDataChanged();
- void statusChanged();
- void configChanged();
- void pitchRollChanged();
-public slots:
- void navDataUpdated();
- void statusUpdated();
- void rotationReadingsChanged();
-private:
-
- float m_pitch; // pitch in horizon
- float m_roll; // Roll in horizon
- float m_yaw; // low value to display
- float m_vv; // Verticl velocity
- float m_altitude; // altitude
- float m_rotRefX; // Rotation zero reference
- float m_rotRefY;
- float m_rotRefZ;
- int m_enabled; // Enable flag
- bool m_emergency; // Emergency flag
- QString _emgReason; // Reason of emergency
- bool m_fly; // Fly flag
- bool m_ctrlActive;
- bool m_useAccel;
- float m_ctrlTrsh; // accel controll treshold
-
- QTcpSocket *ctlSock; // TCP port for control/config data
- QUdpSocket *navSock; // Navigation data receive socket port 5554
- QHostAddress droneHost; // Ip address of the drone
-
- DroneThread *droneThread;
- QSettings *droneSettings;
- QRotationSensor *rSensor; // used for controllind drone with device rotation
-};
-
-
-
-class DroneThread:public QThread {
- Q_OBJECT
-public:
- DroneThread(DroneControl *parentp,QHostAddress host);
-
- // ~DroneThread ();
- void run();
- void sendNav(QString cmd);
- void sendCmd(QString cmd);
- NavData *navData() { return &nd; };
-
- enum droneState {
- notInitialized,
- initialized,
- ready,
- flying
-
- };
-public slots:
- void navDataReady();
- void timer();
- void setFly(bool fly);
- void setEmergency(bool emg);
- void setDroneControl(float pitch,float roll,float yaw,float vv);
- void setDroneGain(float fgain,float bgain,float lgain,float rgain);
-
-private:
-
- QHostAddress droneHost; // Ip address of the drone
- QTimer *stateTimer;
- volatile bool stopped;
- DroneControl *parent;
- QUdpSocket *navSock; // Navigation data receive socket port 5554
- QUdpSocket *cmdSock; // Ay command socket port 5556
- int state;
- int seq; // Drone command seq number
- bool m_fly;
- bool m_emergency;
- float m_pitch;
- float m_roll;
- float m_yaw;
- float m_vv;
- float m_fgain;
- float m_bgain;
- float m_rgain;
- float m_lgain;
- NavData nd;
-};
-
-#endif // DRONECONTROL_H
#include <QNetworkConfigurationManager>
#include <QNetworkSession>
#include <QList>
+#include "navdata.h"
+#include "ardrone_api.h"
DroneControl::DroneControl():QObject()
{
qDebug() << "DroneControl::DroneControl";
-// ctlSock=new QTcpSocket();
-// ctlSock->bind(QHostAddress::Any,5559);
-// navSock=new QUdpSocket();
-// navSock->bind(QHostAddress::Any,5554)
- //connect(navSocket,SIGNAL(readyRead()),SLOT(navDataReady()));
- droneHost.setAddress("192.168.1.1");
- droneThread=new DroneThread(this,droneHost);
- connect(droneThread->navData(),SIGNAL(navDataUpdated()),this,SLOT(navDataUpdated()));
- connect(droneThread->navData(),SIGNAL(stateUpdated()),this,SLOT(statusUpdated()));
+
+
droneSettings=new QSettings("katix.org","mardrone");
m_ctrlActive=false;
m_pitch=0;
m_roll=0;
m_yaw=0;
m_vv=0;
+ m_connected=FALSE;
m_useAccel=droneSettings->value("useAccel",false).toBool();
m_useJoyStick=droneSettings->value("useJoyStick",false).toBool();
m_ctrlTrsh=droneSettings->value("ctrlTreshold",10.0).toFloat();
+ droneHost.setAddress(confDroneIp());
+ droneThread=new DroneThread(this,droneHost);
+ connect(droneThread->navData(),SIGNAL(navDataUpdated()),this,SLOT(navDataUpdated()));
+ connect(droneThread->navData(),SIGNAL(stateUpdated()),this,SLOT(statusUpdated()));
#ifdef QT_SENSORS
rSensor=new QRotationSensor();
rSensor->start();
#endif
}
+void DroneControl::setConnected(bool val_)
+{
+ m_connected=val_;
+ emit connectedChanged();
+}
void DroneControl::navDataUpdated()
{
emit navDataChanged();
m_pitch=val_;
// qDebug() << "setPitch=" << val_;
droneThread->setDroneControl(m_pitch,m_roll,m_yaw,m_vv);
+ emit pitchRollChanged();
};
float DroneControl::pitch() {return m_pitch;};
m_roll=val_;
// qDebug() << "setRoll=" << val_;
droneThread->setDroneControl(m_pitch,m_roll,m_yaw,m_vv);
+ emit pitchRollChanged();
};
float DroneControl::roll() {return m_roll;};
void DroneControl::setYaw(float val) {
// qDebug() << "setYaw=" << val;
if(m_useAccel && m_ctrlActive) m_yaw=(fabs(m_yaw)<(m_ctrlTrsh*2) ) ? 0:(m_yaw>0 ? m_yaw-(m_ctrlTrsh*2):m_yaw+(m_ctrlTrsh*2));
droneThread->setDroneControl(m_pitch,m_roll,m_yaw,m_vv);
+ emit pitchRollChanged();
};
float DroneControl::yaw() {return m_yaw;};
void DroneControl::setVVelocity(float val) {
if(m_useAccel && m_ctrlActive) m_vv=(fabs(m_vv)<(m_ctrlTrsh*2) ) ? 0:(m_vv>0? m_vv-(m_ctrlTrsh*2):m_vv+(m_ctrlTrsh*2));
// qDebug() << "setVv=" << val_;
droneThread->setDroneControl(m_pitch,m_roll,m_yaw,m_vv);
+ emit pitchRollChanged();
};
float DroneControl::vVelocity() {return m_vv;};
void DroneControl::setAltitude(float val_) {m_altitude=val_;};
{
QByteArray dgram;
QString seqCmd=cmd;
+ noreply++;
if(cmd.contains("%")) seqCmd=cmd.arg(seq++);
dgram=seqCmd.toLatin1();
cmdSock->writeDatagram(dgram.data(),dgram.size(),droneHost,5556);
seqCmd.chop(1); // Remove training cr
-// qDebug() << "DroneThread::sendCmd= " << seqCmd << "to " << droneHost ;
+ // qDebug() << "DroneThread::sendCmd= " << seqCmd << "to " << droneHost ;
}
void DroneThread::navDataReady()
char buf[2048];
QHostAddress host;
quint16 port;
+ QString cmd;
+ bool ack;
+ noreply=0; // We got a reply
+ cmd="";ack=false;
while(navSock->hasPendingDatagrams()) l=navSock->readDatagram(buf,sizeof(buf),&host,&port);
// qDebug() << "DroneThread::navDataReady state=" << state <<" l=" << l << "read=" << buf << "from" << host ;
nd.parseRawNavData((char *)&buf,l);
+ if(nd.state& (ARDRONE_NAVDATA_BOOTSTRAP)) state=notInitialized;
if(nd.state& (ARDRONE_COM_WATCHDOG_MASK ))
- sendCmd(QString("AT*COMWDG=%1\r").arg(seq++));
+ cmd+=QString("AT*COMWDG=%1\r").arg(seq++);
+ if((nd.state& (ARDRONE_COMMAND_MASK ))) {
+ cmd+=QString("AT*CTRL=%1,%2,0\r").arg(seq++).arg(ACK_CONTROL_MODE);
+ ack=true;
+ };
switch(state) {
case notInitialized:
- sendCmd("AT*CONFIG=%1,\"general:navdata_demo\",\"FALSE\"\r");
- state=initialized;
+ cmd+=QString("AT*CONFIG=%1,\"general:navdata_demo\",\"TRUE\"\r").arg(seq++);
+ // cmd+=QString("AT*CONFIG=%1,\"general:navdata_options\",\"%3\"\r").arg(seq++).arg(NAVDATA_OPTION_FULL_MASK);
+ // cmd+=QString("AT*CONFIG=%1,\"video:codec\",\"%2\"\r").arg(seq++).arg(0x20);
+ state=bootstrap;
+ retry=10;
+ qDebug() << "Connected to drone" << seq << navData()->decodedState;
+ parent->setConnected(TRUE); // We are connected to drone
+ break;
+ case bootstrap:
+ if(ack) state=initialized;
+ else
+ if(--retry<=0) state=notInitialized;
break;
case initialized:
- sendCmd("AT*CTRL=0\r");
- sendCmd("AT*CONFIG=%1,\"detect:detect_type\",\"2\"\r");
+ cmd+=QString("AT*CTRL=%1,0\r").arg(seq++);
+ cmd+=QString("AT*CONFIG=%1,\"detect:detect_type\",\"2\"\r").arg(seq++);
state=ready;
break;
case ready:
break;
}
+ if(!cmd.isEmpty())sendCmd(cmd); // don't send null cmd
}
void DroneThread::sendNav(QString cmd)
{
struct ip_mreq imreq;
+ QString my_ip;
qDebug() << "DroneThread::DroneThread";
+ my_ip="192.168.1.2";
stopped=false;
state=notInitialized;
parent=parentp;
navSock=new QUdpSocket();
QList<QNetworkConfiguration> netconfs=QNetworkConfigurationManager().allConfigurations();
foreach (QNetworkConfiguration np,netconfs) {
- qDebug() << "network COnfifuration name " << np.name() << np.bearerName() << np.bearerTypeName();
+ qDebug() << "network Confifuration name " << np.name() << np.bearerName() << np.bearerTypeName();
QNetworkSession ns(np);
if(ns.interface().addressEntries().empty())
qDebug() << "network session " << ns.interface().humanReadableName() << "**NotConfig**";
- else
- qDebug() << "network session " << ns.interface().humanReadableName() << ns.interface().addressEntries().first().ip();
+ else {
+ qDebug() << "network session " << ns.interface().humanReadableName() << ns.interface().addressEntries().first().ip();
+ // Ubuntu may give wlan0 as "Ethernet"
+ if((np.bearerName()==QString("WLAN")) || (ns.interface().humanReadableName()==QString("wlan0")) ) {
+ my_ip=ns.interface().addressEntries().first().ip().toString();
+ qDebug() << "My IP is " << my_ip;
+ }
+ }
}
-
if(!navSock->bind(QHostAddress::Any,5554))
qDebug() << "Cant open any: 5554" << navSock->errorString() ;
imreq.imr_multiaddr.s_addr=inet_addr("224.1.1.1");
- imreq.imr_interface.s_addr=inet_addr("192.168.1.2");
+ imreq.imr_interface.s_addr=inet_addr(my_ip.toAscii());
setsockopt(navSock->socketDescriptor(),IPPROTO_IP,IP_ADD_MEMBERSHIP,&imreq,sizeof(imreq));
cmdSock=new QUdpSocket();
cmdSock->bind(QHostAddress::Any,5556);
m_bgain=1.0;
m_rgain=1.0;
m_lgain=1.0;
+ noreply=0;
start();
stateTimer=new QTimer(this);
connect(stateTimer,SIGNAL(timeout()),this,SLOT(timer()));
connect(navSock,SIGNAL(readyRead()),this,SLOT(navDataReady()));
- stateTimer->start(1000);
+ stateTimer->start(100);
while(!stopped) {
exec();
}
void DroneThread::timer()
{
+ QString cmd;
// qDebug() << "thread Timer";
+ noreply++;
+ if(noreply>50 ) {
+ cmd+=QString("AT*COMWDG=%1\r").arg(seq++);
+ navData()->setState("**TimeOut**");
+ qDebug("Timeout");
+ noreply=0;
+ };
switch(state) {
case notInitialized:
- sendNav("AT");
- break;
- case initialized:
+ sendNav("AT\r");
+ // cmd+=QString("AT*REF=%1,%2\r").arg(seq++).arg((1<<18) + (1<<20) + (1<<22) + (1<<24) +(1<<28));
break;
+ case bootstrap:
+ case initialized:
+ cmd+=QString("AT*REF=%1,%2\r").arg(seq++).arg((1<<18) + (1<<20) + (1<<22) + (1<<24) +(1<<28));
+ break;
case ready:
- sendCmd(QString("AT*REF=%1,%2\r").arg(seq++).arg((1<<18) + (1<<20) + (1<<22) + (1<<24) +(1<<28)));
+ cmd+=QString("AT*REF=%1,%2\r").arg(seq++).arg((1<<18) + (1<<20) + (1<<22) + (1<<24) +(1<<28));
break;
case flying: {
float_or_int_t _pitch,_roll,_yaw,_vv;
_vv.f=m_vv;
// qDebug() << QString("AT*PCMD=%1,0,%2,%3,%4,%5\r").arg(seq).arg(_roll.f,3,'F',2).arg(_pitch.f,3,'F',2).arg(_vv.f,3,'F',2).arg(_yaw.f,3,'F',2);
// qDebug() << QString("AT*PCMD=%1,0,%2,%3,%4,%5\r").arg(seq).arg(_roll.i,8,16).arg(_pitch.i,8,16).arg(_vv.i,8,16).arg(_yaw.i,8,16);
- sendCmd(QString("AT*COMWDG=%1\r").arg(seq++));
- sendCmd(QString("AT*PCMD=%1,%2,%3,%4,%5,%6\r").arg(seq++).arg(r).arg(_roll.i).arg(_pitch.i).arg(_vv.i).arg(_yaw.i));
+ cmd+=QString("AT*COMWDG=%1\r").arg(seq++);
+ cmd+=QString("AT*PCMD=%1,%2,%3,%4,%5,%6\r").arg(seq++).arg(r).arg(_roll.i).arg(_pitch.i).arg(_vv.i).arg(_yaw.i);
break;
}
}
+ if(!cmd.isEmpty())sendCmd(cmd);
}
Q_PROPERTY(float droneSpeed READ droneSpeed NOTIFY navDataChanged)
Q_PROPERTY(float droneAltitude READ droneAltitude NOTIFY navDataChanged)
Q_PROPERTY(bool emergency READ emergency WRITE setEmergency)
+ Q_PROPERTY(bool connected READ connected WRITE setConnected NOTIFY connectedChanged)
Q_PROPERTY(QString decodedStatus READ decodedStatus NOTIFY statusChanged)
Q_PROPERTY(int pwm_motor1 READ pwm_motor1 NOTIFY navDataChanged)
Q_PROPERTY(int pwm_motor3 READ pwm_motor1 NOTIFY navDataChanged)
Q_PROPERTY(int pwm_motor4 READ pwm_motor1 NOTIFY navDataChanged)
-#if 0
- Q_PROPERTY(bool confHaveJoyStick READ confHaveJoyStick NOTIFY configChanged)
- Q_PROPERTY(QString joyStickName READ joyStickName NOTIFY statusChanged)
- Q_PROPERTY(int joyStickRawAxis1 READ joyStickRawAxis1 NOTIFY joyStickChanged)
- Q_PROPERTY(int joyStickRawAxis2 READ joyStickRawAxis2 NOTIFY joyStickChanged)
- Q_PROPERTY(int joyStickRawAxis3 READ joyStickRawAxis3 NOTIFY joyStickChanged)
- Q_PROPERTY(int joyStickRawAxis4 READ joyStickRawAxis4 NOTIFY joyStickChanged)
- Q_PROPERTY(int joyStickRawAxis5 READ joyStickRawAxis5 NOTIFY joyStickChanged)
- Q_PROPERTY(int joyStickRawAxis6 READ joyStickRawAxis6 NOTIFY joyStickChanged)
- Q_PROPERTY(int joyStickMaxAxis1 READ joyStickMaxAxis1 NOTIFY joyStickChanged)
- Q_PROPERTY(int joyStickMaxAxis2 READ joyStickMaxAxis2 NOTIFY joyStickChanged)
- Q_PROPERTY(int joyStickMaxAxis3 READ joyStickMaxAxis3 NOTIFY joyStickChanged)
- Q_PROPERTY(int joyStickMaxAxis4 READ joyStickMaxAxis4 NOTIFY joyStickChanged)
- Q_PROPERTY(int joyStickMaxAxis5 READ joyStickMaxAxis5 NOTIFY joyStickChanged)
- Q_PROPERTY(int joyStickMaxAxis6 READ joyStickMaxAxis6 NOTIFY joyStickChanged)
- Q_PROPERTY(int joyStickMinAxis1 READ joyStickMinAxis1 NOTIFY joyStickChanged)
- Q_PROPERTY(int joyStickMinAxis2 READ joyStickMinAxis2 NOTIFY joyStickChanged)
- Q_PROPERTY(int joyStickMinAxis3 READ joyStickMinAxis3 NOTIFY joyStickChanged)
- Q_PROPERTY(int joyStickMinAxis4 READ joyStickMinAxis4 NOTIFY joyStickChanged)
- Q_PROPERTY(int joyStickMinAxis5 READ joyStickMinAxis5 NOTIFY joyStickChanged)
- Q_PROPERTY(int joyStickMinAxis6 READ joyStickMinAxis6 NOTIFY joyStickChanged)
- Q_PROPERTY(float joyStickAxis1 READ joyStickAxis1 NOTIFY joyStickChanged)
- Q_PROPERTY(float joyStickAxis2 READ joyStickAxis2 NOTIFY joyStickChanged)
- Q_PROPERTY(float joyStickAxis3 READ joyStickAxis3 NOTIFY joyStickChanged)
- Q_PROPERTY(float joyStickAxis4 READ joyStickAxis4 NOTIFY joyStickChanged)
- Q_PROPERTY(float joyStickAxis5 READ joyStickAxis5 NOTIFY joyStickChanged)
- Q_PROPERTY(float joyStickAxis6 READ joyStickAxis6 NOTIFY joyStickChanged)
- Q_PROPERTY(bool joyStickCalibrate READ joyStickCalibrate WRITE setJoyStickCalibrate)
-#endif
+
// Config variables from QSettings
Q_PROPERTY(QString confDroneIp READ confDroneIp WRITE setConfDroneIp NOTIFY configChanged)
Q_PROPERTY(QString confActiveUI READ confActiveUI WRITE setConfActiveUI NOTIFY configChanged)
// Read only telemetry and drone status
QString decodedStatus();
-#ifdef JOYSTICK
-// JoyStick configuration
- QString joyStickName() { return m_joyStickName; };
- int joyStickRawAxis1() { return m_joyStickRawAxis1; };
- int joyStickRawAxis2() { return m_joyStickRawAxis2; };
- int joyStickRawAxis3() { return m_joyStickRawAxis3; };
- int joyStickRawAxis4() { return m_joyStickRawAxis4; };
- int joyStickRawAxis5() { return m_joyStickRawAxis5; };
- int joyStickRawAxis6() { return m_joyStickRawAxis6; };
- int joyStickMaxAxis1() { return m_joyStickMaxAxis1; };
- int joyStickMaxAxis2() { return m_joyStickMaxAxis2; };
- int joyStickMaxAxis3() { return m_joyStickMaxAxis3; };
- int joyStickMaxAxis4() { return m_joyStickMaxAxis4; };
- int joyStickMaxAxis5() { return m_joyStickMaxAxis5; };
- int joyStickMaxAxis6() { return m_joyStickMaxAxis6; };
- int joyStickMinAxis1() { return m_joyStickMinAxis1; };
- int joyStickMinAxis2() { return m_joyStickMinAxis2; };
- int joyStickMinAxis3() { return m_joyStickMinAxis3; };
- int joyStickMinAxis4() { return m_joyStickMinAxis4; };
- int joyStickMinAxis5() { return m_joyStickMinAxis5; };
- int joyStickMinAxis6() { return m_joyStickMinAxis6; };
- float joyStickAxis1() { return m_joyStickAxis1; };
- float joyStickAxis2() { return m_joyStickAxis2; };
- float joyStickAxis3() { return m_joyStickAxis3; };
- float joyStickAxis4() { return m_joyStickAxis4; };
- float joyStickAxis5() { return m_joyStickAxis5; };
- float joyStickAxis6() { return m_joyStickAxis6; };
- bool joyStickCalibrate() { return m_joyCal; };
- void setJoyStickCalibrate(bool val) { m_joyCal=val;};
-#endif
+
+ bool connected() { return m_connected; };
+ void setConnected(bool val_);
int pwm_motor1();
int pwm_motor2();
void configChanged();
void pitchRollChanged();
void joyStickChanged();
+ void connectedChanged();
public slots:
void navDataUpdated();
void statusUpdated();
bool m_ctrlActive;
bool m_useAccel;
bool m_useJoyStick;
+ bool m_connected;
-#ifdef JOYSTICK
-// Joystick
- bool m_haveJoyStick;
- QString m_joyStickName;
- bool m_joyCal;
- int m_joyStickRawAxis1;
- int m_joyStickRawAxis2;
- int m_joyStickRawAxis3;
- int m_joyStickRawAxis4;
- int m_joyStickRawAxis5;
- int m_joyStickRawAxis6;
- float m_joyStickAxis1;
- float m_joyStickAxis2;
- float m_joyStickAxis3;
- float m_joyStickAxis4;
- float m_joyStickAxis5;
- float m_joyStickAxis6;
- int m_joyStickMinAxis1;
- int m_joyStickMinAxis2;
- int m_joyStickMinAxis3;
- int m_joyStickMinAxis4;
- int m_joyStickMinAxis5;
- int m_joyStickMinAxis6;
- int m_joyStickMaxAxis1;
- int m_joyStickMaxAxis2;
- int m_joyStickMaxAxis3;
- int m_joyStickMaxAxis4;
- int m_joyStickMaxAxis5;
- int m_joyStickMaxAxis6;
- int m_joyStickMapAxis[6];
-#endif
DroneThread *droneThread;
QSettings *droneSettings;
-#ifdef HAVE_SDL
- QTimer joyStickTimer;
- SDL_Joystick *joyStick;
-#endif
+
#ifdef QT_SENSORS
QRotationSensor *rSensor; // used for controllind drone with device rotation
#endif
enum droneState {
notInitialized,
initialized,
+ bootstrap,
ready,
flying
QUdpSocket *navSock; // Navigation data receive socket port 5554
QUdpSocket *cmdSock; // Ay command socket port 5556
int state;
+ int retry; // retry counter
+ int noreply; // No reply counter incremented every sedcmd, cleared when got reply
int seq; // Drone command seq number
bool m_fly;
bool m_emergency;
QObject(parent)
{
vx=0;vy=0;vz=0;pwm_motor1=0;pwm_motor2=0;pwm_motor3=0;pwm_motor4=0;
- vbat=0.0;pitch=0.0;roll=0.0;yaw=0.0;altitude=0.0;
+ vbat=0.0;pitch=0.0;roll=0.0;yaw=0.0;altitude=0.0;navSeq=0;
}
+void NavData::setState(QString _state)
+{
+ decodedState=_state;
+ oldState=0;
+ emit stateUpdated();
+};
void NavData::parseRawNavData(char *buf,unsigned int len)
{
qDebug("parseRawNavData hdr=%8x state=%08x seq=%06d opt[0].tag=%d size=%d",
nd->header,nd->ardrone_state,nd->sequence,nd->options[0].tag,nd->options[0].size);
#endif
- qDebug() << decodedState;
+// qDebug() << len << decodedState;
op=&(nd->options[0]);
- while((((unsigned int)op-(unsigned int)buf)<len) && (op->size>0))
+ while((((unsigned long)op-(unsigned long)buf)<len) && (op->size>0))
{
parseOption(op);
- op=(navdata_option_t *)((unsigned int)op+op->size);
+ op=(navdata_option_t *)((unsigned long)op+op->size);
}
};
void NavData::parseOption(navdata_option_t *op)
{
- // qDebug("parseOption tag=%d size=%d",op->tag,op->size);
+// qDebug("parseOption tag=%d size=%d",op->tag,op->size);
switch(op->tag) {
case NAVDATA_DEMO_TAG:
{
vy=ndemo->vy;
vz=ndemo->vz;
emit navDataUpdated();
-// qDebug("pitch=%2.1f roll=%2.1f yaw=%2.1f alt=%2.1f v(%2.1f,%2.1f,%2.1f bat=%2.1f",pitch,roll,yaw,altitude,vx,vy,vz,vbat);
+ // qDebug("NAVDATA_DEMO:pitch=%2.1f roll=%2.1f yaw=%2.1f alt=%2.1f v(%2.1f,%2.1f,%2.1f bat=%2.1f",pitch,roll,yaw,altitude,vx,vy,vz,vbat);
}
break;
case NAVDATA_TIME_TAG:
current_motor4=npwm->current_motor4;
pwm_motor4=npwm->motor4;
emit navDataUpdated();
- // qDebug("pwm1=%3d I1=%4f pwm2=%3d I2=%4f pwm3=%3d I3=%4f pwm4=%3d I4=%4f",
- // pwm_motor1,current_motor1,pwm_motor2,current_motor2,pwm_motor3,current_motor3,pwm_motor4,current_motor4);
+ // qDebug("pwm1=%3d I1=%4f pwm2=%3d I2=%4f pwm3=%3d I3=%4f pwm4=%3d I4=%4f",
+ // pwm_motor1,current_motor1,pwm_motor2,current_motor2,pwm_motor3,current_motor3,pwm_motor4,current_motor4);
}
break;
case NAVDATA_ALTITUDE_TAG: //10
QString NavData::decodeState(unsigned int state,int level)
{
- QString s="%1 ";
- s=s.arg(state,8,16);
+ QString s;
+ s=QString("%1 %2 ").arg(navSeq++).arg(state,8,16);
s+=(state & ARDRONE_FLY_MASK)==0 ? "landed ":"flying ";
if(level>1) s+=(state & ARDRONE_VIDEO_MASK)==0 ?"video disable ":"video ena ";
if(level>1)s+=(state & ARDRONE_VISION_MASK)==0 ? "vision disable ":"vision ena ";
// s+=(state & ARDRONE_FW_VER_MASK )==0 ? /* Firmware update is newer;
// ARDRONE_FW_UPD_MASK = 1 << 9, /* Firmware update is ongoing (1;
s+=(state & ARDRONE_NAVDATA_DEMO_MASK )==0 ? "All navdata ":"navdata demo ";
- s+=(state & ARDRONE_NAVDATA_BOOTSTRAP)==0 ? "":"Navdata bootstrap ";
+ s+=(state & ARDRONE_NAVDATA_BOOTSTRAP)==0 ? "":"Navdata bootstrap ";
// s+=(state & ARDRONE_MOTORS_MASK)==0 ? /*!< Motors status : (0) Ok, (1) Motors problem */
s+=(state & ARDRONE_COM_LOST_MASK)? "Com Lost ":"Com ok ";
if(level>1)s+=(state & ARDRONE_VBAT_LOW) ? "VBat low ":"Vbat Ok ";
explicit NavData(QObject *parent = 0);
void parseRawNavData(char *buf,unsigned int len);
void parseOption(navdata_option_t *op);
+ void setState(QString state);
QString decodeState(unsigned int state,int level);
unsigned int state,oldState;
int pwm_motor3;
int pwm_motor4;
tag_t tags[4];
+ int navSeq;
signals:
void navDataUpdated();
void stateUpdated();
picture.cr_line_size = pictureWidth / 2;
picture.y_pad = 0;
picture.c_pad = 0;
- video_codec_open(&controller, (codec_type_t)UVLC_CODEC);
+ qDebug() << "video_codec_open=" << video_codec_open(&controller, (codec_type_t)codec_type);
//stateTimer->start(1000);
qDebug() << "videoThread::run() initialized";
sendVideoPort("AT");
controller.in_stream.code = 0;
bool_t got_image = FALSE;
- //qDebug() <<"VideoThread::decodeTransform";
- video_decode_blockline( &controller, &picture, &got_image );
+ //qDebug() <<"VideoThread::decodeTransform" << controller.video_codec;
+ if(controller.video_codec!=NULL) video_decode_blockline( &controller, &picture, &got_image );
+ //else qDebug() << "No video controller";
//qDebug() <<"VideoThread::decodeTransform 2";
//video_decode_picture( &controller, &picture, &stream, &got_image );
if( got_image )
+++ /dev/null
-/*==================================================================
- !
- ! mardrone application AR-Drone for MeeGo
-
- ! Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
- ! All rights reserved.
- !
- ! Author:Kate Alhola kate.alhola@nokia.com
- !
- ! GNU Lesser General Public License Usage
- ! This file may be used under the terms of the GNU Lesser
- ! General Public License version 2.1 as published by the Free Software
- ! Foundation and appearing in the file LICENSE.LGPL included in the
- ! packaging of this file. Please review the following information to
- ! ensure the GNU Lesser General Public License version 2.1 requirements
- ! will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
- !
- !
- !
- *===================================================================*/
-
-#include "gauge.h"
-#include "qgraphicswidget.h"
-#include "QGraphicsItem"
-#include <QPainter>
-#include <QDebug>
-
-Gauge::Gauge(QGraphicsItem *parent) :
- QGraphicsWidget(parent)
-{
- qDebug() << "Gauge::Gauge()";
-}
-#if 1
-void Gauge::paint(QPainter *painter,
- const QStyleOptionGraphicsItem *option,
- QWidget *widget)
- {
-
- }
-#endif
-void Gauge::setValue(float val_)
-{
- m_value=val_;
- update(boundingRect()); // Value updated, schedule redtaw
-};
-float Gauge::value()
-{
- return m_value;
-};
-
-QRectF Gauge::boundingRect() const
- {
- return QRectF(0.0,0.0,size().width(),size().height());
- }
+++ /dev/null
-#ifndef GAUGEBAND_H
-#define GAUGEBAND_H
-
-#include <QGraphicsWidget>
-#include <QGraphicsItem>
-#include <QPainter>
-
-#define UP 1
-#define RIGHT 2
-#define DOWN 3
-#define LEFT 4
-
-#define SCROLL 0x10
-#define SCROLL_UP 0x11
-#define SCROLL_RIGHT 0x12
-#define SCROLL_DOWN 0x13
-#define SCROLL_LEFT 0x14
-
-class Gauge : public QGraphicsWidget
-{
- Q_OBJECT
- Q_PROPERTY(QString name READ name WRITE setName)
- Q_PROPERTY(QString format READ format WRITE setFormat)
- Q_PROPERTY(int gaugeStyle READ gaugeStyle WRITE setGaugeStyle)
- Q_PROPERTY(float value2 READ value2 WRITE setValue2)
- Q_PROPERTY(float value READ value WRITE setValue)
- Q_PROPERTY(float low READ low WRITE setLow)
- Q_PROPERTY(float high READ high WRITE setHigh)
- Q_PROPERTY(float lowRed READ lowRed WRITE setLowRed)
- Q_PROPERTY(float highRed READ highRed WRITE setHighRed)
- Q_PROPERTY(float tickIncrement READ tickIncrement WRITE setTickIncrement)
-
-public:
- explicit Gauge(QGraphicsItem *parent = 0);
-
-
- virtual void paint(QPainter *painter,const QStyleOptionGraphicsItem *option,
- QWidget *widget);
-
- QRectF boundingRect() const;
-
- QString name() const { return m_name;};
- void setName(const QString &name_) {m_name=name_;}
- QString format() const { return m_format;};
- void setFormat(const QString &name_) {m_format=name_;}
- void setGaugeStyle(int val_) { m_style=val_;};
- int gaugeStyle() {return m_style;};
- void setValue(float val_);
- float value();
- void setValue2(float val_) { m_value2=val_;};
- float value2() {return m_value2;};
- void setLow(float val_) { m_low=val_;};
- float low() {return m_low;};
- void setHigh(float val_) { m_high=val_;};
- float high() {return m_high;};
- void setLowRed(float val_) { m_lowred=val_;};
- float lowRed() {return m_lowred;};
- void setHighRed(float val_) { m_highred=val_;};
- float highRed() {return m_highred;};
- void setTickIncrement(float val_) { m_tickIncrement=val_;};
- float tickIncrement() {return m_tickIncrement;};
-
-signals:
-
-public slots:
-public:
- QString m_name;
- QString m_format;
- int m_tickIncrement; // Tick increment
- int m_tspc; // Tick spacing
- int m_style;
- float m_value; // primary value,pitch in horizon
- float m_value2; // Roll in horizon
- float m_low; // low value to display
- float m_high; // High value to display
- float m_lowred; // low red limit
- float m_lowyellow; // low yellow limit
- float m_highyellow; // higest yellow limit
- float m_highred;
-};
-
-#endif // GAUGE_H
+++ /dev/null
-/*==================================================================
- !
- ! mardrone application AR-Drone for MeeGo
-
- ! Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
- ! All rights reserved.
- !
- ! Author:Kate Alhola kate.alhola@nokia.com
- !
- ! GNU Lesser General Public License Usage
- ! This file may be used under the terms of the GNU Lesser
- ! General Public License version 2.1 as published by the Free Software
- ! Foundation and appearing in the file LICENSE.LGPL included in the
- ! packaging of this file. Please review the following information to
- ! ensure the GNU Lesser General Public License version 2.1 requirements
- ! will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
- !
- !
- !
- *===================================================================*/
-
-#include "gaugehorizon.h"
-#include <QDebug>
-#include <math.h>
-
-GaugeHorizon::GaugeHorizon(QGraphicsItem *parent) :
- Gauge(parent)
-{
-}
-
-
-
-void GaugeHorizon::paint(QPainter *painter,const QStyleOptionGraphicsItem *option,
- QWidget *widget)
-{
- drawHorizon(painter,-1.0*m_value,5*m_value2);
-};
-//////////////////////////////////////////////////////////////////////////
-void GaugeHorizon::drawHorizon(QPainter *painter, float roll, float pitch)
- {
- QRect update_rect;
- QPoint points[10];
- //QPoint plane[10];
- QVector<QLine> plane;
- QVector<QLine> fixo;
- int tx, ctx, xd, i, j ;
- int xo, yo, x1, x2, y1, y2;
-
- xo=size().width()/2;
- yo=size().height()/2;
-
- plane+=QLine(xo-50,yo,xo-20,yo);
- plane+=QLine(xo-20,yo,xo-10,yo+10);
- plane+=QLine(xo-10,yo+10,xo,yo);
- plane+=QLine(xo,yo,xo+10,yo+10);
- plane+=QLine(xo+20,yo,xo+10,yo+10);
- plane+=QLine(xo+50,yo,xo+20,yo);
-
-
- static float sintable[]={sin(15*3.141592653/180.0),
- sin(30*3.141592653/180.0),
- sin(45*3.141592653/180.0),
- sin(60*3.141592653/180.0)};
-
- static float costable[]={cos(15*3.141592653/180.0),
- cos(30*3.141592653/180.0),
- cos(45*3.141592653/180.0),
- cos(60*3.141592653/180.0)};
-
- i = 0;
- int arc0=130;
- int arc1=150;
- fixo+=QLine(xo,yo-arc0,xo,yo-arc1);
- for (i = 0; i < 4; i++) {
- fixo+=QLine(xo+arc0*costable[i],yo-arc0*sintable[i],xo+arc1*costable[i],yo-arc1*sintable[i]);
- fixo+=QLine(xo-arc0*costable[i],yo-arc0*sintable[i],xo-arc1*costable[i],yo-arc1*sintable[i]);
- };
-
-
- tx = (int)(xo * tan(roll * 3.141592653/180.0));
- xd = yo + pitch * 4;
-
- QTransform savematrix= painter->transform ();
- // painter->setClipRect(QRect(0,0, size().width(),size().height()/2));
-
- painter->setTransform(QTransform().translate(xo+scenePos().x(), yo+scenePos().y()+pitch).rotate(roll));
-
- QBrush whitebrush(Qt::green);
- painter->setBrush(whitebrush);
- QPen whitepen(Qt::green);
- whitepen.setWidth(2);
- painter->setPen(whitepen);
- xo=0;yo=0;
-
- painter->drawLine(50+xo, 0+yo,-50+xo, 0+yo);
- painter->drawLine(40+xo, 50+yo,-40+xo, 50+yo);
- painter->drawLine(40+xo, 100+yo,-40+xo, 100+yo);
- painter->drawLine(40+xo, -50+yo,-40+xo, -50+yo);
- painter->drawLine(40+xo, -100+yo,-40+xo,-100+yo);
-
- painter->drawText( 43+xo,-40+yo,"10");
- painter->drawText(-63+xo,-40+yo,"10");
- painter->drawText( 43+xo,-90+yo,"20");
- painter->drawText(-63+xo,-90+yo,"20");
- painter->drawText( 43+xo, 40+yo,"10");
- painter->drawText(-63+xo, 40+yo,"10");
- painter->drawText( 43+xo, 90+yo,"20");
- painter->drawText(-63+xo, 90+yo,"20");
-
-
- // painter->rotate(0);
- painter->setTransform(savematrix);
- QPen bluepen(Qt::blue);
- bluepen.setWidth(2);
- painter->setPen(bluepen);
- painter->drawLines(fixo);
- painter->drawLines(plane);
-
-
-
-}
-
+++ /dev/null
-#ifndef GAUGELABEL_H
-#define GAUGELABEL_H
-#include "gauge.h"
-
-class GaugeHorizon : public Gauge
-{
- Q_OBJECT
-public:
- explicit GaugeHorizon(QGraphicsItem *parent = 0);
- void paint(QPainter *painter,const QStyleOptionGraphicsItem *option,
- QWidget *widget);
- void drawHorizon(QPainter *painter,float pitch,float roll);
-signals:
-};
-
-#endif // GAUGELABEL_H
+++ /dev/null
-/*==================================================================
- !
- ! mardrone application AR-Drone for MeeGo
-
- ! Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
- ! All rights reserved.
- !
- ! Author:Kate Alhola kate.alhola@nokia.com
- !
- ! GNU Lesser General Public License Usage
- ! This file may be used under the terms of the GNU Lesser
- ! General Public License version 2.1 as published by the Free Software
- ! Foundation and appearing in the file LICENSE.LGPL included in the
- ! packaging of this file. Please review the following information to
- ! ensure the GNU Lesser General Public License version 2.1 requirements
- ! will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
- !
- !
- !
- *===================================================================*/
-
-#include "gaugelabel.h"
-#include <QDebug>
-
-
-GaugeLabel::GaugeLabel(QGraphicsItem *parent) :
- Gauge(parent)
-{
-}
-
-void GaugeLabel::paint(QPainter *painter,const QStyleOptionGraphicsItem *option,
- QWidget *widget)
-{
- drawNumLabel(painter);
-};
-//////////////////////////////////////////////////////////////////////////
-void GaugeLabel::drawNumLabel(QPainter *painter)
-{
- int ld,ldo,ud,lo;
- int split,uw,base;
- char text[20] = {0};
- int h=size().height();
- int w=size().width();
- int val=m_value;
- painter->save();
- qDebug() <<"drawnumlabel=" << m_name << " h=" << h << "w=" << w;
- if(m_style&SCROLL) {
- QFont sansFont("Helvetica [Cronyx]", 12);
- QFontMetrics fm(sansFont);
- painter->setFont(sansFont);
-
- ld=abs(val%100);
- ud=val/100;
- ldo=ld%10;
- printf("ld=%d ldo=%d lo=%d h=%d\n",ld,ldo,lo,h);
- lo=(ldo*h)/-20;
- drawLabel(painter, text, m_style);
- sprintf(text, "%3d", ud);
- split=w/2;
- base=(h+fm.ascent())/2;
- uw=fm.width(text);
-
- painter->drawText(split-uw+6, base, text);
- sprintf(text, "%02d", abs((ld-ldo-20)%100));
- painter->drawText(split+ 7, base -h +lo, text);
- sprintf(text, "%02d", abs((ld-ldo-10)%100));
- painter->drawText(split+ 7, base -h/2 +lo, text);
- sprintf(text, "%02d", abs((ld-ldo)%100));
- painter->drawText(split +7, base +lo, text);
- sprintf(text, "%02d", abs((ld-ldo+10)%100));
- painter->drawText(split + 7,base + h/2 +lo , text);
- sprintf(text, "%02d", abs((ld-ldo+20)%100));
- painter->drawText(split + 7,base + h +lo , text);
-
-
- } else {
- sprintf(text, "%3d", val);
- drawLabel(painter, text,m_style);
- }
- painter->restore(); // Restore and remove clicping rectabgle
-}
-
-///////////////////////////////////////////////////////////////////////////
-void GaugeLabel::drawLabel(QPainter *painter,char *text,int style)
-{
- int textlen = 0, i = 0;
- int xplace=0;
- int yplace=0;
- int height=size().height();
- int width=size().width();
- int scrbox=(height*10)/30;
-
-
- QVector<QPoint> nboxv;
-
- QPen pen(Qt::white);
- painter->setPen(pen);
-
-
- if (style&7 == LEFT) xplace+=5;
-
- nboxv.push_back(QPoint(xplace,yplace));
-
-
-
- if (style&7 == UP) {
- nboxv.push_back(QPoint(xplace+(width/2)-5,yplace ));
- nboxv.push_back(QPoint(xplace+(width/2) ,yplace-5));
- nboxv.push_back(QPoint(xplace+(width/2)+5,yplace ));
- }
-
- if (style&SCROLL) {
- nboxv.push_back(QPoint(xplace+width/2,yplace));
- nboxv.push_back(QPoint(xplace+width/2,yplace-scrbox));
- nboxv.push_back(QPoint(xplace+width,yplace-scrbox ));
- } else
- nboxv.push_back(QPoint(xplace+width,yplace ));
-
-
- if (style&7== RIGHT) {
-
- nboxv.push_back(QPoint(xplace+width ,yplace+(height/2)-5));
- nboxv.push_back(QPoint(xplace+width+5,yplace+(height/2) ));
- nboxv.push_back(QPoint(xplace+width ,yplace+(height/2)+5));
- }
-
- if (style&SCROLL) {
- nboxv.push_back(QPoint(xplace+width,yplace+height+scrbox));
- nboxv.push_back(QPoint(xplace+width/2,yplace+height+scrbox));
- nboxv.push_back(QPoint(xplace+width/2,yplace+height));
- } else
- nboxv.push_back(QPoint(xplace+width,yplace+height));
-
- if (style&7== DOWN) {
- nboxv.push_back(QPoint(xplace+(width/2)-5,yplace+height));
- nboxv.push_back(QPoint(xplace+(width/2) ,yplace+height+5));
- nboxv.push_back(QPoint(xplace+(width/2)+5,yplace+height));
- }
-
- nboxv.push_back(QPoint(xplace,yplace+height));
-
- if (style&7 == LEFT) {
- nboxv.push_back(QPoint(xplace ,yplace+(height/2)+5));
- nboxv.push_back(QPoint(xplace-5,yplace+(height/2) ));
- nboxv.push_back(QPoint(xplace ,yplace+(height/2)-5));
- }
-
- nboxv.push_back(QPoint(xplace,yplace));
-
- textlen = strlen(text) + 2;
-
- // pdrawable->draw_rectangle(pwidget->get_style()->get_black_gc(),
- // true, xplace, yplace, width, height);
-
- if (style&SCROLL)
- painter->setClipRect(QRect(xplace-5,yplace-scrbox, width+10, height+2*scrbox+1));
-
- QBrush brush(QColor(0,0,0,255));
- // QFont tapeFont("Helvetica [Cronyx]", 18);
- // painter->setFont(tapeFont);
- // painter->setPen(pen);
- painter->setBrush(brush);
-
- painter->drawPolygon(nboxv);
-
- painter->drawLines(nboxv);
-
- // painter->setBrush(brush);
- QFont sansFont("Helvetica [Cronyx]", 12);
- QFontMetrics fm(sansFont);
- painter->setFont(sansFont);
-
- painter->drawText(xplace + 3, yplace + (height+fm.ascent())/2, text);
-}
-
+++ /dev/null
-#ifndef GAUGELABEL_H
-#define GAUGELABEL_H
-#include "gauge.h"
-
-class GaugeLabel : public Gauge
-{
- Q_OBJECT
-public:
- explicit GaugeLabel(QGraphicsItem *parent = 0);
- void paint(QPainter *painter,const QStyleOptionGraphicsItem *option,
- QWidget *widget);
- void drawNumLabel(QPainter *painter);
- void drawLabel(QPainter *painter,char *text,int style);
-signals:
-};
-
-#endif // GAUGELABEL_H
Item {
id: root
property real value : 0
+ property url bezel:""
// width: 200; height: 200
source: "needle1.png"
}
- Rectangle {
- color: "blue"
- x:0;y:0; width:10;height:10
- }
-
Image {
id: needle1
x: (root.width/2)-(width/2); y:(root.width/2)
source: "needle2.png"
}
- // Image { x: 21; y: 18; source: "overlay.png" }
+ Image {
+ id:bezelImg
+ anchors.fill:parent
+ source: bezel
+ }
}
id: root
property real roll : 0
property real pitch : 0
+ property url bezel:""
// width: 200; height: 200
rotation: root.roll;
anchors.centerIn: frame
transformOrigin: Item.Center
- scale: frame.scale*0.4
+ scale: frame.scale*0.3
source: "ati2.png"
Image {
anchors.centerIn: rollItem
// transformOrigin: Item.Center
// rotation: root.roll;
transform:
- Translate { y: root.pitch }
-
-
+ Translate { y: root.pitch*2 }
source: "ati4.png"
}
Image {
- anchors.centerIn: frame
- // scale: frame.scale*0.4
- // transformOrigin: rollItem.Center
- // rotation: root.roll;
+ anchors.centerIn: rollItem
+ transformOrigin: rollItem.Center
+ //rotation: root.roll;
source: "ati2.png"
}
}
Image {
- anchors.bottom:parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- scale: frame.scale*0.22
+ // Static center plane
+ anchors.horizontalCenter: frame.horizontalCenter
+ y:15
+ scale: frame.scale*0.3
source: "ati5.png"
}
anchors.fill:parent
source: "ati1.png"
}
+ Image {
+ id:bezelImg
+ anchors.fill:parent
+ source: bezel
+ }
}
property color indicatorColor:"white"
property alias groundColor:horizon.horizonGroundColor
property alias skyColor:horizon.horizonSkyColor
+ property url bezel:""
GaugeHorizon {
id:horizon
displayScale:pfd.displayScale
backColor:"#c0000000"
name: "alt"
}
-
+ BorderImage {
+ id:bezelImg
+ anchors.fill:parent
+ source: bezel
+ border.bottom:10;border.top:10
+ border.left: 10;border.right: 10
+ }
}
#include "dronecontrol.h"
#include "video.h"
#include "gaugehorizon.h"
+#include "gaugetape.h"
+#include "gaugelabel.h"
#include <QDeclarativeView>
#include <QDeclarativeContext>
#include <QDeclarativeEngine>
#include <QtDeclarative>
-#include <QtComponents/qdeclarativewindow.h>
+#include <QSettings>
+#include "joystick.h"
+#include "qdeclarativetoucharea.h"
+
+QString selectQmlMain(QStringList inportPaths,QString cmdParam,QString activeUI);
+
+// MacOSX sdl hack so that SDL won't hijack main
+#undef main
int main(int argc, char *argv[])
{
qmlRegisterType<DroneControl>("Drone", 1, 0, "DroneControl");
qmlRegisterType<DroneVideo>("Drone", 1, 0, "DroneVideo");
- qmlRegisterType<GaugeHorizon>("Drone", 1, 0, "GaugeHorizon");
+ qmlRegisterType<GaugeTape>("Gauges", 1, 0, "GaugeTape");
+ qmlRegisterType<GaugeLabel>("Gauges", 1, 0, "GaugeLabel");
+ qmlRegisterType<GaugeHorizon>("Gauges", 1, 0, "GaugeHorizon");
+ qmlRegisterType<JoyStick>("JoyStick", 1, 0, "JoyStick");
+ qmlRegisterType<QDeclarativeTouchArea>("TouchArea", 1, 0, "TouchArea");
+
QApplication app(argc, argv);
QUrl *url;
- qDebug() << "./ardrone.qml exists " << QFile("ardrone.qml").exists();
- qDebug() << ":/ardrone.qml exists " << QFile(":/ardrone.qml").exists();
- if(QFile("ardrone.qml").exists()) {
- QDir::setCurrent(app.applicationDirPath());
- url=new QUrl(QUrl::fromLocalFile("ardrone.qml"));
- }
- else {
- QDir::setCurrent(":/");
- url=new QUrl("qrc:/ardrone.qml");
- }
- QDeclarativeWindow window(*url);
- window.window()->show();
+ QSettings *mardroneSettings=new QSettings("katix.org","mardrone");
+ QString activeUi=mardroneSettings->value("activeUI","ardrone_desktop.qml").toString();
+ qDebug() << "activeUI=" << activeUi;
+ QString qmlmainfile=app.arguments().size()>=2 ? app.arguments()[1]:"";
+ QDeclarativeView window;
+ window.rootContext()->setContextProperty("MArdrone",window.window());
+ QObject::connect((QObject*)window.engine(), SIGNAL(quit()), &app, SLOT(quit()));
+ // Check available UI's
+ window.engine()->addImportPath("qrc:/gauges/");
+ window.engine()->addImportPath("qrc:");
+ window.engine()->addImportPath("gauges");
+ window.engine()->addImportPath(".");
+ qDebug() << "ImportPathList" << window.engine()->importPathList() << window.engine()->importPathList();;
+ QStringList importPath=window.engine()->importPathList();
+ QString qmlFile=QString("qrc:/")+selectQmlMain(importPath,qmlmainfile,activeUi);
+ qDebug() << "using:" << qmlFile;
+
+ if(qmlFile.contains("desktop")) { // We have desktop UI
+ QDeclarativeComponent component(window.engine(),QUrl(qmlFile));
+ if(component.isError()) qDebug() << component.errors(); else
+ QObject *myObject = component.create();
+ } else { // We have Mobile UI
+ window.setSource(QUrl(qmlFile));
+ QRect screenGeometry=QApplication::desktop()->screenGeometry();
+ window.setAttribute(Qt::WA_LockLandscapeOrientation, true);
+ if((screenGeometry.height()<=800) && (screenGeometry.width()<=1024)) window.window()->showFullScreen();
+ else window.window()->show();
+ }
return app.exec();
}
+
+QString selectQmlMain(QStringList importPaths,QString cmdParam,QString activeUI)
+{
+ QString importPath=importPaths.last();
+ if(cmdParam.contains(".qml")) return cmdParam;
+ if(cmdParam.isEmpty() && !activeUI.isEmpty()) return activeUI;
+ if(cmdParam=="harmattan" || (cmdParam=="" && QFile(importPath+"/com/nokia/meego").exists())) return QString("ardrone_harmattan.qml");
+ if(cmdParam=="symbian" || (cmdParam=="" && QFile(importPath+"/MeeGo/Components").exists())) return QString("ardrone_symbian.qml");
+ if(cmdParam=="desktop" || (cmdParam=="" && QFile(importPath+"/QtDesktop").exists())) return QString("ardrone_desktop.qml");
+ return(activeUI);
+}
QT += core gui declarative network
-
-CONFIG += mobility
+CONFIG += mobility link_pkgconfig
MOBILITY += sensors
TARGET = mardrone
TEMPLATE = app
-AR_DRONE_SDK= $$(HOME)/ARDrone_SDK_1_5_Version_20101004
-LIBS +=-lQtComponents -L$${AR_DRONE_SDK}/lib -lvlib -lsdk
+AR_DRONE_SDK = ARDrone_SDK_Version_1_8_20110726
+#LIBS += -Lardrone-lib-x86 -lvlib -lsdk
+#LIBS += -L../mardrone/ardrone-lib-arm -lvlib -lsdk
+
+#For Android
+macx {
+message("Compiling for Mac OSx")
+LIBS += -L../mardrone/ardrone-lib-osx -lvlib
+LIBS += -framework SDL
+DEFINES+=HAVE_SDL
+}
+android {
+ LIBS += -L../mardrone/ardrone-lib-android -lvlib -lsdk /home/kate/necessitas/android-ndk-r6b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a
+}
+SUBDIRS += $${AR_DRONE_SDK}
+
+system(pkg-config --exists QtSensors){
+ message("I have QtSensors")
+ DEFINES+=QT_SENSORS
+}
+message("QMAKESPEC is:")
+message($$QMAKESPEC)
SOURCES += main.cpp\
- dronecontrol.cpp \
- navdata.cpp \
- video.cpp \
- gauge.cpp \
- gaugelabel.cpp \
- gaugehorizon.cpp
-
-INCLUDEPATH += $${AR_DRONE_SDK}/ARDroneLib/Soft/Common \
+ dronelib/dronecontrol.cpp \
+ dronelib/navdata.cpp \
+ dronelib/video.cpp \
+ gauges/gauge.cpp \
+ gauges/gaugelabel.cpp \
+ gauges/gaugetape.cpp \
+ gauges/gaugehorizon.cpp \
+ dronelib/joystick.cpp \
+ qdeclarativetoucharea.cpp
+
+INCLUDEPATH += dronelib \
+ gauges \
+ $${AR_DRONE_SDK}/ARDroneLib/Soft/Common \
$${AR_DRONE_SDK}/ARDroneLib/VP_SDK \
$${AR_DRONE_SDK}/ARDroneLib/VP_SDK/VP_Os/linux \
$${AR_DRONE_SDK}/ARDroneLib/VP_SDK/VP_Os \
$${AR_DRONE_SDK}/ARDroneLib/VLIB \
$${AR_DRONE_SDK}/ARDroneLib
-HEADERS += dronecontrol.h \
- navdata.h \
- video.h \
- gauge.h \
- gaugelabel.h \
- gaugehorizon.h
+HEADERS += dronelib/dronecontrol.h \
+ dronelib/navdata.h \
+ dronelib/video.h \
+ gauges/gauge.h \
+ gauges/gaugelabel.h \
+ gauges/gaugetape.h \
+ gauges/gaugehorizon.h \
+ dronelib/joystick.h \
+ qdeclarativetoucharea.h
+
+system(pkg-config --exists sdl){
+ message("I have sdl")
+ DEFINES+=HAVE_SDL
+ SOURCES +=
+ HEADERS +=
+ LIBS+=-lSDL
+}
OTHER_FILES += \
- ardrone.qml \
- JoyStick.qml \
JoyStick2.qml \
debian/changelog \
debian/compat \
debian/rules \
ardrone1.desktop \
BarGauge.qml \
- ConfigDialog.qml
+ ConfigDialog.qml \
+ ardrone_harmattan.qml \
+ ardrone_desktop.qml \
+ ConfigDialogDesktop.qml \
+ gauges/AltGauge.qml \
+ gauges/alt2.png \
+ gauges/needle1.png \
+ gauges/needle2.png \
+ gauges/EfisPFD.qml \
+ gauges/qmldir.txt \
+ dronelib/JoyStickCalibrator.qml \
+ dronelib/JoyStickIndicator.qml \
+ CalibrateDialog.qml \
+ JoyStickCalibrator.qml \
+ JoyStickIndicator.qml \
+ JoyStickTouch.qml \
+ gauges/qmldir \
+ qtc_packaging/debian_harmattan/rules \
+ qtc_packaging/debian_harmattan/README \
+ qtc_packaging/debian_harmattan/manifest.aegis \
+ qtc_packaging/debian_harmattan/copyright \
+ qtc_packaging/debian_harmattan/control \
+ qtc_packaging/debian_harmattan/compat \
+ qtc_packaging/debian_harmattan/changelog \
+ gauges/AttitudeGauge.qml \
+ CalibrateDialogDesktop.qml \
+ JoyStickCalibratorDesktop.qml \
+ ardrone_symbian.qml \
+ ConfigDialogSymbian.qml \
+ gauges/GenericGauge.qml \
+ gauges/HeadingGauge.qml
unix:!symbian {
maemo5 {
RESOURCES += \
ardrone.qrc
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
+<!-- Written by Qt Creator 2.3.1, 2012-01-11T14:12:54. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
- <value type="int">0</value>
+ <value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
- <value key="EditorConfiguration.Codec" type="QByteArray">Default</value>
+ <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
+ <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
+ <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
+ <value type="QString" key="language">Cpp</value>
+ <valuemap type="QVariantMap" key="value">
+ <value type="bool" key="AlignAssignments">false</value>
+ <value type="QString" key="CurrentFallback">CppProject</value>
+ <value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
+ <value type="bool" key="IndentAccessSpecifiers">false</value>
+ <value type="bool" key="IndentBlockBody">true</value>
+ <value type="bool" key="IndentBlockBraces">false</value>
+ <value type="bool" key="IndentBlocksRelativeToSwitchLabels">false</value>
+ <value type="bool" key="IndentClassBraces">false</value>
+ <value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
+ <value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
+ <value type="bool" key="IndentEnumBraces">false</value>
+ <value type="bool" key="IndentFunctionBody">true</value>
+ <value type="bool" key="IndentFunctionBraces">false</value>
+ <value type="bool" key="IndentNamespaceBody">false</value>
+ <value type="bool" key="IndentNamespaceBraces">false</value>
+ <value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
+ <value type="bool" key="IndentSwitchLabels">false</value>
+ </valuemap>
+ </valuemap>
+ <value type="int" key="EditorConfiguration.CodeStyle.Count">1</value>
+ <value type="QByteArray" key="EditorConfiguration.Codec">System</value>
+ <value type="QString" key="EditorConfiguration.CurrentFallback">Global</value>
+ <value type="int" key="EditorConfiguration.IndentSize">4</value>
+ <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
+ <value type="int" key="EditorConfiguration.PaddingMode">1</value>
+ <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
+ <value type="bool" key="EditorConfiguration.SmartBackspace">false</value>
+ <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
+ <valuemap type="QVariantMap" key="EditorConfiguration.Tab.0">
+ <value type="QString" key="language">Cpp</value>
+ <valuemap type="QVariantMap" key="value">
+ <value type="bool" key="AutoIndent">true</value>
+ <value type="bool" key="AutoSpacesForTabs">false</value>
+ <value type="QString" key="CurrentFallback">CppGlobal</value>
+ <value type="int" key="IndentSize">4</value>
+ <value type="int" key="PaddingMode">1</value>
+ <value type="bool" key="SmartBackspace">false</value>
+ <value type="bool" key="SpacesForTabs">true</value>
+ <value type="int" key="TabKeyBehavior">0</value>
+ <value type="int" key="TabSize">8</value>
+ </valuemap>
+ </valuemap>
+ <valuemap type="QVariantMap" key="EditorConfiguration.Tab.1">
+ <value type="QString" key="language">QmlJS</value>
+ <valuemap type="QVariantMap" key="value">
+ <value type="bool" key="AutoIndent">true</value>
+ <value type="bool" key="AutoSpacesForTabs">false</value>
+ <value type="QString" key="CurrentFallback">QmlJSGlobal</value>
+ <value type="int" key="IndentSize">4</value>
+ <value type="int" key="PaddingMode">1</value>
+ <value type="bool" key="SmartBackspace">false</value>
+ <value type="bool" key="SpacesForTabs">true</value>
+ <value type="int" key="TabKeyBehavior">0</value>
+ <value type="int" key="TabSize">8</value>
+ </valuemap>
+ </valuemap>
+ <value type="int" key="EditorConfiguration.Tab.Count">2</value>
+ <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
+ <value type="int" key="EditorConfiguration.TabSize">8</value>
+ <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
+ <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
+ <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
+ <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
+ <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
+ <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Desktop</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.DesktopTarget</value>
- <value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">0</value>
- <value key="ProjectExplorer.Target.ActiveDeployConfiguration" type="int">0</value>
- <value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
- <valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap">
- <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
- <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qmake</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
- <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Target.DesktopTarget</value>
+ <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
+ <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
+ <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
+ <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-32bit.gdb</value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+ <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
+ <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value>
+ <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+ <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
</valuemap>
- <valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
- <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
- <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
- <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+ <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
+ <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
+ <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
- <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Build</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
+ <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
- <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
- <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
- <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
- <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
- <value type="QString">clean</value>
- </valuelist>
- <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+ <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
+ <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+ <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
- <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Clean</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
+ <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+ </valuemap>
+ <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+ <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+ <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt in PATH Release</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+ <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
+ <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/kate/scratchbox/harmattan/mardrone/mardrone</value>
+ <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">2</value>
+ <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
+ </valuemap>
+ <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+ <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
- <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
- <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
- <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Sbox-qt Release</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/mnt/hgfs/scratchbox/harmattan/mardrone/mardrone-build-desktop</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">11</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+ <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">No deployment</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
- <valuemap key="ProjectExplorer.Target.BuildConfiguration.1" type="QVariantMap">
- <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
- <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qmake</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
- <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
+ <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
+ <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
+ <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
+ <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
+ <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
+ <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
+ <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
+ <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
+ <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
+ <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
+ <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
+ <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
+ <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
+ <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
+ <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
+ <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
+ <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
+ <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
+ <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
+ <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
+ <value type="int">0</value>
+ <value type="int">1</value>
+ <value type="int">2</value>
+ <value type="int">3</value>
+ <value type="int">4</value>
+ <value type="int">5</value>
+ <value type="int">6</value>
+ <value type="int">7</value>
+ <value type="int">8</value>
+ <value type="int">9</value>
+ <value type="int">10</value>
+ <value type="int">11</value>
+ <value type="int">12</value>
+ <value type="int">13</value>
+ <value type="int">14</value>
+ </valuelist>
+ <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
+ <value type="int">0</value>
+ <value type="int">1</value>
+ <value type="int">2</value>
+ <value type="int">3</value>
+ <value type="int">4</value>
+ <value type="int">5</value>
+ <value type="int">6</value>
+ <value type="int">7</value>
+ <value type="int">8</value>
+ <value type="int">9</value>
+ <value type="int">10</value>
+ <value type="int">11</value>
+ <value type="int">12</value>
+ <value type="int">13</value>
+ <value type="int">14</value>
+ </valuelist>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">mardrone</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration</value>
+ <value type="int" key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase">2</value>
+ <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
+ <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">mardrone.pro</value>
+ <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
+ <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">false</value>
+ <valuelist type="QVariantList" key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges"/>
+ <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
+ <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
+ <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
+ <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
+ <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
+ </valuemap>
+ <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
+ </valuemap>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.Target.1</variable>
+ <valuemap type="QVariantMap">
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Harmattan</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Harmattan</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Target.HarmattanDeviceTarget</value>
+ <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
+ <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
+ <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
+ <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">Qt4ProjectManager.ToolChain.Maemo:/opt/QtSDK/Madde/targets/harmattan_10.2011.34-1/bin/gcc.arm-linux-generic-elf-32bit./opt/QtSDK/pythongdb/gdb</value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+ <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
+ <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
+ <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+ <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
</valuemap>
- <valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
- <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
- <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
- <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+ <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
+ <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
+ <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
- <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Build</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
+ <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
- <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
- <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
- <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
- <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
- <value type="QString">clean</value>
- </valuelist>
- <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+ <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
+ <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+ <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
- <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Clean</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
+ <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
- <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
- <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
- <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Sbox-qt Debug</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/mnt/hgfs/scratchbox/harmattan/mardrone/mardrone-build-desktop</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">11</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+ <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+ <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+ <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Harmattan Target (Qt SDK) Release</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+ <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
+ <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory"></value>
+ <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">23</value>
+ <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
- <valuemap key="ProjectExplorer.Target.BuildConfiguration.2" type="QVariantMap">
- <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
- <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qmake</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
- <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
+ <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
+ <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">Qt4ProjectManager.ToolChain.Maemo:/opt/QtSDK/Madde/targets/harmattan_10.2011.34-1/bin/gcc.arm-linux-generic-elf-32bit./opt/QtSDK/pythongdb/gdb</value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+ <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
+ <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
+ <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+ <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
</valuemap>
- <valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
- <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
- <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
- <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+ <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
+ <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
+ <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
- <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Build</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
+ <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
- <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
- <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
- <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
- <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
- <value type="QString">clean</value>
- </valuelist>
- <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+ <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
+ <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+ <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
- <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Clean</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
+ <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
- <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
- <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
- <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">host 4.7.0 Release</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/mnt/hgfs/scratchbox/harmattan/mardrone/mardrone-build-desktop</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">15</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+ <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+ <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+ <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Harmattan Target (Qt SDK) Debug</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+ <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
+ <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory"></value>
+ <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">23</value>
+ <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
- <valuemap key="ProjectExplorer.Target.BuildConfiguration.3" type="QVariantMap">
- <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
- <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qmake</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
- <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
- </valuemap>
- <valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
- <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
- <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
- <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Create Debian Package</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">MaemoDebianPackageCreationStep</value>
</valuemap>
- <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Build</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
- </valuemap>
- <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
- <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
- <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
- <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
- <value type="QString">clean</value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy Debian package via SFTP upload</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">MaemoUploadAndInstallDpkgPackageStep</value>
+ <valuelist type="QVariantList" key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployedFiles">
+ <value type="QString">/mnt/hgfs/scratchbox/harmattan/mardrone/mardrone-build-harmattan-Harmattan_Target__Qt_SDK__Release/mardrone_0.2.0_armel.deb</value>
+ <value type="QString">/mnt/hgfs/scratchbox/harmattan/mardrone/mardrone-build-harmattan-Harmattan_Target__Qt_SDK__Debug/mardrone_0.2.0_armel.deb</value>
+ </valuelist>
+ <valuelist type="QVariantList" key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployedHosts">
+ <value type="QString">192.168.2.15</value>
+ <value type="QString">192.168.2.15</value>
+ </valuelist>
+ <valuelist type="QVariantList" key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployedRemotePaths">
+ <value type="QString"></value>
+ <value type="QString"></value>
+ </valuelist>
+ <valuelist type="QVariantList" key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployedTimes">
+ <value type="QDateTime">2011-12-20T13:12:09</value>
+ <value type="QDateTime">2011-12-21T19:30:29</value>
</valuelist>
- <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
- <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Clean</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
+ <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
- <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
- <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
- <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">host 4.7.0 Debug</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/mnt/hgfs/scratchbox/harmattan/mardrone/mardrone-build-desktop</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">15</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+ <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build Debian Package and Install to Harmattan Device</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">DeployToHarmattan</value>
+ <value type="qulonglong" key="Qt4ProjectManager.MaemoRunConfiguration.DeviceId">1</value>
</valuemap>
- <value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">4</value>
- <valuemap key="ProjectExplorer.Target.DeployConfiguration.0" type="QVariantMap">
- <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
- <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">0</value>
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Deploy</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Deploy</value>
- </valuemap>
- <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">1</value>
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">No deployment</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.DefaultDeployConfiguration</value>
- </valuemap>
- <value key="ProjectExplorer.Target.DeployConfigurationCount" type="int">1</value>
- <valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">mardrone</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
- <value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
- <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
- <value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">mardrone.pro</value>
- <value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
- <value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
- <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
- <value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
- <value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
- <value key="RunConfiguration.QmlDebugServerPort" type="uint">3768</value>
- <value key="RunConfiguration.UseCppDebugger" type="bool">true</value>
- <value key="RunConfiguration.UseQmlDebugger" type="bool">false</value>
+ <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
+ <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
+ <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
+ <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
+ <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
+ <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
+ <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
+ <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
+ <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
+ <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
+ <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
+ <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
+ <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
+ <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
+ <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
+ <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
+ <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
+ <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
+ <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
+ <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
+ <value type="int">0</value>
+ <value type="int">1</value>
+ <value type="int">2</value>
+ <value type="int">3</value>
+ <value type="int">4</value>
+ <value type="int">5</value>
+ <value type="int">6</value>
+ <value type="int">7</value>
+ <value type="int">8</value>
+ <value type="int">9</value>
+ <value type="int">10</value>
+ <value type="int">11</value>
+ <value type="int">12</value>
+ <value type="int">13</value>
+ <value type="int">14</value>
+ </valuelist>
+ <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
+ <value type="int">0</value>
+ <value type="int">1</value>
+ <value type="int">2</value>
+ <value type="int">3</value>
+ <value type="int">4</value>
+ <value type="int">5</value>
+ <value type="int">6</value>
+ <value type="int">7</value>
+ <value type="int">8</value>
+ <value type="int">9</value>
+ <value type="int">10</value>
+ <value type="int">11</value>
+ <value type="int">12</value>
+ <value type="int">13</value>
+ <value type="int">14</value>
+ </valuelist>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">mardrone (remote)</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MaemoRunConfiguration</value>
+ <value type="QString" key="Qt4ProjectManager.MaemoRunConfiguration.Arguments"></value>
+ <value type="int" key="Qt4ProjectManager.MaemoRunConfiguration.BaseEnvironmentBase">1</value>
+ <valuelist type="QVariantList" key="Qt4ProjectManager.MaemoRunConfiguration.ExportedLocalDirs"/>
+ <value type="QString" key="Qt4ProjectManager.MaemoRunConfiguration.ProFile">mardrone.pro</value>
+ <valuelist type="QVariantList" key="Qt4ProjectManager.MaemoRunConfiguration.RemoteMountPoints"/>
+ <valuelist type="QVariantList" key="Qt4ProjectManager.MaemoRunConfiguration.UserEnvironmentChanges"/>
+ <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
+ <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
+ <value type="bool" key="RunConfiguration.UseQmlDebugger">true</value>
+ <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
</valuemap>
- <value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
+ <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
- <value type="int">1</value>
+ <value type="int">2</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
- <value type="int">8</value>
+ <value type="int">10</value>
</data>
</qtcreator>
+++ /dev/null
-/*==================================================================
- !
- ! mardrone application AR-Drone for MeeGo
-
- ! Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
- ! All rights reserved.
- !
- ! Author:Kate Alhola kate.alhola@nokia.com
- !
- ! GNU Lesser General Public License Usage
- ! This file may be used under the terms of the GNU Lesser
- ! General Public License version 2.1 as published by the Free Software
- ! Foundation and appearing in the file LICENSE.LGPL included in the
- ! packaging of this file. Please review the following information to
- ! ensure the GNU Lesser General Public License version 2.1 requirements
- ! will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
- !
- !
- !
- *===================================================================*/
-#include <QDebug>
-#include "navdata.h"
-
-
-NavData::NavData(QObject *parent) :
- QObject(parent)
-{
- vx=0;vy=0;vz=0;pwm_motor1=0;pwm_motor2=0;pwm_motor3=0;pwm_motor4=0;
- vbat=0.0;pitch=0.0;roll=0.0;yaw=0.0;altitude=0.0;
-}
-
-void NavData::parseRawNavData(char *buf,unsigned int len)
-{
- int opt=0;
- navdata_option_t *op;
- _navdata_t *nd=(_navdata_t *)buf;
- state=nd->ardrone_state;
- if(state!=oldState) {
- oldState=state;
- decodedState=decodeState(state,0);
- emit stateUpdated();
- };
-#if 0
- qDebug("parseRawNavData hdr=%8x state=%08x seq=%06d opt[0].tag=%d size=%d",
- nd->header,nd->ardrone_state,nd->sequence,nd->options[0].tag,nd->options[0].size);
-#endif
- qDebug() << decodedState;
- op=&(nd->options[0]);
- while((((unsigned int)op-(unsigned int)buf)<len) && (op->size>0))
- {
- parseOption(op);
- op=(navdata_option_t *)((unsigned int)op+op->size);
- }
-};
-
-void NavData::parseOption(navdata_option_t *op)
-{
- // qDebug("parseOption tag=%d size=%d",op->tag,op->size);
- switch(op->tag) {
- case NAVDATA_DEMO_TAG:
- {
- _navdata_demo_t *ndemo=(_navdata_demo_t*)op;
- vbat=ndemo->vbat_flying_percentage;
- pitch=ndemo->theta/1000.0;
- roll=ndemo->phi/1000.0;
- yaw=ndemo->psi/1000.0;
- altitude=ndemo->altitude;
- vx=ndemo->vx;
- vy=ndemo->vy;
- vz=ndemo->vz;
- emit navDataUpdated();
- qDebug("pitch=%2.1f roll=%2.1f yaw=%2.1f alt=%2.1f v(%2.1f,%2.1f,%2.1f bat=%2.1f",pitch,roll,yaw,altitude,vx,vy,vz,vbat);
- }
- break;
- case NAVDATA_TIME_TAG:
- {
- _navdata_time_t *ntdime=(_navdata_time_t*)op;
- }
- break;
- case NAVDATA_RAW_MEASURES_TAG:
- {
- _navdata_raw_measures_t *nraw=(_navdata_raw_measures_t*)op;
- }
- break;
- case NAVDATA_PHYS_MEASURES_TAG:
- {
- _navdata_phys_measures_t *nphys=(_navdata_phys_measures_t*)op;
- }
- break;
- case NAVDATA_GYROS_OFFSETS_TAG:
- break;
- case NAVDATA_EULER_ANGLES_TAG:
- break;
- case NAVDATA_REFERENCES_TAG:
- break;
- case NAVDATA_TRIMS_TAG: // 7
- {
- _navdata_trims_t *ntrim=( _navdata_trims_t*)op;
- }
- break;
- case NAVDATA_RC_REFERENCES_TAG: //8
- break;
- case NAVDATA_PWM_TAG:
- {
- _navdata_pwm_t *npwm=( _navdata_pwm_t*)op;
- current_motor1=npwm->current_motor1;
- pwm_motor1=npwm->motor1;
- current_motor2=npwm->current_motor2;
- pwm_motor2=npwm->motor2;
- current_motor3=npwm->current_motor3;
- pwm_motor3=npwm->motor3;
- current_motor4=npwm->current_motor4;
- pwm_motor4=npwm->motor4;
- emit navDataUpdated();
- // qDebug("pwm1=%3d I1=%4f pwm2=%3d I2=%4f pwm3=%3d I3=%4f pwm4=%3d I4=%4f",
- // pwm_motor1,current_motor1,pwm_motor2,current_motor2,pwm_motor3,current_motor3,pwm_motor4,current_motor4);
- }
- break;
- case NAVDATA_ALTITUDE_TAG: //10
- break;
- case NAVDATA_VISION_RAW_TAG:
- break;
- case NAVDATA_VISION_OF_TAG: //12
- break;
- case NAVDATA_VISION_TAG:
- break;
- case NAVDATA_VISION_PERF_TAG:
- break;
- case NAVDATA_TRACKERS_SEND_TAG:
- break;
- case NAVDATA_VISION_DETECT_TAG: //16
- {
- _navdata_vision_detect_t *nvisd=(_navdata_vision_detect_t*)op;
- qDebug("nb_detected=%d type=%d xc=%d yc=%d width=%d height=%d dist=%d",nvisd->nb_detected,nvisd->type[0],nvisd->xc[0],nvisd->yc[0],
- nvisd->width[0],nvisd->height[0],nvisd->dist[0]);
- for(int i=0;i++;i<4) {
- tags[i].type=nvisd->type[i];
- tags[i].xc=nvisd->xc[i];
- tags[i].yc=nvisd->yc[i];
- tags[i].height=nvisd->height[i];
- tags[i].width=nvisd->width[i];
- tags[i].dist=nvisd->dist[i];
- }
- }
- break;
- case NAVDATA_WATCHDOG_TAG:
- break;
- case NAVDATA_ADC_DATA_FRAME_TAG:
- break;
- case NAVDATA_CKS_TAG: //65535
- break;
- }
-};
-
-QString NavData::decodeState(unsigned int state,int level)
-{
- QString s="%1 ";
- s=s.arg(state,8,16);
- s+=(state & ARDRONE_FLY_MASK)==0 ? "landed ":"flying ";
- if(level>1) s+=(state & ARDRONE_VIDEO_MASK)==0 ?"video disable ":"video ena ";
- if(level>1)s+=(state & ARDRONE_VISION_MASK)==0 ? "vision disable ":"vision ena ";
- if(level>1)s+=(state & ARDRONE_CONTROL_MASK)==0 ? "euler angles ":"angular speed ";
- if(level>1)s+=(state & ARDRONE_ALTITUDE_MASK)==0 ? "alt ctrl inact ":"alt ctrl act ";
- //s+=(state & ARDRONE_USER_FEEDBACK_START)==0 ? /*!< USER feedback : Start button state */
- s+=(state & ARDRONE_COMMAND_MASK)==0 ? "CMD NAK ":"CMD ACK ";
- // s+=(state & ARDRONE_FW_FILE_MASK)==0 ? /* Firmware file is good;
- // s+=(state & ARDRONE_FW_VER_MASK )==0 ? /* Firmware update is newer;
- // ARDRONE_FW_UPD_MASK = 1 << 9, /* Firmware update is ongoing (1;
- s+=(state & ARDRONE_NAVDATA_DEMO_MASK )==0 ? "All navdata ":"navdata demo ";
- s+=(state & ARDRONE_NAVDATA_BOOTSTRAP)==0 ? "":"Navdata bootstrap ";
- // s+=(state & ARDRONE_MOTORS_MASK)==0 ? /*!< Motors status : (0) Ok, (1) Motors problem */
- s+=(state & ARDRONE_COM_LOST_MASK)? "Com Lost ":"Com ok ";
- if(level>1)s+=(state & ARDRONE_VBAT_LOW) ? "VBat low ":"Vbat Ok ";
- if(level>1)s+=(state & ARDRONE_USER_EL) ? "User EL ":"";
- s+=(state & ARDRONE_TIMER_ELAPSED) ? "Timer elapsed ":"";
- s+=(state & ARDRONE_ANGLES_OUT_OF_RANGE) ? "Angles out of range ":"";
- s+=(state & ARDRONE_ULTRASOUND_MASK) ? "Ultrasonic sensor deaf ":"";
- s+=(state & ARDRONE_CUTOUT_MASK) ? "Cutout system detection detected":"";
-// s+=(state & ARDRONE_PIC_VERSION_MASK)==0 ? /*!< PIC Version number OK : (0) a bad version number, (1) version number is OK */
-// s+=(state & ARDRONE_ATCODEC_THREAD_ON)==0 ? /*!< ATCodec thread ON : (0) thread OFF (1) thread ON */
- if(level>2)s+=(state & ARDRONE_NAVDATA_THREAD_ON)==0 ? "Navdata thread OFF ":"Navdata thread ON ";
- if(level>2)s+=(state & ARDRONE_VIDEO_THREAD_ON )==0 ? "Video thread OFF ":"Video thread ON ";
-// s+=+(state & ARDRONE_ACQ_THREAD_ON)==0 ? "Acquisition thread OFF ":"Acquisition thread ON ";
- s+=(state & ARDRONE_CTRL_WATCHDOG_MASK) ? "CTRL watchdog ":"";
- s+=(state & ARDRONE_ADC_WATCHDOG_MASK) ? "ADC Watchdog ":"";
- s+=(state & ARDRONE_COM_WATCHDOG_MASK) ? "Comm Watchdog ":"";
- s+=(state & ARDRONE_EMERGENCY_MASK)? "Emg landing":"";
- return s;
-}
+++ /dev/null
-#ifndef NAVDATA_H
-#define NAVDATA_H
-
-#include <QObject>
-#undef _GNU_SOURCE // just get rid of error message double definition
-#include <navdata_common.h>
-#include "config.h"
-
-struct tag_t {
- unsigned int type;
- unsigned int xc;
- unsigned int yc;
- unsigned int width;
- unsigned int height;
- unsigned int dist;
-};
-
-class NavData : public QObject
-{
- Q_OBJECT
-public:
- explicit NavData(QObject *parent = 0);
- void parseRawNavData(char *buf,unsigned int len);
- void parseOption(navdata_option_t *op);
- QString decodeState(unsigned int state,int level);
-
- unsigned int state,oldState;
- QString decodedState;
- float vbat;
- float pitch;
- float roll;
- float yaw;
- float altitude;
- float vx;
- float vy;
- float vf;
- float vz;
- float current_motor1;
- float current_motor2;
- float current_motor3;
- float current_motor4;
- int pwm_motor1;
- int pwm_motor2;
- int pwm_motor3;
- int pwm_motor4;
- tag_t tags[4];
-signals:
- void navDataUpdated();
- void stateUpdated();
-public slots:
-
-};
-
-#endif // NAVDATA_H
Package: mardrone
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: <insert up to 60 chars description>
+Description: ArDrone for MeeGo>
<insert long description, indented with spaces>
XSBC-Maemo-Display-Name: mardrone
+XB-Maemo-Icon-26: iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAAJcAAACXAETPAk3AAAJjElEQVRoge1aWUyTSxQ+LSWUfQuK0LBIBYnI1mIiIERxSdQgAX2RgEEWESOBGMUHeHB5IZLwoDwYEhsQEQUFRdCwBMEFCFAICIKkEEB2ylIKtECZ+3Byfwu0vV18uBi/F8rMme+c+f85/5xzZgD+4i90Au0/JZhMpre3t5+fHwBwudzFxcWWlhYAaG1t/f79+8bGho4WsFgsPz8/LpcLAC4uLl1dXa2trcgvFAq15+VyuY2NjY2NjWtra0QJxGJxcXFxcXGxra2tRuT6+vp3796dmJiYmJhQRk4IGRgYiImJiYmJ0Ywa2RXavbKysr6+vr1dKBRevHhRHX4vLy8vL6+Ojg5lT0Rhe3l5ubJnRNdgcv9LbPKBffv2vXz5EgC8vb0BANf306dP6+vr29raAKCnp8fAwAB7ORzOuXPnjh07Rg1//fo1AERFRS0vLytUduvWrfv37wOAvr4+AAwMDAAAj8dra2tD/qmpKScnJw6HAwBcLvfKlSuWlpY4VigUxsbGAsCbN28UT4XBYLS1tVFvrb+/PzAwMDAwUPUDiIuLi4uLE4lE1MCHDx8qlDx79iwls7GxkZOTY2xsbGxsrILczs6uoqKioqICRy0tLS0tLbHZbMXS6enplIKioiIjIyPVpsvD0dGxq6uLMu7o0aPyvZaWlpaWlmNjY4SQ5eXl5eXlkJAQ9ckBICkpibKtoaGBRvu1cHa8DwAAeHh4eHh4SKVSQohAIBAIBKrfrEJ4enqurq6urq4SQgYHBy0sLCwsLHJzc4OCggoKCgoKCvD5JScnJycna2Ekj8ejXsL169c39VVXV1dXV+PbDwoKCgoK0kIBAKSnp1PrsK+vr6+vjxCCzwVRW1tLo9HkF4D6MDc3Hx4eHh4eRmcwNTU1NTUFAKDT6WKxGD/AJSUl2pmOYDAYDAZDxd7k4eGhC39CQkJCQgJSUQ96x/sA3dXVlfqcNTU16cK1vr6+vr6OX/TtkEql3d3duvA3Nzc3Nzfjb19fX19fXwBg4B+EMt0aYXp6WmH7ysoKIUQXZpy/RCJhMpmU2XQfHx9KoqOjQxcFCDMzM4Xt5ubmJiYmujDjG+7s7AQAHx8ftHzn+8Ds7Cz1j4WFhe6Me/bsUdhOo9GUdWkEa2trAJidnUXL6Xw+n+qTX05ag8ViKevSNG3YAgxJXFxcAIDP56Plv38CVlZWyrocHR11YeZyuZi4gfwEdGH8P4A+PT09MjIyMjICAKGhobibasfl6Ojo6OhoaGioTODkyZNamgkAAGFhYWFhYfibSiEAALKysrKysnCLzsjIyMjI0IKdRqPV1tbW1tYqiyMwlra1tdXOE/z9/WUymUwmI4R0dnbS6XQ6/d/lY2hoaGho+OPHD4y9pFKpp6enpgoSExNVmE6htLS0tLRUU3Imk9nb24sMa2tr8r66433gFwICAvAFEUJGR0fPnDmjzig9PT09Pb2bN29KJBJ13gDi2bNnKj5W8mCz2Ww2+9OnT9TYO3fuKJWmPAHB4/F4PJ6K3W3//v1YO1LTbvlSzfj4uLxTbgedTk9JScE8GIe0t7e3t7djQYDCptyCRqNdu3YNADIzM6mcWCKR9PT0jI6OAsDq6iqNRsMuJycnV1dXypNGRkawonHjxg1lNo2NjfX39wNAcHCwfKNAIBCJRACwtLQEALt37waAgwcPyr+lJ0+epKamAgBK/pqnMmU7G2w2u6WlRf01nZeXZ25uHhUVFRUVpUJMIBBgSpmamorZ839icnJycnJShUMq3rMOHTqEIYea8PPzc3V1nZiYUC02MTGBRbGYmJgtS1kZcFvERaUQm3zA2tr68ePHABAREUE1Njc319fXd3V1AQBm6Fgt8/HxOXXq1N69e1FMJpPxeDwAiIuLU6ast7cXy1K42Q8NDQHAhw8fWltbf/78CQCWlpZMJtPNzQ0Ajhw54u/vT42trKy8fPkyAExOTspz/lk+8P79e2rxiUSi2NhYLEcqA5PJzM7Ozs7O3tjYUN9hCCEbGxuPHj0yMjJSXf+Ljo6em5ubm5vDUXV1dXV1dUqrMjExMZSCpqYmjULf4OBg1ZV+CjMzMzMzM8ePH1eTmcVisVgs+Y1sa1ULAOzt7e3t7efn5wkhOGN7e3v1rUecPn1anQmEh4eHh4drSr5r167p6Wlk2FLf/SN84MWLFy9evMD5RUZGRkZGaseTm5ubm5ur4vF//PhRayMjIiIonnfv3m3qEwqFQqGQEFJdXa21AgDAeqWKHerEiRO68JeXl5eXlxNCxGIxlQ/QnZycrKysMOqora3VRcHi4uLi4qKywhYACAQCXfgxYQIAY2Njd3d3d3d3+AN8YFNpsb29XXfGgYEBOzu77e0ymWxsbEwXZnnz8Ny6u7ubjidq2yW0xtu3bxW2d3Z2SiQSXZg7Ojqo4ieHw0HLGTKZjJLQ09PTRQECo5rtkC9AaQd58yizd74PyJfUfXx8xsfHdWRUVt7T/VYFhuIIvE8BAIwtpcXKykod1eAEFhcXAcDU1HR9fR2DZ/zq6c6MoCYAADA1NTU1NUUIaWho0EUB7icYU5WUlJSUlCQnJ5eWluIuJhaLbWxsdOGvqqqqqqoihIhEIuqwcMf7AABAXl5eXl4ePic8CdSOp7CwsLCwEHni4+Pj4+MBQD5LxssU2iE6OpriefXq1aY+GxsbGxsbXEUYDjg7O2uq4MKFC5SChoYGKlah0Wg1NTU1NTXYhYm/puQsFgtXJiFkfn5e8RGEfLjX2dl54MAB9RWEhobOzs5Sa51KlBEODg4ODg4LCwuEkIWFhYWFhfPnz6vJ7Obm5ubmxufzKdsuXbokL/BH+ACFoqIiaqISiSQtLS0tLU3F9mxhYZGfn5+fny8fM1+9elWhsHzKSgh5/vy5tbU1HngpBJ1OT01NxdstOKSsrKysrGyL2KYE2djYODMzEwCSkpKo3HlwcPDr16/URTwTExMMpPz8/AICAqjq3/Ly8u3btwFA2X0hAEhMTHzw4AEA4Hnr3NwcAHz58qW1tRUvEi4sLHA4HOQ/fPiwfG2Kx+OlpKTAttKiYoSEhAwNDSnLS7bj8+fPSu8hbYazs7Ozs3NdXZ2azKOjo6pL5TveB5TefDEzM8OzpuDgYE9PTwMDgy0C8/PzfD4fF2VOTo5GoQ6NRktMTMT6n6+vL3UxDiGVSgHg27dvDQ0N9+7dg38Xm2YTkAeDwcCvqq+vr1gsxvgPr+z9Fjg7O2NeZW5uzufz8U7E2tra7+L/i79QgX8ArOLcBfDePNQAAAAASUVORK5CYII=
+<aegis>
+ <request>
+ <credential name="CAP::net_broadcast" />
+ <for path="/usr/local/bin/mardrone" />
+ </request>
+</aegis>
+++ /dev/null
-/*==================================================================
- !
- ! mardrone application AR-Drone for MeeGo
-
- ! Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
- ! All rights reserved.
- !
- ! Author:Kate Alhola kate.alhola@nokia.com
- !
- ! GNU Lesser General Public License Usage
- ! This file may be used under the terms of the GNU Lesser
- ! General Public License version 2.1 as published by the Free Software
- ! Foundation and appearing in the file LICENSE.LGPL included in the
- ! packaging of this file. Please review the following information to
- ! ensure the GNU Lesser General Public License version 2.1 requirements
- ! will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
- !
- !
- !
- *===================================================================*/
-#include "video.h"
-#include <QGraphicsView>
-
-DroneVideo::DroneVideo()
-{
- droneHost.setAddress("192.168.1.1");
- initialized=false;
-}
-
-VideoThread::VideoThread(DroneVideo *parentp,QHostAddress host,QImage *_image)
-{
- image=_image;
- qDebug() << "videoThread::videoThread";
- stopped=false;
- parent=parentp;
- videoSock=new QUdpSocket();
- videoSock->bind(QHostAddress::Any,5555);
- droneHost=host;
- start();
-
-};
-
-void DroneVideo::paint(QPainter *painter,const QStyleOptionGraphicsItem *option,
- QWidget *widget)
- {
- if(!initialized) { // We need initialize QImage here because we don't know display depth before
- int depth=0;
-
- depth=painter->device()->depth();
- qDebug() << "depth=" << depth;
-
- if(depth==24) {
- image=new QImage(320,240, QImage::Format_RGB32);
- image->fill(0x555555);
- }
- else {
- image=new QImage(320,240, QImage::Format_RGB16);
- image->fill(0x5555);
- }
- QPainter p(image);
- p.drawLine(0,0,image->width(),image->height());
- p.drawLine(image->width(),0,0,image->height());
- update(boundingRect());
- videoThread=new VideoThread(this,droneHost,image);
- initialized=true;
- } else
- painter->drawImage(boundingRect(),*image,image->rect());
- };
-
-QRectF DroneVideo::boundingRect() const
-{
- return QRectF(0.0,0.0,size().width(),size().height());
-}
-
-
-void VideoThread::run()
-{
-#define ACQ_WIDTH 320
-#define ACQ_HEIGHT 240
-#undef memset
- memset(&controller,0,sizeof(controller));
- memset(&picture,0,sizeof(picture));
- pictureWidth= image->width();
- pictureHeight=image->height();
- int codec_type=UVLC_CODEC;
- qDebug() << "videoThread::run()";
- stateTimer=new QTimer();
- connect(stateTimer,SIGNAL(timeout()),this,SLOT(timer()));
- connect(videoSock,SIGNAL(readyRead()),this,SLOT(videoDataReady()));
- qDebug() << "videoThread::run() 2";
- luma_only=FALSE;
- num_picture_decoded=0;
- /// Picture configuration
- picture.format = PIX_FMT_YUV420P;
- picture.width = pictureWidth;
- picture.height = pictureHeight;
- picture.framerate = 30;
- picture.y_buf = (uint8_t*)(void*)vp_os_malloc((size_t) pictureWidth*pictureHeight );
- picture.cr_buf = (uint8_t*)vp_os_malloc( pictureWidth*pictureHeight/4 );
- picture.cb_buf = (uint8_t*)vp_os_malloc( pictureWidth*pictureHeight/4 );
- picture.y_line_size = pictureWidth;
- picture.cb_line_size = pictureWidth / 2;
- picture.cr_line_size = pictureWidth / 2;
- picture.y_pad = 0;
- picture.c_pad = 0;
- video_codec_open(&controller, (codec_type_t)UVLC_CODEC);
- //stateTimer->start(1000);
- qDebug() << "videoThread::run() initialized";
- sendVideoPort("AT");
- while(!stopped) {
- exec();
- }
-
-}
-
-void VideoThread::timer()
-{
- // qDebug() << "thread Timer";
-
-}
-
-void VideoThread::sendVideoPort(QString cmd)
-{
- QByteArray dgram;
- dgram=cmd.toLatin1();
- qDebug() << "videoThread::sendCmd= " << cmd+"\n" << "to " << droneHost ;
- videoSock->writeDatagram(dgram.data(),dgram.size(),droneHost,5555);
-}
-
-void VideoThread::videoDataReady()
-{
- qint64 l;
- QByteArray videoData;
-
- QHostAddress host;
- quint16 port;
- videoData.resize(videoSock->pendingDatagramSize ());
- l=videoSock->readDatagram(videoData.data(),videoData.size(),&host,&port);
-// qDebug() << "videoThread::videoDataReady" <<" l=" << l << "from" << host ;
- decodeTransform(videoData);
-}
-
-void VideoThread::decodeTransform(QByteArray &videoData)
-{
- controller.in_stream.bytes = (uint32_t*)videoData.data();
- controller.in_stream.used = videoData.size();
- controller.in_stream.size = videoData.size();
- controller.in_stream.index = 0;
- controller.in_stream.length = 32;
- controller.in_stream.code = 0;
-
- bool_t got_image = FALSE;
- //qDebug() <<"VideoThread::decodeTransform";
- video_decode_blockline( &controller, &picture, &got_image );
- //qDebug() <<"VideoThread::decodeTransform 2";
- //video_decode_picture( &controller, &picture, &stream, &got_image );
- if( got_image )
- {
- // qDebug() <<"VideoThread::decodeTransform got image" << picture.width << picture.height << image->byteCount() << image->bytesPerLine();
- // we got one picture
- // out->size = 1;
- picture.complete = 1;
- num_picture_decoded++;
- vp_stages_YUV420P_to_RGB565(NULL,&picture,image->bits(),image->bytesPerLine());
-
-
- // qDebug() << "pic " << num_picture_decoded;
- }
-
-
-};
-
-
+++ /dev/null
-#ifndef VIDEO_H
-#define VIDEO_H
-
-#include <QGraphicsWidget>
-#include <QGraphicsItem>
-#include <QPainter>
-#include <QUdpSocket>
-#include <QTcpSocket>
-#include <QThread>
-#include <QTimer>
-#include "dronecontrol.h"
-#undef _GNU_SOURCE // just get rid of error message double definition
-#define TARGET_CPU_ARM 1
-#include <navdata.h>
-#include <VP_Os/vp_os_malloc.h>
-#include <VP_Os/vp_os_print.h>
-extern "C"
-{
-#include <VLIB/Stages/vlib_stage_decode.h>
-void vp_stages_YUV420P_to_RGB565(void *cfg, vp_api_picture_t *picture, uint8_t *dst, uint32_t dst_rbytes);
-
-}
-
-
-class VideoThread;
-
-class DroneVideo:public QGraphicsWidget
-{
- Q_OBJECT
-public:
- DroneVideo();
- void paint(QPainter *painter,const QStyleOptionGraphicsItem *option,
- QWidget *widget);
- QRectF boundingRect() const;
-
-private:
- QHostAddress droneHost; // Ip address of the drone
- VideoThread *videoThread;
- QImage *image;
- bool initialized;
-};
-
-class VideoThread:public QThread {
- Q_OBJECT
-public:
- VideoThread(DroneVideo *parentp,QHostAddress host,QImage *_image);
-
- // ~DroneThread ();
- void run();
- void sendVideoPort(QString cmd);
- void decodeTransform(QByteArray &videoData);
-
-public slots:
- void videoDataReady();
- void timer();
-
-
-
-private:
- QImage *image;
- video_controller_t controller;
- vp_api_picture_t picture;
- int pictureWidth;
- int pictureHeight;
- bool luma_only;
- unsigned int num_picture_decoded;
- QHostAddress droneHost; // Ip address of the drone
- QTimer *stateTimer;
- volatile bool stopped;
- DroneVideo *parent;
- QUdpSocket *videoSock; // Navigation data receive socket port 5554
-
-};
-
-#endif // VIDEO_H
+++ /dev/null
-Format: 1.7
-Date: Wed, 22 Dec 2010 15:06:48 +0200
-Source: mardrone
-Binary: mardrone
-Architecture: source armel
-Version: 0.0.1
-Distribution: unstable
-Urgency: low
-Maintainer: Kate Alhola <kate.alhola@gnokia.com>
-Changed-By: Kate Alhola <kate.alhola@nokia.com>
-Description:
- mardrone - AR-Drone flict controll app
-Changes:
- mardrone (0.0.1) unstable; urgency=low
- .
- * Initial Release.
-Files:
- c19e2d3cccf5dcc764da734d0127d6a7 269 user/hidden optional mardrone_0.0.1.dsc
- 0552a460cc8b4b7d7413e5637e4be22c 1379887 user/hidden optional mardrone_0.0.1.tar.gz
- f097693f6af6d6e2785d3f8d282100a9 107678 user/hidden optional mardrone_0.0.1_armel.deb