diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 15544b42b..56ba98fc4 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,40 +1,53 @@
-How to build from source?
-=========================
+# How to build from source?
Both development environment and GCS are supported on Windows, Linux and Mac OS X
+## Install prerequisites
+
The first step is to Install all OS specific prerequisites.
-###Mac OS X
+
+### Mac OS X
+
Install XCode and its relatated command line tools (follow Apple documentation).
Install git, curl and p7zip. You can use brew `brew install git curl p7zip` or macport: `sudo port install git curl p7zip`
-###Ubuntu
-
- sudo apt-get install git build-essential curl gdb wget debhelper p7zip-full unzip flex bison libsdl1.2-dev libudev-dev libusb-1.0-0-dev libc6-i386 mesa-common-dev
-###Windows
-Install [msysGIT](https://msysgit.github.io/) under `C:\git`
+### Ubuntu
-Clone LibrePilot Git repository.
-Open Git Bash and run
+ sudo apt-get install git build-essential curl gdb wget debhelper p7zip-full unzip flex bison libsdl1.2-dev libudev-dev libusb-1.0-0-dev libc6-i386 mesa-common-dev
- cd /path/to/LibrePilot_root
- ./make/scripts/win_sdk_install.sh
-You can build using the `/path/to/LibrePilot_root/make/winx86/bin/make` wrapper to call `mingw32-make.exe` as:
+### Windows
- ./make/winx86/bin/make all_sdk_install
-or call `mingw32-make` directly
+Install [Msys2](https://msys2.github.io/) following the instructions on the web site. You can either install the i686 (32 bit) or x86_64 (64 bit) version.
- mingw32-make all_sdk_install
+Start a "MinGW-w64 Win32 Shell" or "MinGW-w64 Win32 Win64 Shell" (NOT "MSYS2 Shell")
+
+Install the dependent packages (32 bit):
+
+ pacman -S --needed git unzip tar mingw-w64-i686-toolchain mingw-w64-i686-qt5 mingw-w64-i686-SDL mingw-w64-i686-mesa mingw-w64-i686-openssl
+
+Or for a 64 bit build:
+
+ pacman -S --needed git unzip tar mingw-w64-x86_64-toolchain mingw-w64-x86_64-qt5 mingw-w64-x86_64-SDL mingw-w64-x86_64-mesa mingw-w64-x86_64-openssl
+
+*NOTE* On Windows you need to run the mingw version of make, which is 'mingw32-make'
+
+
+## Setup the build environment and build
-##Setup the build environment and build
The `all_sdk_install` target will automatically retrieve and install all needed tools (qt, arm gcc etc.) in a local folder `/path/to/LibrePilot_root/tools`
+### Ubuntu / Mac OS X
- make all_sdk_install
- make package
+ make all_sdk_install
+ make package
-The `package` target will build the complete installable package for the current platform.
+### Windows
+
+ mingw32-make all_sdk_install
+ mingw32-make package
+
+The `package` target will build the complete installable package for the current platform. You can build the 'all' target to just build the software.
Run make with no arguments to show the complete list of supported targets.
diff --git a/Makefile b/Makefile
index 7184cfab2..b74a30375 100644
--- a/Makefile
+++ b/Makefile
@@ -130,14 +130,7 @@ else ifeq ($(V), 0)
else ifeq ($(V), 1)
endif
-# Make sure we know few things about the architecture before including
-# the tools.mk to ensure that we download/install the right tools.
-UNAME := $(shell uname)
-ARCH := $(shell uname -m)
-# Here and everywhere if not Linux or Mac then assume Windows
-ifeq ($(filter Linux Darwin, $(UNAME)), )
- UNAME := Windows
-endif
+ARCH := $(call get_arch)
# Include tools installers
include $(ROOT_DIR)/make/tools.mk
@@ -147,13 +140,10 @@ include $(ROOT_DIR)/make/tools.mk
# We almost need to consider autoconf/automake instead of this
ifeq ($(UNAME), Linux)
- QT_SPEC := linux-g++
UAVOBJGENERATOR := $(BUILD_DIR)/uavobjgenerator/uavobjgenerator
else ifeq ($(UNAME), Darwin)
- QT_SPEC := macx-g++
UAVOBJGENERATOR := $(BUILD_DIR)/uavobjgenerator/uavobjgenerator
else ifeq ($(UNAME), Windows)
- QT_SPEC := win32-g++
UAVOBJGENERATOR := $(BUILD_DIR)/uavobjgenerator/uavobjgenerator.exe
endif
@@ -192,7 +182,7 @@ uavobjgenerator: $(UAVOBJGENERATOR)
$(UAVOBJGENERATOR): | $(UAVOBJGENERATOR_DIR)
$(V1) cd $(UAVOBJGENERATOR_DIR) && \
( [ -f Makefile ] || $(QMAKE) $(ROOT_DIR)/ground/uavobjgenerator/uavobjgenerator.pro \
- -spec $(QT_SPEC) CONFIG+=$(GCS_BUILD_CONF) CONFIG+=$(GCS_SILENT) ) && \
+ CONFIG+=$(GCS_BUILD_CONF) CONFIG+=$(GCS_SILENT) ) && \
$(MAKE) --no-print-directory -w
UAVOBJ_TARGETS := gcs flight python matlab java wireshark
@@ -266,7 +256,7 @@ GCS_MAKEFILE := $(GCS_DIR)/Makefile
gcs_qmake $(GCS_MAKEFILE): | $(GCS_DIR)
$(V1) cd $(GCS_DIR) && \
$(QMAKE) $(ROOT_DIR)/ground/gcs/gcs.pro \
- -spec $(QT_SPEC) -r CONFIG+=$(GCS_BUILD_CONF) CONFIG+=$(GCS_SILENT) \
+ -r CONFIG+=$(GCS_BUILD_CONF) CONFIG+=$(GCS_SILENT) \
'GCS_BIG_NAME="$(GCS_BIG_NAME)"' GCS_SMALL_NAME=$(GCS_SMALL_NAME) \
'ORG_BIG_NAME="$(ORG_BIG_NAME)"' ORG_SMALL_NAME=$(ORG_SMALL_NAME) \
'WIKI_URL_ROOT="$(WIKI_URL_ROOT)"' \
@@ -300,7 +290,7 @@ UPLOADER_MAKEFILE := $(UPLOADER_DIR)/Makefile
uploader_qmake $(UPLOADER_MAKEFILE): | $(UPLOADER_DIR)
$(V1) cd $(UPLOADER_DIR) && \
$(QMAKE) $(ROOT_DIR)/ground/gcs/src/experimental/USB_UPLOAD_TOOL/upload.pro \
- -spec $(QT_SPEC) -r CONFIG+=$(GCS_BUILD_CONF) CONFIG+=$(GCS_SILENT) $(GCS_QMAKE_OPTS)
+ -r CONFIG+=$(GCS_BUILD_CONF) CONFIG+=$(GCS_SILENT) $(GCS_QMAKE_OPTS)
.PHONY: uploader
uploader: $(UPLOADER_MAKEFILE)
@@ -506,7 +496,7 @@ OPFW_FILES := $(foreach fw_targ, $(PACKAGE_FW_TARGETS), $(FIRMWARE_DIR)/$(fw_tar
OPFW_CONTENTS := \
\
\
- $(foreach fw_file, $(OPFW_FILES), $(fw_file)) \
+ $(foreach fw_file, $(OPFW_FILES), $(call system_path,$(fw_file))) \
\
diff --git a/flight/libraries/insgps13state.c b/flight/libraries/insgps13state.c
index cb41469c8..c311f05d3 100644
--- a/flight/libraries/insgps13state.c
+++ b/flight/libraries/insgps13state.c
@@ -280,11 +280,11 @@ void INSSetBaroVar(float baro_var)
void INSSetMagNorth(float B[3])
{
- float mag = sqrtf(B[0] * B[0] + B[1] * B[1] + B[2] * B[2]);
+ float invmag = invsqrtf(B[0] * B[0] + B[1] * B[1] + B[2] * B[2]);
- ekf.Be[0] = B[0] / mag;
- ekf.Be[1] = B[1] / mag;
- ekf.Be[2] = B[2] / mag;
+ ekf.Be[0] = B[0] * invmag;
+ ekf.Be[1] = B[1] * invmag;
+ ekf.Be[2] = B[2] * invmag;
}
void INSStatePrediction(float gyro_data[3], float accel_data[3], float dT)
@@ -305,7 +305,7 @@ void INSStatePrediction(float gyro_data[3], float accel_data[3], float dT)
// EKF prediction step
LinearizeFG(ekf.X, U, ekf.F, ekf.G);
RungeKutta(ekf.X, U, dT);
- invqmag = fast_invsqrtf(ekf.X[6] * ekf.X[6] + ekf.X[7] * ekf.X[7] + ekf.X[8] * ekf.X[8] + ekf.X[9] * ekf.X[9]);
+ invqmag = invsqrtf(ekf.X[6] * ekf.X[6] + ekf.X[7] * ekf.X[7] + ekf.X[8] * ekf.X[8] + ekf.X[9] * ekf.X[9]);
ekf.X[6] *= invqmag;
ekf.X[7] *= invqmag;
ekf.X[8] *= invqmag;
@@ -390,7 +390,7 @@ void INSCorrection(float mag_data[3], float Pos[3], float Vel[3],
if (SensorsUsed & MAG_SENSORS) {
- float invBmag = fast_invsqrtf(mag_data[0] * mag_data[0] + mag_data[1] * mag_data[1] + mag_data[2] * mag_data[2]);
+ float invBmag = invsqrtf(mag_data[0] * mag_data[0] + mag_data[1] * mag_data[1] + mag_data[2] * mag_data[2]);
Z[6] = mag_data[0] * invBmag;
Z[7] = mag_data[1] * invBmag;
Z[8] = mag_data[2] * invBmag;
@@ -404,7 +404,7 @@ void INSCorrection(float mag_data[3], float Pos[3], float Vel[3],
MeasurementEq(ekf.X, ekf.Be, Y);
SerialUpdate(ekf.H, ekf.R, Z, Y, ekf.P, ekf.X, SensorsUsed);
- float invqmag = fast_invsqrtf(ekf.X[6] * ekf.X[6] + ekf.X[7] * ekf.X[7] + ekf.X[8] * ekf.X[8] + ekf.X[9] * ekf.X[9]);
+ float invqmag = invsqrtf(ekf.X[6] * ekf.X[6] + ekf.X[7] * ekf.X[7] + ekf.X[8] * ekf.X[8] + ekf.X[9] * ekf.X[9]);
ekf.X[6] *= invqmag;
ekf.X[7] *= invqmag;
ekf.X[8] *= invqmag;
diff --git a/flight/libraries/math/mathmisc.h b/flight/libraries/math/mathmisc.h
index 68026f682..859375258 100644
--- a/flight/libraries/math/mathmisc.h
+++ b/flight/libraries/math/mathmisc.h
@@ -119,28 +119,12 @@ static inline float y_on_curve(float x, const pointf points[], int num_points)
// Find the y value on the selected line.
return y_on_line(x, &points[end_point - 1], &points[end_point]);
}
-// Fast inverse square root implementation from "quake3-1.32b/code/game/q_math.c"
-// http://en.wikipedia.org/wiki/Fast_inverse_square_root
-static inline float fast_invsqrtf(float number)
+static inline float invsqrtf(float number)
{
- float x2, y;
- const float threehalfs = 1.5F;
-
- union {
- float f;
- uint32_t u;
- } i;
-
- x2 = number * 0.5F;
- y = number;
-
- i.f = y; // evil floating point bit level hacking
- i.u = 0x5f3759df - (i.u >> 1); // what the fxck?
- y = i.f;
- y = y * (threehalfs - (x2 * y * y)); // 1st iteration
-// y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed
+ float y;
+ y = 1.0f / sqrtf(number);
return y;
}
diff --git a/flight/modules/Attitude/attitude.c b/flight/modules/Attitude/attitude.c
index c9d5fd5f8..f2d024d24 100644
--- a/flight/modules/Attitude/attitude.c
+++ b/flight/modules/Attitude/attitude.c
@@ -628,7 +628,7 @@ __attribute__((optimize("O3"))) static void updateAttitude(AccelStateData *accel
CrossProduct((const float *)accels_filtered, (const float *)grot_filtered, accel_err);
// Account for accel magnitude
- float inv_accel_mag = fast_invsqrtf(accels_filtered[0] * accels_filtered[0] + accels_filtered[1] * accels_filtered[1] + accels_filtered[2] * accels_filtered[2]);
+ float inv_accel_mag = invsqrtf(accels_filtered[0] * accels_filtered[0] + accels_filtered[1] * accels_filtered[1] + accels_filtered[2] * accels_filtered[2]);
if (inv_accel_mag > 1e3f) {
return;
}
@@ -637,7 +637,7 @@ __attribute__((optimize("O3"))) static void updateAttitude(AccelStateData *accel
float inv_grot_mag;
if (accel_filter_enabled) {
- inv_grot_mag = fast_invsqrtf(grot_filtered[0] * grot_filtered[0] + grot_filtered[1] * grot_filtered[1] + grot_filtered[2] * grot_filtered[2]);
+ inv_grot_mag = invsqrtf(grot_filtered[0] * grot_filtered[0] + grot_filtered[1] * grot_filtered[1] + grot_filtered[2] * grot_filtered[2]);
} else {
inv_grot_mag = 1.0f;
}
@@ -685,8 +685,8 @@ __attribute__((optimize("O3"))) static void updateAttitude(AccelStateData *accel
}
}
- // Renomalize
- float inv_qmag = fast_invsqrtf(q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3]);
+ // Renormalize
+ float inv_qmag = invsqrtf(q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3]);
// If quaternion has become inappropriately short or is nan reinit.
// THIS SHOULD NEVER ACTUALLY HAPPEN
diff --git a/flight/modules/StateEstimation/filtercf.c b/flight/modules/StateEstimation/filtercf.c
index 9d5ad1374..b1c44bd9a 100644
--- a/flight/modules/StateEstimation/filtercf.c
+++ b/flight/modules/StateEstimation/filtercf.c
@@ -438,16 +438,16 @@ static filterResult complementaryFilter(struct data *this, float gyro[3], float
attitude[3] = -attitude[3];
}
- // Renomalize
- float qmag = sqrtf(attitude[0] * attitude[0] + attitude[1] * attitude[1] + attitude[2] * attitude[2] + attitude[3] * attitude[3]);
- attitude[0] = attitude[0] / qmag;
- attitude[1] = attitude[1] / qmag;
- attitude[2] = attitude[2] / qmag;
- attitude[3] = attitude[3] / qmag;
+ // Renormalize
+ float inv_qmag = invsqrtf(attitude[0] * attitude[0] + attitude[1] * attitude[1] + attitude[2] * attitude[2] + attitude[3] * attitude[3]);
+ attitude[0] = attitude[0] * inv_qmag;
+ attitude[1] = attitude[1] * inv_qmag;
+ attitude[2] = attitude[2] * inv_qmag;
+ attitude[3] = attitude[3] * inv_qmag;
// If quaternion has become inappropriately short or is nan reinit.
// THIS SHOULD NEVER ACTUALLY HAPPEN
- if ((fabsf(qmag) < 1.0e-3f) || isnan(qmag)) {
+ if ((fabsf(inv_qmag) > 1e3f) || isnan(inv_qmag)) {
this->first_run = 1;
return FILTERRESULT_WARNING;
}
diff --git a/flight/pios/stm32f10x/pios_ppm.c b/flight/pios/stm32f10x/pios_ppm.c
index 5016d6750..c3b3683e1 100644
--- a/flight/pios/stm32f10x/pios_ppm.c
+++ b/flight/pios/stm32f10x/pios_ppm.c
@@ -341,6 +341,11 @@ static void PIOS_PPM_tim_edge_cb(__attribute__((unused)) uint32_t tim_id,
}
}
#endif /* USE_FREERTOS */
+ } else {
+ for (uint32_t i = 0;
+ i < PIOS_PPM_IN_MAX_NUM_CHANNELS; i++) {
+ ppm_dev->CaptureValue[i] = PIOS_RCVR_TIMEOUT;
+ }
}
ppm_dev->Fresh = TRUE;
diff --git a/flight/pios/stm32f4xx/pios_ppm.c b/flight/pios/stm32f4xx/pios_ppm.c
index 9d1deeecd..809ceae9b 100644
--- a/flight/pios/stm32f4xx/pios_ppm.c
+++ b/flight/pios/stm32f4xx/pios_ppm.c
@@ -330,6 +330,11 @@ static void PIOS_PPM_tim_edge_cb(__attribute__((unused)) uint32_t tim_id, uint32
}
}
#endif /* USE_FREERTOS */
+ } else {
+ for (uint32_t i = 0;
+ i < PIOS_PPM_IN_MAX_NUM_CHANNELS; i++) {
+ ppm_dev->CaptureValue[i] = PIOS_RCVR_TIMEOUT;
+ }
}
ppm_dev->Fresh = true;
diff --git a/ground/gcs/copydata.pro b/ground/gcs/copydata.pro
index 4fb80f27c..b5c2f4329 100644
--- a/ground/gcs/copydata.pro
+++ b/ground/gcs/copydata.pro
@@ -31,7 +31,7 @@ equals(copyqt, 1) {
libicui18n.so.54 \
libicuuc.so.54 \
libicudata.so.54
- *-64 {
+ contains(QT_ARCH, x86_64) {
QT_LIBS += libqgsttools_p.so.1
}
for(lib, QT_LIBS) {
@@ -48,12 +48,11 @@ equals(copyqt, 1) {
platforms/libqxcb.so \
xcbglintegrations/libqxcb-glx-integration.so \
sqldrivers/libqsqlite.so
- *-32 {
- QT_PLUGINS += mediaservice/libqtmedia_audioengine.so
- }
- *-64 {
+ contains(QT_ARCH, x86_64) {
QT_PLUGINS += mediaservice/libgstaudiodecoder.so \
mediaservice/libgstmediaplayer.so
+ } else {
+ QT_PLUGINS += mediaservice/libqtmedia_audioengine.so
}
}
@@ -81,13 +80,26 @@ equals(copyqt, 1) {
Qt5Quick$${DS}.dll \
Qt5QuickWidgets$${DS}.dll \
Qt5Qml$${DS}.dll \
- icuin54.dll \
- icudt54.dll \
- icuuc54.dll
- # it is more robust to take the following DLLs from Qt rather than from MinGW
- QT_DLLS += libgcc_s_dw2-1.dll \
- libstdc++-6.dll \
- libwinpthread-1.dll
+ libicuin56.dll \
+ libicudt56.dll \
+ libicuuc56.dll \
+ libstdc++-6.dll \
+ libwinpthread-1.dll \
+ libpcre16-0.dll \
+ zlib1.dll \
+ libharfbuzz-0.dll \
+ libfreetype-6.dll \
+ libbz2-1.dll \
+ libpng16-16.dll \
+ libglib-2.0-0.dll \
+ libintl-8.dll \
+ libiconv-2.dll
+ contains(QT_ARCH, i386) {
+ QT_DLLS += libgcc_s_dw2-1.dll
+ } else {
+ QT_DLLS += libgcc_s_seh-1.dll
+ }
+
for(dll, QT_DLLS) {
addCopyFileTarget($${dll},$$[QT_INSTALL_BINS],$${GCS_APP_PATH})
}
@@ -97,14 +109,14 @@ equals(copyqt, 1) {
ssleay32.dll \
libeay32.dll
for(dll, OPENSSL_DLLS) {
- addCopyFileTarget($${dll},$${OPENSSL_DIR},$${GCS_APP_PATH})
+ addCopyFileTarget($${dll},$$[QT_INSTALL_BINS],$${GCS_APP_PATH})
}
# copy OpenGL DLL
OPENGL_DLLS = \
- opengl32_32/opengl32.dll
+ opengl32.dll
for(dll, OPENGL_DLLS) {
- addCopyFileTarget($${dll},$${MESAWIN_DIR},$${GCS_APP_PATH})
+ addCopyFileTarget($${dll},$$[QT_INSTALL_BINS],$${GCS_APP_PATH}/opengl32)
}
QT_PLUGINS = iconengines/qsvgicon$${DS}.dll \
diff --git a/ground/gcs/src/libs/osgearth/copydata.pro b/ground/gcs/src/libs/osgearth/copydata.pro
index 5e2a24c6f..831c95a4d 100644
--- a/ground/gcs/src/libs/osgearth/copydata.pro
+++ b/ground/gcs/src/libs/osgearth/copydata.pro
@@ -46,15 +46,15 @@ osg:win32 {
OSG_LIBS = \
libcurl-4.dll \
libfreetype-6.dll \
- libgdal.dll \
- libgeos-3-3-8.dll \
- libgeos_c-1.dll \
- libjpeg-9.dll \
+ libgdal-20.dll \
+ libgeos.dll \
+ libgeos_c.dll \
+ libjpeg-8.dll \
libpng16-16.dll \
- libproj-0.dll \
+ libproj-9.dll \
libtiff-5.dll \
libtiffxx-5.dll \
- zlib1.dll
+ zlib1.dll \
# osg libraries
OSG_LIBS += \
diff --git a/ground/gcs/src/libs/osgearth/osgearth.pro b/ground/gcs/src/libs/osgearth/osgearth.pro
index 5083a7add..6496a6d56 100644
--- a/ground/gcs/src/libs/osgearth/osgearth.pro
+++ b/ground/gcs/src/libs/osgearth/osgearth.pro
@@ -2,7 +2,10 @@ TEMPLATE = lib
TARGET = GCSOsgEarth
DEFINES += OSGEARTH_LIBRARY
-OSG_VERSION = 3.4.0
+#CONFIG += mys2
+
+!msys2:OSG_VERSION = 3.4.0
+msys2:OSG_VERSION = 3.5.1
CONFIG += osg
DEFINES += USE_OSG
diff --git a/ground/gcs/src/libs/sdlgamepad/copydata.pro b/ground/gcs/src/libs/sdlgamepad/copydata.pro
index af9cecbff..ce6d8ff01 100644
--- a/ground/gcs/src/libs/sdlgamepad/copydata.pro
+++ b/ground/gcs/src/libs/sdlgamepad/copydata.pro
@@ -4,7 +4,7 @@ equals(copydata, 1) {
SDL_DLLS = \
SDL.dll
for(dll, SDL_DLLS) {
- addCopyFileTarget($${dll},$${SDL_DIR}/bin,$${GCS_APP_PATH})
+ addCopyFileTarget($${dll},$$[QT_INSTALL_BINS],$${GCS_APP_PATH})
}
}
}
diff --git a/ground/gcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp b/ground/gcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp
index e90f838e9..751f7c36d 100644
--- a/ground/gcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp
+++ b/ground/gcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp
@@ -230,9 +230,9 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
setComboCurrentIndex(m_aircraft->multirotorFrameType,
m_aircraft->multirotorFrameType->findText("Hexacopter Y6"));
- m_aircraft->mrRollMixLevel->setValue(100);
- m_aircraft->mrPitchMixLevel->setValue(50);
- setYawMixLevel(66);
+ m_aircraft->mrRollMixLevel->setValue(86);
+ m_aircraft->mrPitchMixLevel->setValue(100);
+ setYawMixLevel(100);
} else if (frameType == "Octo" || frameType == "Octocopter") {
setComboCurrentIndex(m_aircraft->multirotorFrameType, m_aircraft->multirotorFrameType->findText("Octocopter"));
diff --git a/ground/gcs/src/plugins/config/configstabilizationwidget.cpp b/ground/gcs/src/plugins/config/configstabilizationwidget.cpp
index 519bc842b..5c5f2ecdd 100644
--- a/ground/gcs/src/plugins/config/configstabilizationwidget.cpp
+++ b/ground/gcs/src/plugins/config/configstabilizationwidget.cpp
@@ -245,8 +245,22 @@ void ConfigStabilizationWidget::refreshWidgetsValues(UAVObject *o)
updateThrottleCurveFromObject();
- ui->basicResponsivenessCheckBox->setChecked(ui->rateRollKp_3->value() == ui->ratePitchKp_4->value() &&
- ui->rateRollKi_3->value() == ui->ratePitchKi_4->value());
+ // Check and update basic/advanced checkboxes only if something connected
+ // Jump to advanced tab if something not "basic": Rate value out of slider limits or different Pitch/Roll values
+ if (ui->lowThrottleZeroIntegral_8->isEnabled()) {
+ if ((ui->attitudeRollResponse->value() == ui->attitudePitchResponse->value()) &&
+ (ui->rateRollResponse->value() == ui->ratePitchResponse->value()) &&
+ (ui->rateRollResponse->value() <= ui->RateResponsivenessSlider->maximum()) &&
+ (ui->ratePitchResponse->value() <= ui->RateResponsivenessSlider->maximum())) {
+ ui->basicResponsivenessCheckBox->setChecked(true);
+ ui->advancedResponsivenessCheckBox->setChecked(false);
+ ui->tabWidget->setCurrentIndex(0);
+ } else {
+ ui->basicResponsivenessCheckBox->setChecked(false);
+ ui->advancedResponsivenessCheckBox->setChecked(true);
+ ui->tabWidget->setCurrentIndex(1);
+ }
+ }
}
void ConfigStabilizationWidget::updateObjectsFromWidgets()
@@ -611,9 +625,11 @@ void ConfigStabilizationWidget::processLinkedWidgets(QWidget *widget)
if (ui->basicResponsivenessCheckBox->isChecked()) {
if (widget == ui->AttitudeResponsivenessSlider) {
- ui->ratePitchKp_4->setValue(ui->AttitudeResponsivenessSlider->value());
+ ui->attitudePitchResponse->setValue(ui->AttitudeResponsivenessSlider->value());
+ ui->attitudeRollResponse->setValue(ui->AttitudeResponsivenessSlider->value());
} else if (widget == ui->RateResponsivenessSlider) {
- ui->ratePitchKi_4->setValue(ui->RateResponsivenessSlider->value());
+ ui->ratePitchResponse->setValue(ui->RateResponsivenessSlider->value());
+ ui->rateRollResponse->setValue(ui->RateResponsivenessSlider->value());
}
}
if (ui->checkBoxLinkAcroFactors->isChecked()) {
diff --git a/ground/gcs/src/plugins/config/stabilization.ui b/ground/gcs/src/plugins/config/stabilization.ui
index 811b6735d..0c25b1449 100644
--- a/ground/gcs/src/plugins/config/stabilization.ui
+++ b/ground/gcs/src/plugins/config/stabilization.ui
@@ -6,7 +6,7 @@
0
0
- 974
+ 901
755
@@ -135,9 +135,9 @@
0
- 0
- 950
- 775
+ -104
+ 866
+ 767
@@ -195,29 +195,28 @@ margin-top: -1px;
Acro+
-
- -
-
-
-
- 0
- 0
-
-
-
- Qt::StrongFocus
-
-
- <html><head/><body><p>Link roll & pitch sliders to move together</p></body></html>
-
-
-
-
-
- Link Roll and Pitch
-
-
-
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Qt::StrongFocus
+
+
+ <html><head/><body><p>Link roll & pitch sliders to move together</p></body></html>
+
+
+
+
+
+ Link Roll and Pitch
+
+
+
-
@@ -1002,7 +1001,7 @@ margin-top: -1px;
Use Basic Configuration
- true
+ false
@@ -1036,7 +1035,7 @@ margin-top: -1px;
100
- 800
+ 5000
400
@@ -2296,7 +2295,7 @@ border-radius: 5;
100
- 800
+ 5000
400
@@ -6248,7 +6247,7 @@ Then lower the value by 5 or so.
-
+
0
@@ -7358,556 +7357,6 @@ border-radius: 5;
- -
-
-
-
- 0
- 0
-
-
-
-
- 0
- 20
-
-
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
-
-
- 74
- 74
- 74
-
-
-
-
- 36
- 36
- 36
-
-
-
-
-
-
-
-
- 58
- 58
- 58
-
-
-
-
-
-
- 48
- 48
- 48
-
-
-
-
-
-
- 19
- 19
- 19
-
-
-
-
-
-
- 26
- 26
- 26
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
-
-
- 74
- 74
- 74
-
-
-
-
- 36
- 36
- 36
-
-
-
-
-
-
-
-
-
-
- 74
- 74
- 74
-
-
-
-
- 36
- 36
- 36
-
-
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 19
- 19
- 19
-
-
-
-
-
-
- 255
- 255
- 220
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
-
-
- 74
- 74
- 74
-
-
-
-
- 36
- 36
- 36
-
-
-
-
-
-
-
-
- 58
- 58
- 58
-
-
-
-
-
-
- 48
- 48
- 48
-
-
-
-
-
-
- 19
- 19
- 19
-
-
-
-
-
-
- 26
- 26
- 26
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
-
-
- 74
- 74
- 74
-
-
-
-
- 36
- 36
- 36
-
-
-
-
-
-
-
-
-
-
- 74
- 74
- 74
-
-
-
-
- 36
- 36
- 36
-
-
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 19
- 19
- 19
-
-
-
-
-
-
- 255
- 255
- 220
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
-
-
- 74
- 74
- 74
-
-
-
-
- 36
- 36
- 36
-
-
-
-
-
-
-
-
- 58
- 58
- 58
-
-
-
-
-
-
- 48
- 48
- 48
-
-
-
-
-
-
- 19
- 19
- 19
-
-
-
-
-
-
- 26
- 26
- 26
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
-
-
- 74
- 74
- 74
-
-
-
-
- 36
- 36
- 36
-
-
-
-
-
-
-
-
-
-
- 74
- 74
- 74
-
-
-
-
- 36
- 36
- 36
-
-
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 39
- 39
- 39
-
-
-
-
-
-
- 255
- 255
- 220
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
-
-
- 75
- true
-
-
-
- false
-
-
- background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
-color: rgb(255, 255, 255);
-border-radius: 5;
-
-
- Yaw
-
-
- Qt::AlignCenter
-
-
-
-
@@ -8085,83 +7534,39 @@ border-radius: 5;
- -
-
-
-
- 0
- 0
-
-
-
-
- 0
- 25
-
-
-
- <html><head/><body><p>This adjusts how much leveling stability is set into Attitude mode (outer loop). Too much will make your vehicle oscillate in Attitude Mode.</p></body></html>
-
-
- 100
-
-
- 50
-
+
-
+
Qt::Horizontal
-
- QSlider::TicksBelow
+
+ QSizePolicy::Minimum
-
- 20
+
+
+ 60
+ 20
+
-
-
- objname:StabilizationSettingsBankX
- fieldname:YawPI
- element:Kp
- scale:0.1
- haslimits:yes
- buttongroup:2,10
-
+
+
+ -
+
+
+ Qt::Horizontal
-
+
+ QSizePolicy::Minimum
+
+
+
+ 10
+ 20
+
+
+
-
-
-
-
- 60
- 22
-
-
-
-
- 60
- 22
-
-
-
- 200
-
-
- 200
-
-
-
- objname:StabilizationSettingsBankX
- fieldname:YawPI
- element:Kp
- scale:0.1
- haslimits:yes
- buttongroup:2,10
-
-
-
-
- -
Qt::Horizontal
@@ -8169,7 +7574,7 @@ border-radius: 5;
40
- 1
+ 20
@@ -8368,8 +7773,8 @@ border-radius: 5;
0
0
- 950
- 736
+ 866
+ 697
@@ -9504,7 +8909,7 @@ border-radius: 5;
-
-
+
0
@@ -9584,7 +8989,7 @@ response (deg/s)
-
-
+
0
@@ -9637,7 +9042,7 @@ response (deg/s)
-
-
+
0
@@ -9703,58 +9108,6 @@ response (deg)
- -
-
-
-
- 0
- 0
-
-
-
-
- 0
- 22
-
-
-
-
- 16777215
- 22
-
-
-
- Qt::StrongFocus
-
-
- <html><head/><body><p>This sets the maximum deg your vehicle will tilt at full stick input when in Attitude mode.</p></body></html>
-
-
-
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- 0
-
-
- 180.000000000000000
-
-
- 1.000000000000000
-
-
-
- objname:StabilizationSettingsBankX
- fieldname:YawMax
- haslimits:no
- scale:1
- buttongroup:6,20
-
-
-
-
-
@@ -10306,7 +9659,7 @@ border-radius: 5;
-
-
+
0
@@ -10909,7 +10262,7 @@ border-radius: 5;
-
-
+
0
@@ -10964,7 +10317,7 @@ border-radius: 5;
-
-
+
0
@@ -11017,7 +10370,7 @@ border-radius: 5;
-
-
+
0
@@ -11070,7 +10423,7 @@ border-radius: 5;
-
-
+
0
@@ -16169,7 +15522,7 @@ border-radius: 5;
-
+
0
@@ -16229,56 +15582,6 @@ border-radius: 5;
- -
-
-
-
- 0
- 0
-
-
-
-
- 85
- 22
-
-
-
-
- 16777215
- 22
-
-
-
- Qt::StrongFocus
-
-
- <html><head/><body><p>This adjusts how much leveling stability is set into Attitude mode (outer loop). Too much will make your vehicle oscillate in Attitude Mode.</p></body></html>
-
-
-
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- 3
-
-
- 0.100000000000000
-
-
-
- objname:StabilizationSettingsBankX
- fieldname:YawPI
- element:Kp
- haslimits:no
- scale:1
- buttongroup:5,20
-
-
-
-
-
@@ -16904,606 +16207,6 @@ border-radius: 5;
- -
-
-
-
- 0
- 0
-
-
-
-
- 0
- 20
-
-
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
-
-
- 74
- 74
- 74
-
-
-
-
- 36
- 36
- 36
-
-
-
-
-
-
-
-
- 58
- 58
- 58
-
-
-
-
-
-
- 48
- 48
- 48
-
-
-
-
-
-
- 19
- 19
- 19
-
-
-
-
-
-
- 26
- 26
- 26
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
-
-
- 74
- 74
- 74
-
-
-
-
- 36
- 36
- 36
-
-
-
-
-
-
-
-
-
-
- 74
- 74
- 74
-
-
-
-
- 36
- 36
- 36
-
-
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 19
- 19
- 19
-
-
-
-
-
-
- 255
- 255
- 220
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
-
-
- 74
- 74
- 74
-
-
-
-
- 36
- 36
- 36
-
-
-
-
-
-
-
-
- 58
- 58
- 58
-
-
-
-
-
-
- 48
- 48
- 48
-
-
-
-
-
-
- 19
- 19
- 19
-
-
-
-
-
-
- 26
- 26
- 26
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
-
-
- 74
- 74
- 74
-
-
-
-
- 36
- 36
- 36
-
-
-
-
-
-
-
-
-
-
- 74
- 74
- 74
-
-
-
-
- 36
- 36
- 36
-
-
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 19
- 19
- 19
-
-
-
-
-
-
- 255
- 255
- 220
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
-
-
- 74
- 74
- 74
-
-
-
-
- 36
- 36
- 36
-
-
-
-
-
-
-
-
- 58
- 58
- 58
-
-
-
-
-
-
- 48
- 48
- 48
-
-
-
-
-
-
- 19
- 19
- 19
-
-
-
-
-
-
- 26
- 26
- 26
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
-
-
- 74
- 74
- 74
-
-
-
-
- 36
- 36
- 36
-
-
-
-
-
-
-
-
-
-
- 74
- 74
- 74
-
-
-
-
- 36
- 36
- 36
-
-
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 39
- 39
- 39
-
-
-
-
-
-
- 255
- 255
- 220
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
-
-
- 75
- true
-
-
-
- false
-
-
- background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
-color: rgb(255, 255, 255);
-border-radius: 5;
-
-
- Yaw
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 0
- 22
-
-
-
-
- 16777215
- 22
-
-
-
- Qt::StrongFocus
-
-
- <html><head/><body><p>This adjusts how much stability your vehicle will have when flying tilted (ie forward flight) in Attitude Mode. Adding Ki in Attitude when Ki is present in Rate is not recommended.</p></body></html>
-
-
-
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- 3
-
-
- 0.100000000000000
-
-
-
- objname:StabilizationSettingsBankX
- fieldname:YawPI
- element:Ki
- haslimits:no
- scale:1
- buttongroup:5,20
-
-
-
-
-
@@ -18360,8 +17063,8 @@ border-radius: 5;
0
0
- 950
- 671
+ 879
+ 663
@@ -24206,8 +22909,8 @@ font:bold;
0
0
- 950
- 671
+ 879
+ 663
@@ -27452,22 +26155,19 @@ Useful if you have accidentally changed some settings.
spinBox_13
horizontalSlider_83
spinBox_14
- horizontalSlider_84
- spinBox_15
lowThrottleZeroIntegral_8
realTimeUpdates_8
scrollArea_2
advancedResponsivenessCheckBox
pushButton_3
- rateRollKp_3
- ratePitchKp_4
- rateYawKp_3
- rateRollKi_3
- ratePitchKi_4
- rateYawKi_3
- rateRollILimit_3
- ratePitchILimit_4
- rateYawILimit_3
+ attitudeRollResponse
+ attitudePitchResponse
+ rateRollResponse
+ ratePitchResponse
+ rateYawResponse
+ maxRateRollLimit
+ maxRatePitchLimit
+ maxRateYawLimit
enableThrustPIDScalingCheckBox
ThrustPIDSource
ThrustPIDTarget
@@ -27488,10 +26188,8 @@ Useful if you have accidentally changed some settings.
pushButton_2
AttitudeRollKp
AttitudePitchKp_2
- AttitudeYawKp
AttitudeRollKi
AttitudePitchKi_2
- AttitudeYawKi
enableThrustPIDScalingCheckBox_2
pushButton_13
realTimeUpdates_12
diff --git a/ground/gcs/src/plugins/ophid/inc/ophid_usbmon.h b/ground/gcs/src/plugins/ophid/inc/ophid_usbmon.h
index eda27387f..b55ffeb27 100644
--- a/ground/gcs/src/plugins/ophid/inc/ophid_usbmon.h
+++ b/ground/gcs/src/plugins/ophid/inc/ophid_usbmon.h
@@ -54,26 +54,10 @@
#include
#include
#include
+extern "C"
+{
#include
-
-// from working mingw hidsdi.h
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-HIDAPI VOID WINAPI HidD_GetHidGuid(LPGUID);
-HIDAPI BOOL WINAPI HidD_GetPreparsedData(HANDLE, PHIDP_PREPARSED_DATA *);
-HIDAPI BOOL WINAPI HidD_FreePreparsedData(PHIDP_PREPARSED_DATA);
-HIDAPI BOOL WINAPI HidD_FlushQueue(HANDLE);
-HIDAPI BOOL WINAPI HidD_GetConfiguration(HANDLE, PHIDD_CONFIGURATION, ULONG);
-HIDAPI BOOL WINAPI HidD_SetConfiguration(HANDLE, PHIDD_CONFIGURATION, ULONG);
-HIDAPI BOOL WINAPI HidD_GetPhysicalDescriptor(HANDLE, PVOID, ULONG);
-HIDAPI BOOL WINAPI HidD_GetIndexedString(HANDLE, ULONG, PVOID, ULONG);
-HIDAPI BOOL WINAPI HidD_GetSerialNumberString(HANDLE, PVOID, ULONG);
-
-#ifdef __cplusplus
}
-#endif
#endif // if defined(Q_OS_MAC)
diff --git a/ground/gcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/gcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp
index 91217fbee..381ca6464 100644
--- a/ground/gcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp
+++ b/ground/gcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp
@@ -785,9 +785,9 @@ void VehicleConfigurationHelper::applyMixerConfiguration(mixerChannelSettings ch
mSettings->setMixerValueYaw((qint8)50);
break;
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_COAX_Y:
- mSettings->setMixerValueRoll((qint8)100);
- mSettings->setMixerValuePitch((qint8)50);
- mSettings->setMixerValueYaw((qint8)66);
+ mSettings->setMixerValueRoll((qint8)86);
+ mSettings->setMixerValuePitch((qint8)100);
+ mSettings->setMixerValueYaw((qint8)100);
break;
case VehicleConfigurationSource::MULTI_ROTOR_OCTO:
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_X:
diff --git a/make/3rdparty/osgearth/README.TXT b/make/3rdparty/osgearth/README.TXT
index d70669d37..4ffc3ec01 100644
--- a/make/3rdparty/osgearth/README.TXT
+++ b/make/3rdparty/osgearth/README.TXT
@@ -15,7 +15,7 @@ Linux prerequisites
----------------------------------
$ sudo apt-get install libzip-dev libpng-dev lipjpeg-dev libtiff5-dev libcurl4-openssl-dev
-$ sudo apt-get install libgeos++-dev libgdal-dev
+$ sudo apt-get install libgeos++-dev libgdal-dev
Alternative (not tested recently but could work):
$ sudo apt-get build-dep openscenegraph
@@ -38,8 +38,7 @@ brew install gdal
Windows prerequisites
----------------------------------
-Windows requires many libraries to be build.
-See osg_win.sh for more details.
+pacman -S mingw-w64-i686-cmake mingw-w64-i686-gdal
Building
diff --git a/make/3rdparty/osgearth/gdal_GNUmakefile_fix.patch b/make/3rdparty/osgearth/gdal_GNUmakefile_fix.patch
deleted file mode 100644
index 98f41527f..000000000
--- a/make/3rdparty/osgearth/gdal_GNUmakefile_fix.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-Index: GNUmakefile
-===================================================================
---- GNUmakefile (revision 22722)
-+++ GNUmakefile (copie de travail)
-@@ -1,13 +1,13 @@
-
- include GDALmake.opt
-
--GDAL_OBJ = $(GDAL_ROOT)/frmts/o/*.o \
-- $(GDAL_ROOT)/gcore/*.o \
-- $(GDAL_ROOT)/port/*.o \
-- $(GDAL_ROOT)/alg/*.o
-+GDAL_OBJ = ./frmts/o/*.o \
-+ ./gcore/*.o \
-+ ./port/*.o \
-+ ./alg/*.o
-
- ifeq ($(OGR_ENABLED),yes)
--GDAL_OBJ += $(GDAL_ROOT)/ogr/ogrsf_frmts/o/*.o
-+GDAL_OBJ += ./ogr/ogrsf_frmts/o/*.o
- endif
-
- include ./ogr/file.lst
-@@ -28,13 +28,8 @@
- $(LD_SHARED) $(GDAL_SLIB_SONAME) $(GDAL_OBJ) $(GDAL_LIBS) $(LDFLAGS) $(LIBS) \
- -o $(GDAL_SLIB)
-
--$(GDAL_LIB): $(GDAL_OBJ) GDALmake.opt
-- rm -f libgdal.a
-- $(AR) r $(GDAL_LIB) $(GDAL_OBJ)
-- $(RANLIB) $(GDAL_LIB)
--
--$(GDAL_SLIB): $(GDAL_OBJ) $(GDAL_LIB)
-- $(LD_SHARED) $(GDAL_SLIB_SONAME) $(GDAL_OBJ) $(GDAL_LIBS) $(LDFLAGS) $(LIBS) \
-+$(GDAL_SLIB): $(GDAL_OBJ)
-+ $(LD_SHARED) $(GDAL_SLIB_SONAME) $(GDAL_OBJ) $(LDFLAGS) $(LIBS) \
- -o $(GDAL_SLIB)
-
- $(LIBGDAL): $(GDAL_OBJ:.o=.lo)
-@@ -47,7 +42,7 @@
- endif
-
- check-lib: port-target core-target frmts-target ogr-target
-- $(MAKE) $(LIBGDAL-yes)
-+ $(MAKE) $(GDAL_SLIB)
-
- port-target:
- (cd port; $(MAKE))
diff --git a/make/3rdparty/osgearth/osg_win.sh b/make/3rdparty/osgearth/osg_win.sh
deleted file mode 100644
index ed428b692..000000000
--- a/make/3rdparty/osgearth/osg_win.sh
+++ /dev/null
@@ -1,388 +0,0 @@
-#!/bin/sh -e
-################################################################################
-#
-# This script compiles OSG and OSGEarth dependencies (GDAL, GEOS, ...)
-#
-# Known to work with MSYS 1.0.11
-# A zip file is provided here http://librepilot.github.io/tools/MSYS-1.0.11.zip
-# This zip is based on the official http://downloads.sourceforge.net/mingw/MSYS-1.0.11.exe
-# It was generated by installing MSYS-1.0.11.exe and adding to it:
-# - http://gnuwin32.sourceforge.net/packages/wget.htm
-# - http://gnuwin32.sourceforge.net/packages/libintl.htm
-# - http://gnuwin32.sourceforge.net/packages/libiconv.htm
-# And finally zipping the resulting directory (minus Readme.txt)
-#
-# A good source for building with mingw :
-# http://www.gaia-gis.it/gaia-sins/mingw_how_to.html
-#
-# Sample command line to execute this script from a MS shell :
-# .\tools\msys\bin\sh --login -i -c /d/Projects/LibrePilot/make/3rdparty/osgearth/osg_win.sh
-#
-# Executing this script from git bash does not seem to work.
-#
-################################################################################
-
-# turn -x on if DEBUG is set to a non-empty string
-[ -n "$DEBUG" ] && set -x
-
-################################################################################
-# MinGW
-################################################################################
-
-#MINGW_DIR=D:/Projects/LibrePilotTools/qt-5.4.1/Tools/mingw491_32
-if [ -z "$MINGW_DIR" ]; then
- echo MINGW_DIR not defined. Exiting...
- exit 1
-fi
-
-umount /mingw || true
-mount $MINGW_DIR /mingw
-
-################################################################################
-# Environment
-################################################################################
-
-BASE_DIR=$(dirname $0)
-
-WORK_DIR=$BASE_DIR
-ROOT_DIR=$BASE_DIR/../../..
-
-DOWNLOAD_DIR=$ROOT_DIR/downloads/osg
-SOURCE_DIR=$ROOT_DIR/3rdparty/osg_dependencies
-BUILD_DIR=$ROOT_DIR/build/3rdparty/osg_dependencies
-
-HOST=mingw32
-
-DOWNLOAD_FILES=1
-
-echo Root dir : $ROOT_DIR
-echo Work dir : $WORK_DIR
-echo Build dir : $BUILD_DIR
-echo MinGW dir : $MINGW_DIR
-
-################################################################################
-# download sources
-################################################################################
-
-if [ "$DOWNLOAD_FILES" -eq 1 ]; then
-
-SRC_FILES="
-http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
-http://zlib.net/zlib-1.2.8.tar.gz
-http://www.ijg.org/files/jpegsrc.v9a.tar.gz
-http://sourceforge.net/projects/libpng/files/libpng16/older-releases/1.6.16/libpng-1.6.16.tar.gz
-ftp://ftp.remotesensing.org/pub/libtiff/tiff-4.0.3.tar.gz
-http://sourceforge.net/projects/freetype/files/freetype2/2.5.3/freetype-2.5.3.tar.gz
-http://curl.haxx.se/download/curl-7.38.0.tar.gz
-http://download.osgeo.org/proj/proj-4.8.0.tar.gz
-http://download.osgeo.org/proj/proj-datumgrid-1.5.tar.gz
-http://download.osgeo.org/geos/geos-3.3.8.tar.bz2
-http://download.osgeo.org/gdal/1.10.1/gdal-1.10.1.tar.gz
-"
-
-mkdir -p $DOWNLOAD_DIR/
-for f in $SRC_FILES
-do
- filename=$(basename "$f")
- if [ ! -f $DOWNLOAD_DIR/$filename ]; then
- echo "****************************************"
- echo "Downloading $filename"
- echo "****************************************"
- wget -P $DOWNLOAD_DIR/ $f
- fi
-done
-
-fi
-
-################################################################################
-# build all
-################################################################################
-
-# list of libraries to build
-# other candidates include bzip2, libxml2, gif, geotiff, ssl, gl...
-BUILD_PKGCONFIG=1
-BUILD_ZLIB=1
-BUILD_LIBJPEG=1
-BUILD_LIBPNG=1
-BUILD_LIBTIFF=1
-BUILD_FREETYPE=1
-BUILD_OPENSSL=2
-BUILD_CURL=1
-BUILD_PROJ4=1
-BUILD_GEOS=1
-BUILD_GDAL=1
-
-# TODO
-# libcurl needs to be built with and ssl support
-# gdal does not seem to link with shared proj4
-
-# Clean src and build dirs
-rm -rf $SOURCE_DIR/*
-rm -rf $BUILD_DIR/*
-
-mkdir -p $SOURCE_DIR/
-mkdir -p $BUILD_DIR/
-mkdir -p $BUILD_DIR/bin/
-mkdir -p $BUILD_DIR/include/
-mkdir -p $BUILD_DIR/lib/
-
-# make sure all libraries see each others
-export PATH=$BUILD_DIR/bin:$PATH
-export CPATH=$BUILD_DIR/include
-export LIBRARY_PATH=$BUILD_DIR/lib
-export PKG_CONFIG_PATH=$BUILD_DIR/lib/pkgconfig
-
-# compiler flags
-export CFLAGS=-O2
-export CXXFLAGS=-O2
-
-################################################################################
-# pkg-config
-# required by libcurl, gdal, osg, osgearth
-################################################################################
-
-if [ "$BUILD_PKGCONFIG" -eq 1 ]; then
-
-echo "****************************************"
-echo "Building pkg-config..."
-echo "****************************************"
-
-cd $SOURCE_DIR
-tar xzf $DOWNLOAD_DIR/pkg-config-0.28.tar.gz -C .
-cd pkg-config-0.28
-
-./configure --prefix=$BUILD_DIR --build=$HOST \
- --with-internal-glib
-make
-make install
-
-fi
-
-################################################################################
-# ZLIB
-# required by libcurl, gdal, osg, osgearth
-################################################################################
-
-if [ "$BUILD_ZLIB" -eq 1 ]; then
-
-echo "****************************************"
-echo "Building zlib..."
-echo "****************************************"
-
-cd $SOURCE_DIR
-tar xzf $DOWNLOAD_DIR/zlib-1.2.8.tar.gz -C .
-cd zlib-1.2.8
-
-make -f win32/Makefile.gcc clean
-make -f win32/Makefile.gcc
-
-cp -f zlib1.dll $BUILD_DIR/bin/
-cp -f zconf.h $BUILD_DIR/include/
-cp -f zlib.h $BUILD_DIR/include/
-cp -f libz.a $BUILD_DIR/lib/
-cp -f libz.dll.a $BUILD_DIR/lib/
-
-fi
-
-################################################################################
-# LIBJPEG
-# required by gdal, osg, osgearth
-################################################################################
-
-if [ "$BUILD_LIBJPEG" -eq 1 ]; then
-
-echo "****************************************"
-echo "Building libjpeg..."
-echo "****************************************"
-
-cd $SOURCE_DIR
-tar xzf $DOWNLOAD_DIR/jpegsrc.v9a.tar.gz -C .
-cd jpeg-9a
-
-./configure --prefix=$BUILD_DIR --build=$HOST
-make
-make install-strip
-
-fi
-
-################################################################################
-# LIBPNG
-# required by gdal, osg, osgearth
-################################################################################
-
-if [ "$BUILD_LIBPNG" -eq 1 ]; then
-
-echo "****************************************"
-echo "Building libpng..."
-echo "****************************************"
-
-cd $SOURCE_DIR
-tar xzf $DOWNLOAD_DIR/libpng-1.6.16.tar.gz -C .
-cd libpng-1.6.16
-
-./configure --prefix=$BUILD_DIR --build=$HOST
-make
-make install-strip
-
-fi
-
-################################################################################
-# LIBTIFF
-# reqires zlib
-# required by gdal, osg, osgearth
-################################################################################
-
-if [ "$BUILD_LIBTIFF" -eq 1 ]; then
-
-echo "****************************************"
-echo "Building libtiff..."
-echo "****************************************"
-
-cd $SOURCE_DIR
-tar xzf $DOWNLOAD_DIR/tiff-4.0.3.tar.gz -C .
-cd tiff-4.0.3
-
-./configure --prefix=$BUILD_DIR --build=$HOST
-make
-make install-strip
-
-fi
-
-################################################################################
-# FreeType
-################################################################################
-
-if [ "$BUILD_FREETYPE" -eq 1 ]; then
-
-echo "****************************************"
-echo "Building FreeType..."
-echo "****************************************"
-
-cd $SOURCE_DIR
-tar xzf $DOWNLOAD_DIR/freetype-2.5.3.tar.gz -C .
-cd freetype-2.5.3
-
-./configure --prefix=$BUILD_DIR
-make
-make install
-
-fi
-
-################################################################################
-# OpenSSL
-################################################################################
-
-if [ "$BUILD_OPENSSL" -eq 1 ]; then
-
-echo "****************************************"
-echo "Building OpenSSL..."
-echo "****************************************"
-
-cd $SOURCE_DIR
-tar xzf $DOWNLOAD_DIR/curl-7.38.0.tar.gz -C .
-cd curl-7.38.0
-
-./configure --prefix=$BUILD_DIR --build=$HOST
-make
-make install
-
-fi
-
-################################################################################
-# cURL
-# required by gdal, osgearth
-################################################################################
-
-if [ "$BUILD_CURL" -eq 1 ]; then
-
-echo "****************************************"
-echo "Building cURL..."
-echo "****************************************"
-
-cd $SOURCE_DIR
-tar xzf $DOWNLOAD_DIR/curl-7.38.0.tar.gz -C .
-cd curl-7.38.0
-
-./configure --prefix=$BUILD_DIR --build=$HOST \
- --enable-shared=yes --with-zlib=$BUILD_DIR
-make
-make install-strip
-
-fi
-
-################################################################################
-# PROJ.4
-# required by osgearth
-################################################################################
-
-if [ "$BUILD_PROJ4" -eq 1 ]; then
-
-echo "****************************************"
-echo "Building PROJ.4..."
-echo "****************************************"
-
-cd $SOURCE_DIR
-tar -xzf $DOWNLOAD_DIR/proj-4.8.0.tar.gz -C .
-tar -xzf $DOWNLOAD_DIR/proj-datumgrid-1.5.tar.gz -C proj-4.8.0/nad/
-cd proj-4.8.0
-
-./configure --prefix=$BUILD_DIR --build=$HOST \
- --enable-static=no --enable-shared=yes
-make
-make install
-
-fi
-
-################################################################################
-# GEOS
-# required by gdal
-################################################################################
-
-if [ "$BUILD_GEOS" -eq 1 ]; then
-
-echo "****************************************"
-echo "Building GEOS..."
-echo "****************************************"
-
-cd $SOURCE_DIR
-tar xjf $DOWNLOAD_DIR/geos-3.3.8.tar.bz2 -C .
-cd geos-3.3.8
-
-# TODO why --disable-inline?
-./configure --prefix=$BUILD_DIR --build=$HOST \
- --enable-static=no --enable-shared=yes --disable-inline
-make
-make install
-
-fi
-
-################################################################################
-# GDAL
-# requires zlib, libcurl, libpng, libjpeg, libtiff, geos
-# required by osgearth
-################################################################################
-
-if [ "$BUILD_GDAL" -eq 1 ]; then
-
-echo "****************************************"
-echo "Building GDAL..."
-echo "****************************************"
-
-cd $SOURCE_DIR
-tar xzf $DOWNLOAD_DIR/gdal-1.10.1.tar.gz -C .
-cd gdal-1.10.1
-
-# fix GNUmakefile as described here http://trac.osgeo.org/gdal/wiki/BuildingWithMinGW
-patch < $WORK_DIR/gdal_GNUmakefile_fix.patch
-
-./configure --prefix=$BUILD_DIR --build=$HOST \
- --without-python --without-libtool \
- --with-xerces=no \
- --with-libz=$BUILD_DIR --with-curl=$BUILD_DIR \
- --with-png=$BUILD_DIR --with-jpeg=$BUILD_DIR --with-libtiff=$BUILD_DIR \
- --with-geos=$BUILD_DIR/bin/geos-config
-make
-make install
-
-fi
-
diff --git a/make/3rdparty/osgearth/osgearth.mk b/make/3rdparty/osgearth/osgearth.mk
index ddbea9a43..b6f6680b0 100644
--- a/make/3rdparty/osgearth/osgearth.mk
+++ b/make/3rdparty/osgearth/osgearth.mk
@@ -35,8 +35,7 @@
# Windows prerequisites
################################
#
-# Windows versions of osg and osgearth require many additional libraries to be build
-# See osg_win.sh
+# pacman -S mingw-w64-i686-cmake mingw-w64-i686-gdal
#
################################
# OSX prerequisites
@@ -104,19 +103,23 @@ ifeq ($(UNAME), Linux)
OSG_NAME := $(OSG_BASE_NAME)-linux-x86
endif
OSG_CMAKE_GENERATOR := "Unix Makefiles"
+ OSG_CMAKE_MAKE_PROGRAM := make
OSG_WINDOWING_SYSTEM := "X11"
# for some reason Qt is not added to the path in make/tools.mk
OSG_BUILD_PATH := $(QT_SDK_PREFIX)/bin:$(PATH)
else ifeq ($(UNAME), Darwin)
OSG_NAME := $(OSG_BASE_NAME)-clang_64
OSG_CMAKE_GENERATOR := "Unix Makefiles"
+ OSG_CMAKE_MAKE_PROGRAM := make
OSG_WINDOWING_SYSTEM := "Cocoa"
OSG_BUILD_PATH := $(QT_SDK_PREFIX)/bin:$(PATH)
else ifeq ($(UNAME), Windows)
OSG_NAME := $(OSG_BASE_NAME)-$(QT_SDK_ARCH)
OSG_CMAKE_GENERATOR := "MinGW Makefiles"
+ OSG_CMAKE_MAKE_PROGRAM := /mingw32/bin/mingw32-make
# CMake is quite picky about its PATH and will complain if sh.exe is found in it
- OSG_BUILD_PATH := $(MINGW_DIR)/bin:$(QT_SDK_PREFIX)/bin
+ #OSG_BUILD_PATH := $(MINGW_DIR)/bin:$(QT_SDK_PREFIX)/bin:/usr/bin:
+ #OSG_BUILD_PATH := $(PATH)
endif
OSG_NAME := $(OSG_NAME_PREFIX)$(OSG_NAME)$(OSG_NAME_SUFIX)
@@ -130,15 +133,17 @@ osg:
@$(ECHO) "Building osg $(call toprel, $(OSG_SRC_DIR)) into $(call toprel, $(OSG_BUILD_DIR))"
$(V1) $(MKDIR) -p $(OSG_BUILD_DIR)
$(V1) ( $(CD) $(OSG_BUILD_DIR) && \
- PATH=$(OSG_BUILD_PATH) && \
+ if [ $(OSG_BUILD_PATH) != "" ]; then \
+ PATH=$(OSG_BUILD_PATH) ; \
+ fi ; \
$(CMAKE) -G $(OSG_CMAKE_GENERATOR) -DCMAKE_BUILD_TYPE=$(OSG_BUILD_CONF) \
+ -DCMAKE_MAKE_PROGRAM=$(OSG_CMAKE_MAKE_PROGRAM) \
-DOSG_USE_QT=ON \
-DBUILD_OSG_APPLICATIONS=ON \
-DBUILD_OSG_EXAMPLES=OFF \
-DBUILD_OPENTHREADS_WITH_QT=OFF \
-DOSG_GL3_AVAILABLE=OFF \
-DOSG_PLUGIN_SEARCH_INSTALL_DIR_FOR_PLUGINS=OFF \
- -DCMAKE_PREFIX_PATH=$(BUILD_DIR)/3rdparty/osg_dependencies \
-DCMAKE_OSX_ARCHITECTURES="x86_64" \
-DOSG_WINDOWING_SYSTEM=$(OSG_WINDOWING_SYSTEM) \
-DCMAKE_INSTALL_NAME_DIR=@executable_path/../Plugins \
@@ -160,8 +165,17 @@ package_osg:
.PHONY: install_win_osg
install_win_osg:
- $(V1) $(CP) $(BUILD_DIR)/3rdparty/osg_dependencies/bin/*.dll $(OSG_INSTALL_DIR)/bin/
- $(V1) $(CP) $(BUILD_DIR)/3rdparty/osg_dependencies/lib/*.dll $(OSG_INSTALL_DIR)/bin/
+ $(V1) $(CP) /mingw32/bin/libcurl-4.dll $(OSG_INSTALL_DIR)/bin/
+ $(V1) $(CP) /mingw32/bin/libfreetype-6.dll $(OSG_INSTALL_DIR)/bin/
+ $(V1) $(CP) /mingw32/bin/libgdal-20.dll $(OSG_INSTALL_DIR)/bin/
+ $(V1) $(CP) /mingw32/bin/libgeos.dll $(OSG_INSTALL_DIR)/bin/
+ $(V1) $(CP) /mingw32/bin/libgeos_c.dll $(OSG_INSTALL_DIR)/bin/
+ $(V1) $(CP) /mingw32/bin/libjpeg-8.dll $(OSG_INSTALL_DIR)/bin/
+ $(V1) $(CP) /mingw32/bin/libpng16-16.dll $(OSG_INSTALL_DIR)/bin/
+ $(V1) $(CP) /mingw32/bin/libproj-9.dll $(OSG_INSTALL_DIR)/bin/
+ $(V1) $(CP) /mingw32/bin/libtiff-5.dll $(OSG_INSTALL_DIR)/bin/
+ $(V1) $(CP) /mingw32/bin/libtiffxx-5.dll $(OSG_INSTALL_DIR)/bin/
+ $(V1) $(CP) /mingw32/bin/zlib1.dll $(OSG_INSTALL_DIR)/bin/
.NOTPARALLEL:
.PHONY: prepare_osg
@@ -223,6 +237,7 @@ ifeq ($(UNAME), Linux)
OSGEARTH_NAME := $(OSGEARTH_BASE_NAME)-linux-x86
endif
OSGEARTH_CMAKE_GENERATOR := "Unix Makefiles"
+ OSGEARTH_CMAKE_MAKE_PROGRAM := make
# for some reason Qt is not added to the path in make/tools.mk
OSGEARTH_BUILD_PATH := $(QT_SDK_PREFIX)/bin:$(OSG_INSTALL_DIR)/bin:$(PATH)
ifeq ($(ARCH), x86_64)
@@ -233,13 +248,15 @@ ifeq ($(UNAME), Linux)
else ifeq ($(UNAME), Darwin)
OSGEARTH_NAME := $(OSGEARTH_BASE_NAME)-clang_64
OSGEARTH_CMAKE_GENERATOR := "Unix Makefiles"
+ OSGEARTH_CMAKE_MAKE_PROGRAM := make
OSGEARTH_BUILD_PATH := $(QT_SDK_PREFIX)/bin:$(OSG_INSTALL_DIR)/bin:$(PATH)
OSGEARTH_LIB_PATH := $(OSG_INSTALL_DIR)/lib
else ifeq ($(UNAME), Windows)
OSGEARTH_NAME := $(OSGEARTH_BASE_NAME)-$(QT_SDK_ARCH)
OSGEARTH_CMAKE_GENERATOR := "MinGW Makefiles"
+ OSGEARTH_CMAKE_MAKE_PROGRAM := /mingw32/bin/mingw32-make
# CMake is quite picky about its PATH and will complain if sh.exe is found in it
- OSGEARTH_BUILD_PATH := $(MINGW_DIR)/bin:$(QT_SDK_PREFIX)/bin:$(OSG_INSTALL_DIR)/bin
+ #OSGEARTH_BUILD_PATH := $(MINGW_DIR)/bin:$(QT_SDK_PREFIX)/bin:$(OSG_INSTALL_DIR)/bin
OSGEARTH_LIB_PATH := $(OSG_INSTALL_DIR)/lib
endif
@@ -254,17 +271,20 @@ osgearth:
@$(ECHO) "Building osgEarth $(call toprel, $(OSGEARTH_SRC_DIR)) into $(call toprel, $(OSGEARTH_BUILD_DIR))"
$(V1) $(MKDIR) -p $(OSGEARTH_BUILD_DIR)
$(V1) ( $(CD) $(OSGEARTH_BUILD_DIR) && \
- PATH=$(OSGEARTH_BUILD_PATH) && \
+ if [ $(OSGEARTH_BUILD_PATH) != "" ]; then \
+ PATH=$(OSGEARTH_BUILD_PATH) ; \
+ fi ; \
LD_LIBRARY_PATH=$(OSGEARTH_LIB_PATH) && \
export DYLD_LIBRARY_PATH=$(OSGEARTH_LIB_PATH) && \
unset OSG_NOTIFY_LEVEL && \
$(CMAKE) -G $(OSGEARTH_CMAKE_GENERATOR) -DCMAKE_BUILD_TYPE=$(OSGEARTH_BUILD_CONF) \
+ -DCMAKE_MAKE_PROGRAM=$(OSGEARTH_CMAKE_MAKE_PROGRAM) \
-DOSGEARTH_USE_QT=ON \
-DINSTALL_TO_OSG_DIR=OFF \
-DOSG_DIR=$(OSG_INSTALL_DIR) \
-DCMAKE_INCLUDE_PATH=$(OSG_INSTALL_DIR)/include \
-DCMAKE_LIBRARY_PATH=$(OSG_INSTALL_DIR)/lib \
- -DCMAKE_PREFIX_PATH=$(BUILD_DIR)/3rdparty/osg_dependencies \
+ -DCMAKE_PREFIX_PATH=$(OSGEARTH_LIB_PATH) \
-DCMAKE_OSX_ARCHITECTURES="x86_64" \
-DCMAKE_INSTALL_NAME_DIR=@executable_path/../Plugins \
-DCMAKE_INSTALL_PREFIX=$(OSGEARTH_INSTALL_DIR) $(OSGEARTH_SRC_DIR) && \
diff --git a/make/functions.mk b/make/functions.mk
index 5b39e23b5..9054524fa 100644
--- a/make/functions.mk
+++ b/make/functions.mk
@@ -16,6 +16,20 @@
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
+# Make sure we know few things about the architecture before including
+# the tools.mk to ensure that we download/install the right tools.
+UNAME := $(shell uname)
+# Here and everywhere if not Linux or Mac then assume Windows
+ifeq ($(filter Linux Darwin, $(UNAME)), )
+ UNAME := Windows
+endif
+
+ifeq ($(UNAME),Windows)
+ system_path = $(shell cygpath -w $(1))
+else
+ system_path = $(1)
+endif
+
# Function for converting Windows style slashes into Unix style
slashfix = $(subst \,/,$(1))
@@ -36,3 +50,4 @@ endef
smallify = $(subst $(SPACE),-,$(call lc,$1))
+get_arch = $(shell $(CC) -dumpmachine | sed s/-.*//)
diff --git a/make/scripts/version-info.py b/make/scripts/version-info.py
index 140ec7c85..d8b19b05f 100644
--- a/make/scripts/version-info.py
+++ b/make/scripts/version-info.py
@@ -195,6 +195,25 @@ class Repo:
except:
return None
+ def version_four_num(self):
+ """Return package version in format X.X.X.X using only numbers"""
+
+ try:
+ (release, junk, candidate) = self._last_tag.partition("-RC")
+ (year, dot, month_and_patch) = release.partition(".")
+ (month, dot, patch) = month_and_patch.partition(".")
+
+ if candidate == "":
+ candidate = "64" # Need to stay below 65536 for last part
+
+ if patch == "":
+ patch = "0"
+
+ return "{}.{}.{}.{}{:0>3.3}".format(year,month,patch,candidate,self._num_commits_past_tag)
+ except:
+ return None
+
+
def revision(self):
"""Return full revison string (tag if defined, or branch:hash date time if no tag)"""
try:
@@ -463,6 +482,7 @@ string given.
TAG_OR_BRANCH = r.tag(r.branch('unreleased')),
TAG_OR_HASH8 = r.tag(r.hash(8, 'untagged')),
LABEL = r.label(),
+ VERSION_FOUR_NUM = r.version_four_num(),
REVISION = r.revision(),
DIRTY = r.dirty(),
FWTAG = xtrim(r.tag(r.branch('unreleased')), r.dirty(), 25),
diff --git a/make/tools.mk b/make/tools.mk
index 058569b3f..a0cac49f1 100644
--- a/make/tools.mk
+++ b/make/tools.mk
@@ -174,9 +174,11 @@ QT_SDK_PREFIX := $(QT_SDK_DIR)
#
##############################
-BUILD_SDK_TARGETS := arm_sdk qt_sdk osg
+BUILD_SDK_TARGETS := arm_sdk osg
ifeq ($(UNAME), Windows)
- BUILD_SDK_TARGETS += sdl osgearth nsis mesawin openssl ccache
+ BUILD_SDK_TARGETS += nsis osgearth
+else
+ BUILD_SDK_TARGETS += qt_sdk
endif
ALL_SDK_TARGETS := $(BUILD_SDK_TARGETS) gtest uncrustify doxygen
diff --git a/package/Linux.mk b/package/Linux.mk
index 399490d44..72a64510c 100644
--- a/package/Linux.mk
+++ b/package/Linux.mk
@@ -54,9 +54,9 @@ install: uninstall
$(V1) $(MKDIR) -p $(DESTDIR)$(datadir)
$(V1) $(MKDIR) -p $(DESTDIR)$(datadir)/applications
$(V1) $(MKDIR) -p $(DESTDIR)$(datadir)/pixmaps
- $(V1) $(INSTALL) $(BUILD_DIR)/$(GCS_SMALL_NAME)_$(GCS_BUILD_CONF)/bin/$(GCS_SMALL_NAME) $(DESTDIR)$(bindir)
- $(V1) $(INSTALL) $(BUILD_DIR)/$(GCS_SMALL_NAME)_$(GCS_BUILD_CONF)/$(libbasename)/$(GCS_SMALL_NAME) $(DESTDIR)$(libdir)
- $(V1) $(INSTALL) $(BUILD_DIR)/$(GCS_SMALL_NAME)_$(GCS_BUILD_CONF)/share/$(GCS_SMALL_NAME) $(DESTDIR)$(datadir)
+ $(V1) $(INSTALL) $(GCS_DIR)/bin/$(GCS_SMALL_NAME) $(DESTDIR)$(bindir)
+ $(V1) $(INSTALL) $(GCS_DIR)/$(libbasename)/$(GCS_SMALL_NAME) $(DESTDIR)$(libdir)
+ $(V1) $(INSTALL) $(GCS_DIR)/share/$(GCS_SMALL_NAME) $(DESTDIR)$(datadir)
$(V1) $(INSTALL) -T $(ROOT_DIR)/package/linux/gcs.desktop $(DESTDIR)$(datadir)/applications/$(ORG_SMALL_NAME).desktop
$(V1) $(INSTALL) -T $(ROOT_DIR)/ground/gcs/src/plugins/coreplugin/images/$(ORG_SMALL_NAME)_logo_128.png \
$(DESTDIR)$(datadir)/pixmaps/$(ORG_SMALL_NAME).png
diff --git a/package/Windows.mk b/package/Windows.mk
index 705fb186a..ee6e50c0e 100644
--- a/package/Windows.mk
+++ b/package/Windows.mk
@@ -6,31 +6,36 @@ ifndef TOP_LEVEL_MAKEFILE
$(error Top level Makefile must be used to build this target)
endif
-VERSION_CMD := $(VERSION_INFO)
+PACKAGE_EXE := $(BUILD_DIR)/$(PACKAGE_FULL_NAME)_$(ARCH).exe
-NSIS_OPTS := /V3
+NSIS_OPTS := -V3
NSIS_WINX86 := $(ROOT_DIR)/package/winx86
NSIS_SCRIPT := $(NSIS_WINX86)/gcs.nsi
-NSIS_TEMPLATE := $(NSIS_WINX86)/gcs.tpl
-NSIS_HEADER := $(OPGCSSYNTHDIR)/gcs.nsh
+
+ifeq ($(ARCH),x86_64)
+WIN_DEF = -DW64
+endif
.PHONY: package
-package: gcs uavobjects_matlab | $(PACKAGE_DIR)
+package: $(PACKAGE_EXE)
+
+$(PACKAGE_EXE): $(NSIS_SCRIPT) gcs uavobjects_matlab | $(PACKAGE_DIR)
ifneq ($(GCS_BUILD_CONF),release)
# We can only package release builds
$(error Packaging is currently supported for release builds only)
endif
- $(V1) mkdir -p "$(dir $(NSIS_HEADER))"
- $(VERSION_CMD) \
- --template='$(NSIS_TEMPLATE)' \
- --outfile='$(NSIS_HEADER)' \
- ORG_BIG_NAME='$(ORG_BIG_NAME)' \
- GCS_BIG_NAME='$(GCS_BIG_NAME)' \
- GCS_SMALL_NAME='$(GCS_SMALL_NAME)' \
- PACKAGE_LBL='$(PACKAGE_LBL)' \
- PACKAGE_NAME='$(PACKAGE_NAME)' \
- PACKAGE_SEP='$(PACKAGE_SEP)'
$(V1) echo "Building Windows installer, please wait..."
$(V1) echo "If you have a script error in line 1 - use Unicode NSIS 2.46+"
$(V1) echo " http://www.scratchpaper.com"
- $(NSIS) $(NSIS_OPTS) $(NSIS_SCRIPT)
+ $(NSIS) $(NSIS_OPTS) \
+ -DORG_BIG_NAME='$(ORG_BIG_NAME)' \
+ -DGCS_BIG_NAME='$(GCS_BIG_NAME)' \
+ -DGCS_SMALL_NAME='$(GCS_SMALL_NAME)' \
+ -DPACKAGE_LBL='$(PACKAGE_LBL)' \
+ -DVERSION_FOUR_NUM='$(shell $(VERSION_INFO) --format=\$${VERSION_FOUR_NUM})' \
+ -DOUT_FILE='$(call system_path,$(PACKAGE_EXE))' \
+ -DPROJECT_ROOT='$(call system_path,$(ROOT_DIR))' \
+ -DGCS_BUILD_TREE='$(call system_path,$(GCS_DIR))' \
+ -DUAVO_SYNTH_TREE='$(call system_path,$(UAVOBJ_OUT_DIR))' \
+ $(WIN_DEF) \
+ $(NSIS_SCRIPT)
diff --git a/package/winx86/gcs.nsi b/package/winx86/gcs.nsi
index 4f1f5bb14..3d5b1f6f2 100644
--- a/package/winx86/gcs.nsi
+++ b/package/winx86/gcs.nsi
@@ -29,20 +29,19 @@
; Includes
!include "x64.nsh"
-!include "..\..\build\gcs-synthetics\gcs.nsh"
;--------------------------------
; Paths
- ; Tree root locations (relative to this script location)
- !define PROJECT_ROOT "..\.."
!define NSIS_DATA_TREE "."
- !define GCS_BUILD_TREE "..\..\build\${GCS_SMALL_NAME}_release"
- !define UAVO_SYNTH_TREE "..\..\build\uavobject-synthetics"
!define AEROSIMRC_TREE "${GCS_BUILD_TREE}\misc\AeroSIM-RC"
; Default installation folder
- InstallDir "$PROGRAMFILES\${ORG_BIG_NAME}"
+!ifdef W64
+ InstallDir "$PROGRAMFILES64\${ORG_BIG_NAME}"
+!else
+ InstallDir "$PROGRAMFILES32\${ORG_BIG_NAME}"
+!endif
; Get installation folder from registry if available
InstallDirRegKey HKLM "Software\${ORG_BIG_NAME}" "Install Location"
@@ -50,21 +49,15 @@
;--------------------------------
; Version information
- ; Program name and installer file
- !define PRODUCT_NAME "${GCS_BIG_NAME}"
- !define INSTALLER_NAME "${GCS_BIG_NAME} Installer"
+ Name "${GCS_BIG_NAME}"
+ OutFile "${OUT_FILE}"
- Name "${PRODUCT_NAME}"
- OutFile "${PACKAGE_DIR}\..\${OUT_FILE}"
-
- VIProductVersion ${PRODUCT_VERSION}
- VIAddVersionKey "ProductName" "${INSTALLER_NAME}"
- VIAddVersionKey "FileVersion" "${FILE_VERSION}"
- VIAddVersionKey "Comments" "${INSTALLER_NAME}. ${BUILD_DESCRIPTION}"
+ VIProductVersion ${VERSION_FOUR_NUM}
+ VIAddVersionKey "ProductName" "${GCS_BIG_NAME}"
+ VIAddVersionKey "ProductVersion" "${VERSION_FOUR_NUM}"
VIAddVersionKey "CompanyName" "The LibrePilot Team, http://www.librepilot.org"
- VIAddVersionKey "LegalTrademarks" "${PRODUCT_NAME} is a trademark of The LibrePilot Team"
VIAddVersionKey "LegalCopyright" "© 2015 The LibrePilot Team"
- VIAddVersionKey "FileDescription" "${INSTALLER_NAME}"
+ VIAddVersionKey "FileDescription" "${GCS_BIG_NAME} Installer"
;--------------------------------
; Installer interface and base settings
@@ -182,13 +175,6 @@ Section "-Plugins" InSecPlugins
File /r "${GCS_BUILD_TREE}\lib\${GCS_SMALL_NAME}\plugins\*.pluginspec"
SectionEnd
-; Copy OSG libs
-Section "-OsgLibs" InSecOsgLibs
- SectionIn RO
- SetOutPath "$INSTDIR\lib\${GCS_SMALL_NAME}\osg"
- File /r "${GCS_BUILD_TREE}\lib\${GCS_SMALL_NAME}\osg\*.dll"
-SectionEnd
-
; Copy GCS resources
Section "-Resources" InSecResources
SetOutPath "$INSTDIR\share"
@@ -222,7 +208,7 @@ SectionEnd
; Copy Opengl32.dll if needed (disabled by default)
Section /o "Mesa OpenGL driver" InSecInstallOpenGL
SetOutPath "$INSTDIR\bin"
- File /r "${GCS_BUILD_TREE}\bin\opengl32_32\opengl32.dll"
+ File /r "${GCS_BUILD_TREE}\bin\opengl32\opengl32.dll"
SectionEnd
; AeroSimRC plugin files
@@ -236,9 +222,9 @@ Section "Shortcuts" InSecShortcuts
SetOutPath "$INSTDIR"
CreateDirectory "$SMPROGRAMS\${ORG_BIG_NAME}"
CreateShortCut "$SMPROGRAMS\${ORG_BIG_NAME}\${GCS_BIG_NAME}.lnk" "$INSTDIR\bin\${GCS_SMALL_NAME}.exe" \
- "" "$INSTDIR\bin\${GCS_SMALL_NAME}.exe" 0 "" "" "${PRODUCT_NAME} ${PRODUCT_VERSION}. ${BUILD_DESCRIPTION}"
+ "" "$INSTDIR\bin\${GCS_SMALL_NAME}.exe" 0
CreateShortCut "$SMPROGRAMS\${ORG_BIG_NAME}\${GCS_BIG_NAME} (clean configuration).lnk" "$INSTDIR\bin\${GCS_SMALL_NAME}.exe" \
- "-reset" "$INSTDIR\bin\${GCS_SMALL_NAME}.exe" 0 "" "" "${PRODUCT_NAME} ${PRODUCT_VERSION}. ${BUILD_DESCRIPTION}"
+ "-reset" "$INSTDIR\bin\${GCS_SMALL_NAME}.exe" 0
CreateShortCut "$SMPROGRAMS\${ORG_BIG_NAME}\License.lnk" "$INSTDIR\LICENSE.txt" \
"" "$INSTDIR\bin\${GCS_SMALL_NAME}.exe" 0
CreateShortCut "$SMPROGRAMS\${ORG_BIG_NAME}\ReadMe.lnk" "$INSTDIR\README.txt" \
@@ -254,7 +240,7 @@ Section "Shortcuts" InSecShortcuts
CreateShortCut "$SMPROGRAMS\${ORG_BIG_NAME}\Forums.lnk" "http://forum.librepilot.org" \
"" "$INSTDIR\bin\${GCS_SMALL_NAME}.exe" 0
CreateShortCut "$DESKTOP\${GCS_BIG_NAME}.lnk" "$INSTDIR\bin\${GCS_SMALL_NAME}.exe" \
- "" "$INSTDIR\bin\${GCS_SMALL_NAME}.exe" 0 "" "" "${PRODUCT_NAME} ${PRODUCT_VERSION}. ${BUILD_DESCRIPTION}"
+ "" "$INSTDIR\bin\${GCS_SMALL_NAME}.exe" 0
CreateShortCut "$SMPROGRAMS\${ORG_BIG_NAME}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
SectionEnd
diff --git a/package/winx86/gcs.tpl b/package/winx86/gcs.tpl
deleted file mode 100644
index 24067201b..000000000
--- a/package/winx86/gcs.tpl
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# *****************************************************************************
-#
-# @file ${OUTFILENAME}
-# @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011-2015.
-# @brief Autogenerated NSIS header file, built using template
-# ${TEMPLATE}
-#
-# @see The GNU Public License (GPL) Version 3
-#
-# *****************************************************************************
-#
-
-; Some names, paths and constants
-!define ORG_BIG_NAME "${ORG_BIG_NAME}"
-!define GCS_BIG_NAME "${GCS_BIG_NAME}"
-!define GCS_SMALL_NAME "${GCS_SMALL_NAME}"
-!define PACKAGE_LBL "${PACKAGE_LBL}"
-!define PACKAGE_NAME "${PACKAGE_NAME}"
-!define PACKAGE_SEP "${PACKAGE_SEP}"
-!define PACKAGE_DIR "..\..\build\package"
-!define FIRMWARE_DIR "firmware"
-!define OUT_FILE "$${PACKAGE_NAME}$${PACKAGE_SEP}$${PACKAGE_LBL}$${PACKAGE_SEP}win32.exe"
-
-; Installer version info
-!define PRODUCT_VERSION "0.0.0.0"
-!define FILE_VERSION "${TAG_OR_BRANCH}:${HASH8}${DIRTY} ${DATETIME}"
-!define BUILD_DESCRIPTION "${PACKAGE_LBL} built from ${ORIGIN}, committed ${DATETIME} as ${HASH}"
diff --git a/tool_install.sh b/tool_install.sh
index 1ad5244f4..ae8aeca9f 100755
--- a/tool_install.sh
+++ b/tool_install.sh
@@ -76,12 +76,7 @@ function download_file
#2 The output directory
function zip_extract
{
- if [ "$uname" = Windows ]
- then
- 7za.exe x -o"$2" "$1"
- else
- unzip "$1" -d "$2"
- fi
+ unzip "$1" -d "$2"
}
## Extracts a 7zip file