git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #14186 from LatitudeEngineering/latitude/topic/qgroundcontrol

qgroundcontrol: init at 2.9.4

commit4908973b08ee679ed650703b2861127f6fcbccae authorzimbatm <zimbatm@zimbatm.com> dateFri 25 Mar 2016, 20:45 (11 years ago) parent058576ef30e40d
4 files changed+241
lib/maintainers.nix+1 pkgs/applications/science/robotics/qgroundcontrol/0001-fix-gcc-cmath-namespace-issues.patch+140 pkgs/applications/science/robotics/qgroundcontrol/default.nix+98 pkgs/top-level/all-packages.nix+2
lib/maintainers.nix+1
@@ -279,6 +279,7 @@
279279 psibi = "Sibi <sibi@psibi.in>";
280280 pSub = "Pascal Wittmann <mail@pascal-wittmann.de>";
281281 puffnfresh = "Brian McKenna <brian@brianmckenna.org>";
282+ pxc = "Patrick Callahan <patrick.callahan@latitudeengineering.com>";
282283 qknight = "Joachim Schiele <js@lastlog.de>";
283284 ragge = "Ragnar Dahlen <r.dahlen@gmail.com>";
284285 raskin = "Michael Raskin <7c6f434c@mail.ru>";
pkgs/applications/science/robotics/qgroundcontrol/0001-fix-gcc-cmath-namespace-issues.patchnew file+140
@@ -0,0 +1,140 @@
1+From fffc383c10c7c194e427d78c83802c3b910fa1c2 Mon Sep 17 00:00:00 2001
2+From: Patrick Callahan <pxcallahan@gmail.com>
3+Date: Thu, 24 Mar 2016 18:17:57 -0700
4+Subject: [PATCH] fix gcc cmath namespace issues
5+
6+---
7+ src/Vehicle/Vehicle.cc | 6 +++---
8+ src/comm/QGCFlightGearLink.cc | 4 ++--
9+ src/comm/QGCJSBSimLink.cc | 4 ++--
10+ src/uas/UAS.cc | 8 ++++----
11+ src/ui/QGCDataPlot2D.cc | 4 ++--
12+ 5 files changed, 13 insertions(+), 13 deletions(-)
13+
14+diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc
15+index a0d3605..205b1de 100644
16+--- a/src/Vehicle/Vehicle.cc
17++++ b/src/Vehicle/Vehicle.cc
18+@@ -638,17 +638,17 @@ void Vehicle::setLongitude(double longitude){
19+
20+ void Vehicle::_updateAttitude(UASInterface*, double roll, double pitch, double yaw, quint64)
21+ {
22+- if (isinf(roll)) {
23++ if (std::isinf(roll)) {
24+ _rollFact.setRawValue(0);
25+ } else {
26+ _rollFact.setRawValue(roll * (180.0 / M_PI));
27+ }
28+- if (isinf(pitch)) {
29++ if (std::isinf(pitch)) {
30+ _pitchFact.setRawValue(0);
31+ } else {
32+ _pitchFact.setRawValue(pitch * (180.0 / M_PI));
33+ }
34+- if (isinf(yaw)) {
35++ if (std::isinf(yaw)) {
36+ _headingFact.setRawValue(0);
37+ } else {
38+ yaw = yaw * (180.0 / M_PI);
39+diff --git a/src/comm/QGCFlightGearLink.cc b/src/comm/QGCFlightGearLink.cc
40+index 2a520fb..886aecf 100644
41+--- a/src/comm/QGCFlightGearLink.cc
42++++ b/src/comm/QGCFlightGearLink.cc
43+@@ -230,7 +230,7 @@ void QGCFlightGearLink::updateControls(quint64 time, float rollAilerons, float p
44+ Q_UNUSED(systemMode);
45+ Q_UNUSED(navMode);
46+
47+- if(!isnan(rollAilerons) && !isnan(pitchElevator) && !isnan(yawRudder) && !isnan(throttle))
48++ if(!std::isnan(rollAilerons) && !std::isnan(pitchElevator) && !std::isnan(yawRudder) && !std::isnan(throttle))
49+ {
50+ QString state("%1\t%2\t%3\t%4\t%5\n");
51+ state = state.arg(rollAilerons).arg(pitchElevator).arg(yawRudder).arg(true).arg(throttle);
52+@@ -240,7 +240,7 @@ void QGCFlightGearLink::updateControls(quint64 time, float rollAilerons, float p
53+ }
54+ else
55+ {
56+- qDebug() << "HIL: Got NaN values from the hardware: isnan output: roll: " << isnan(rollAilerons) << ", pitch: " << isnan(pitchElevator) << ", yaw: " << isnan(yawRudder) << ", throttle: " << isnan(throttle);
57++ qDebug() << "HIL: Got NaN values from the hardware: std::isnan output: roll: " << std::isnan(rollAilerons) << ", pitch: " << std::isnan(pitchElevator) << ", yaw: " << std::isnan(yawRudder) << ", throttle: " << std::isnan(throttle);
58+ }
59+ }
60+
61+diff --git a/src/comm/QGCJSBSimLink.cc b/src/comm/QGCJSBSimLink.cc
62+index 1210621..89db371 100644
63+--- a/src/comm/QGCJSBSimLink.cc
64++++ b/src/comm/QGCJSBSimLink.cc
65+@@ -242,7 +242,7 @@ void QGCJSBSimLink::updateControls(quint64 time, float rollAilerons, float pitch
66+ Q_UNUSED(systemMode);
67+ Q_UNUSED(navMode);
68+
69+- if(!isnan(rollAilerons) && !isnan(pitchElevator) && !isnan(yawRudder) && !isnan(throttle))
70++ if(!std::isnan(rollAilerons) && !std::isnan(pitchElevator) && !std::isnan(yawRudder) && !std::isnan(throttle))
71+ {
72+ QString state("%1\t%2\t%3\t%4\t%5\n");
73+ state = state.arg(rollAilerons).arg(pitchElevator).arg(yawRudder).arg(true).arg(throttle);
74+@@ -250,7 +250,7 @@ void QGCJSBSimLink::updateControls(quint64 time, float rollAilerons, float pitch
75+ }
76+ else
77+ {
78+- qDebug() << "HIL: Got NaN values from the hardware: isnan output: roll: " << isnan(rollAilerons) << ", pitch: " << isnan(pitchElevator) << ", yaw: " << isnan(yawRudder) << ", throttle: " << isnan(throttle);
79++ qDebug() << "HIL: Got NaN values from the hardware: isnan output: roll: " << std::isnan(rollAilerons) << ", pitch: " << std::isnan(pitchElevator) << ", yaw: " << std::isnan(yawRudder) << ", throttle: " << std::isnan(throttle);
80+ }
81+ //qDebug() << "Updated controls" << state;
82+ }
83+diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc
84+index 4d5c1c2..ac88852 100644
85+--- a/src/uas/UAS.cc
86++++ b/src/uas/UAS.cc
87+@@ -558,7 +558,7 @@ void UAS::receiveMessage(mavlink_message_t message)
88+
89+ setAltitudeAMSL(hud.alt);
90+ setGroundSpeed(hud.groundspeed);
91+- if (!isnan(hud.airspeed))
92++ if (!std::isnan(hud.airspeed))
93+ setAirSpeed(hud.airspeed);
94+ speedZ = -hud.climb;
95+ emit altitudeChanged(this, altitudeAMSL, altitudeRelative, -speedZ, time);
96+@@ -654,7 +654,7 @@ void UAS::receiveMessage(mavlink_message_t message)
97+
98+ float vel = pos.vel/100.0f;
99+ // Smaller than threshold and not NaN
100+- if ((vel < 1000000) && !isnan(vel) && !isinf(vel)) {
101++ if ((vel < 1000000) && !std::isnan(vel) && !std::isinf(vel)) {
102+ setGroundSpeed(vel);
103+ emit speedChanged(this, groundSpeed, airSpeed, time);
104+ } else {
105+@@ -1439,8 +1439,8 @@ void UAS::setExternalControlSetpoint(float roll, float pitch, float yaw, float t
106+ if (countSinceLastTransmission++ >= 5) {
107+ sendCommand = true;
108+ countSinceLastTransmission = 0;
109+- } else if ((!isnan(roll) && roll != manualRollAngle) || (!isnan(pitch) && pitch != manualPitchAngle) ||
110+- (!isnan(yaw) && yaw != manualYawAngle) || (!isnan(thrust) && thrust != manualThrust) ||
111++ } else if ((!std::isnan(roll) && roll != manualRollAngle) || (!std::isnan(pitch) && pitch != manualPitchAngle) ||
112++ (!std::isnan(yaw) && yaw != manualYawAngle) || (!std::isnan(thrust) && thrust != manualThrust) ||
113+ buttons != manualButtons) {
114+ sendCommand = true;
115+
116+diff --git a/src/ui/QGCDataPlot2D.cc b/src/ui/QGCDataPlot2D.cc
117+index 2e530b2..9d5a774 100644
118+--- a/src/ui/QGCDataPlot2D.cc
119++++ b/src/ui/QGCDataPlot2D.cc
120+@@ -535,7 +535,7 @@ void QGCDataPlot2D::loadCsvLog(QString file, QString xAxisName, QString yAxisFil
121+ {
122+ bool okx = true;
123+ x = text.toDouble(&okx);
124+- if (okx && !isnan(x) && !isinf(x))
125++ if (okx && !std::isnan(x) && !std::isinf(x))
126+ {
127+ headerfound = true;
128+ }
129+@@ -561,7 +561,7 @@ void QGCDataPlot2D::loadCsvLog(QString file, QString xAxisName, QString yAxisFil
130+ y = text.toDouble(&oky);
131+ // Only INF is really an issue for the plot
132+ // NaN is fine
133+- if (oky && !isnan(y) && !isinf(y) && text.length() > 0 && text != " " && text != "\n" && text != "\r" && text != "\t")
134++ if (oky && !std::isnan(y) && !std::isinf(y) && text.length() > 0 && text != " " && text != "\n" && text != "\r" && text != "\t")
135+ {
136+ // Only append definitely valid values
137+ xValues.value(curveName)->append(x);
138+--
139+2.7.4
140+
pkgs/applications/science/robotics/qgroundcontrol/default.nixnew file+98
@@ -0,0 +1,98 @@
1+{ stdenv, fetchgit, git, espeak, SDL, udev, doxygen, cmake, overrideCC#, gcc48
2+ , qtbase, qtlocation, qtserialport, qtdeclarative, qtconnectivity, qtxmlpatterns
3+ , qtsvg, qtquick1, qtquickcontrols, qtgraphicaleffects
4+ , makeQtWrapper, lndir
5+ , gst_all_1, qt_gstreamer1, pkgconfig, glibc
6+ , version ? "2.9.4"
7+}:
8+
9+stdenv.mkDerivation rec {
10+ name = "qgroundcontrol-${version}";
11+ buildInputs = [
12+ SDL udev doxygen git
13+ ] ++ gstInputs;
14+
15+ qtInputs = [
16+ qtbase qtlocation qtserialport qtdeclarative qtconnectivity qtxmlpatterns qtsvg
17+ qtquick1 qtquickcontrols qtgraphicaleffects
18+ ];
19+
20+ gstInputs = with gst_all_1; [
21+ gstreamer gst-plugins-base
22+ ];
23+
24+ enableParallelBuilding = true;
25+ nativeBuildInputs = [
26+ pkgconfig makeQtWrapper
27+ ] ++ qtInputs;
28+
29+ patches = [ ./0001-fix-gcc-cmath-namespace-issues.patch ];
30+
31+ preConfigure = ''
32+ git submodule init
33+ git submodule update
34+
35+ '';
36+
37+ configurePhase = ''
38+ mkdir build
39+ pushd build
40+
41+ qmake ../qgroundcontrol.pro
42+
43+ popd
44+ '';
45+
46+ preBuild = "pushd build/";
47+ postBuild = "popd";
48+
49+ installPhase = ''
50+ mkdir -p $out/share/applications
51+ cp -v qgroundcontrol.desktop $out/share/applications
52+
53+ mkdir -p $out/bin
54+ cp -v build/release/qgroundcontrol "$out/bin/"
55+
56+ mkdir -p $out/share/qgroundcontrol
57+ cp -rv resources/ $out/share/qgroundcontrol
58+
59+ mkdir -p $out/share/pixmaps
60+ cp -v resources/icons/qgroundcontrol.png $out/share/pixmaps
61+
62+ # we need to link to our Qt deps in our own output if we want
63+ # this package to work without being installed as a system pkg
64+ mkdir -p $out/lib/qt5 $out/etc/xdg
65+ for pkg in $qtInputs; do
66+ if [[ -d $pkg/lib/qt5 ]]; then
67+ for dir in lib/qt5 share etc/xdg; do
68+ if [[ -d $pkg/$dir ]]; then
69+ ${lndir}/bin/lndir "$pkg/$dir" "$out/$dir"
70+ fi
71+ done
72+ fi
73+ done
74+ '';
75+
76+
77+ postInstall = ''
78+ wrapQtProgram "$out/bin/qgroundcontrol" \
79+ --prefix GST_PLUGIN_SYSTEM_PATH : "$GST_PLUGIN_SYSTEM_PATH"
80+ '';
81+
82+
83+ # TODO: package mavlink so we can build from a normal source tarball
84+ src = fetchgit {
85+ url = "https://github.com/mavlink/qgroundcontrol.git";
86+ rev = "refs/tags/v${version}";
87+ sha256 = "0rwn2ddlar58ydzdykvnab1anr4xzvb9x0sxx5rs037i49f6sqga";
88+ fetchSubmodules = true;
89+ };
90+
91+ meta = {
92+ description = "provides full ground station support and configuration for the PX4 and APM Flight Stacks";
93+ homepage = http://qgroundcontrol.org/;
94+ license = stdenv.lib.licenses.gpl3Plus;
95+ platforms = with stdenv.lib.platforms; linux;
96+ maintainers = with stdenv.lib.maintainers; [ pxc ];
97+ };
98+}
pkgs/top-level/all-packages.nix+2
@@ -14351,6 +14351,8 @@ in
1435114351
1435214352 qgis = callPackage ../applications/gis/qgis {};
1435314353
14354+ qgroundcontrol = qt55.callPackage ../applications/science/robotics/qgroundcontrol { };
14355+
1435414356 qtbitcointrader = callPackage ../applications/misc/qtbitcointrader {
1435514357 qt = qt4;
1435614358 };