mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
Merge remote-tracking branch 'origin/rel-14.01' into laurent/OP-1187_allow_french_translations_in_future_releases
This commit is contained in:
commit
15dfec2d70
@ -48,7 +48,6 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <pid.h>
|
#include <pid.h>
|
||||||
#include <CoordinateConversions.h>
|
#include <CoordinateConversions.h>
|
||||||
#include <attitudestate.h>
|
|
||||||
#include <altitudeholdsettings.h>
|
#include <altitudeholdsettings.h>
|
||||||
#include <altitudeholddesired.h> // object that will be updated by the module
|
#include <altitudeholddesired.h> // object that will be updated by the module
|
||||||
#include <altitudeholdstatus.h>
|
#include <altitudeholdstatus.h>
|
||||||
@ -170,21 +169,6 @@ static void altitudeHoldTask(void)
|
|||||||
// velocity control loop
|
// velocity control loop
|
||||||
throttle = startThrottle - pid_apply_setpoint(&pid1, 1.0f, altitudeHoldStatus.VelocityDesired, velocityStateDown, 1000.0f / DESIRED_UPDATE_RATE_MS);
|
throttle = startThrottle - pid_apply_setpoint(&pid1, 1.0f, altitudeHoldStatus.VelocityDesired, velocityStateDown, 1000.0f / DESIRED_UPDATE_RATE_MS);
|
||||||
|
|
||||||
// compensate throttle for current attitude
|
|
||||||
// Rbe[2][2] in the rotation matrix is the rotated down component of a
|
|
||||||
// 0,0,1 vector
|
|
||||||
// it is used to scale the throttle, but only up to 4 times the regular
|
|
||||||
// throttle
|
|
||||||
AttitudeStateData attitudeState;
|
|
||||||
AttitudeStateGet(&attitudeState);
|
|
||||||
float Rbe[3][3];
|
|
||||||
Quaternion2R(&attitudeState.q1, Rbe);
|
|
||||||
if (fabsf(Rbe[2][2]) > 0.25f) {
|
|
||||||
throttle /= Rbe[2][2];
|
|
||||||
} else {
|
|
||||||
throttle /= 0.25f;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (throttle >= 1.0f) {
|
if (throttle >= 1.0f) {
|
||||||
throttle = 1.0f;
|
throttle = 1.0f;
|
||||||
}
|
}
|
||||||
|
@ -194,7 +194,6 @@ MODULE_INITCALL(StabilizationInitialize, StabilizationStart);
|
|||||||
static void stabilizationTask(__attribute__((unused)) void *parameters)
|
static void stabilizationTask(__attribute__((unused)) void *parameters)
|
||||||
{
|
{
|
||||||
UAVObjEvent ev;
|
UAVObjEvent ev;
|
||||||
|
|
||||||
uint32_t timeval = PIOS_DELAY_GetRaw();
|
uint32_t timeval = PIOS_DELAY_GetRaw();
|
||||||
|
|
||||||
ActuatorDesiredData actuatorDesired;
|
ActuatorDesiredData actuatorDesired;
|
||||||
@ -757,13 +756,17 @@ static float stab_powf(float x, uint8_t p)
|
|||||||
|
|
||||||
static void SettingsBankUpdatedCb(__attribute__((unused)) UAVObjEvent *ev)
|
static void SettingsBankUpdatedCb(__attribute__((unused)) UAVObjEvent *ev)
|
||||||
{
|
{
|
||||||
StabilizationBankData bank, oldBank;
|
|
||||||
|
|
||||||
StabilizationBankGet(&oldBank);
|
|
||||||
|
|
||||||
if (cur_flight_mode < 0 || cur_flight_mode >= NUM_FMS_POSITIONS) {
|
if (cur_flight_mode < 0 || cur_flight_mode >= NUM_FMS_POSITIONS) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if ((ev) && ((settings.FlightModeMap[cur_flight_mode] == 0 && ev->obj != StabilizationSettingsBank1Handle()) ||
|
||||||
|
(settings.FlightModeMap[cur_flight_mode] == 1 && ev->obj != StabilizationSettingsBank2Handle()) ||
|
||||||
|
(settings.FlightModeMap[cur_flight_mode] == 2 && ev->obj != StabilizationSettingsBank3Handle()) ||
|
||||||
|
settings.FlightModeMap[cur_flight_mode] > 2)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
StabilizationBankData bank;
|
||||||
|
|
||||||
switch (settings.FlightModeMap[cur_flight_mode]) {
|
switch (settings.FlightModeMap[cur_flight_mode]) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -777,17 +780,9 @@ static void SettingsBankUpdatedCb(__attribute__((unused)) UAVObjEvent *ev)
|
|||||||
case 2:
|
case 2:
|
||||||
StabilizationSettingsBank3Get((StabilizationSettingsBank3Data *)&bank);
|
StabilizationSettingsBank3Get((StabilizationSettingsBank3Data *)&bank);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
|
||||||
memset(&bank, 0, sizeof(StabilizationBankDataPacked));
|
|
||||||
// return; //bank number is invalid. All we can do is ignore it.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Need to do this to prevent an infinite loop
|
|
||||||
if (memcmp(&oldBank, &bank, sizeof(StabilizationBankDataPacked)) != 0) {
|
|
||||||
StabilizationBankSet(&bank);
|
StabilizationBankSet(&bank);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static void BankUpdatedCb(__attribute__((unused)) UAVObjEvent *ev)
|
static void BankUpdatedCb(__attribute__((unused)) UAVObjEvent *ev)
|
||||||
{
|
{
|
||||||
|
@ -162,7 +162,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#define PIOS_STABILIZATION_STACK_SIZE 790
|
#define PIOS_STABILIZATION_STACK_SIZE 790
|
||||||
#define PIOS_TELEM_STACK_SIZE 540
|
#define PIOS_TELEM_STACK_SIZE 540
|
||||||
#define PIOS_EVENTDISPATCHER_STACK_SIZE 150
|
#define PIOS_EVENTDISPATCHER_STACK_SIZE 160
|
||||||
|
|
||||||
/* This can't be too high to stop eventdispatcher thread overflowing */
|
/* This can't be too high to stop eventdispatcher thread overflowing */
|
||||||
#define PIOS_EVENTDISAPTCHER_QUEUE 10
|
#define PIOS_EVENTDISAPTCHER_QUEUE 10
|
||||||
|
@ -84,15 +84,6 @@ GCS_LIBRARY_PATH
|
|||||||
data_copy.commands += $(COPY_DIR) $$targetPath(\"$$[QT_INSTALL_QML]/$$dir\") $$targetPath(\"$$GCS_QT_QML_PATH/$$dir\") $$addNewline()
|
data_copy.commands += $(COPY_DIR) $$targetPath(\"$$[QT_INSTALL_QML]/$$dir\") $$targetPath(\"$$GCS_QT_QML_PATH/$$dir\") $$addNewline()
|
||||||
}
|
}
|
||||||
|
|
||||||
# Remove the few unwanted libs after whole dir copy
|
|
||||||
QT_QUICK2_DELS = QtQuick/Controls/libqtquickcontrolsplugin.so \
|
|
||||||
QtQuick/Controls/Private/libqtquickcontrolsprivateplugin.so \
|
|
||||||
QtQuick/Dialogs/libdialogplugin.so
|
|
||||||
|
|
||||||
for(delfile, QT_QUICK2_DELS) {
|
|
||||||
data_copy.commands += $(DEL_FILE) $$targetPath(\"$$GCS_QT_QML_PATH/$${delfile}\") $$addNewline()
|
|
||||||
}
|
|
||||||
|
|
||||||
# Remaining QtQuick plugin libs
|
# Remaining QtQuick plugin libs
|
||||||
QT_QUICK2_DLLS = QtQuick.2/libqtquick2plugin.so \
|
QT_QUICK2_DLLS = QtQuick.2/libqtquick2plugin.so \
|
||||||
QtQuick.2/plugins.qmltypes \
|
QtQuick.2/plugins.qmltypes \
|
||||||
@ -210,22 +201,6 @@ GCS_LIBRARY_PATH
|
|||||||
data_copy.commands += $(COPY_DIR) $$targetPath(\"$$[QT_INSTALL_QML]/$$dir\") $$targetPath(\"$$GCS_APP_PATH/$$dir\") $$addNewline()
|
data_copy.commands += $(COPY_DIR) $$targetPath(\"$$[QT_INSTALL_QML]/$$dir\") $$targetPath(\"$$GCS_APP_PATH/$$dir\") $$addNewline()
|
||||||
}
|
}
|
||||||
|
|
||||||
# Remove the few unwanted DDLs after whole dir copy
|
|
||||||
QT_QUICK2_DELS = qtquick/controls/qtquickcontrolsplugin \
|
|
||||||
qtquick/controls/private/qtquickcontrolsprivateplugin \
|
|
||||||
qtquick/dialogs/dialogplugin
|
|
||||||
|
|
||||||
CONFIG(debug, debug|release) {
|
|
||||||
for(delfile, QT_QUICK2_DELS) {
|
|
||||||
data_copy.commands += $(DEL_FILE) $$targetPath(\"$$GCS_APP_PATH/$${delfile}.dll\") $$addNewline()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CONFIG(release, debug|release) {
|
|
||||||
for(delfile, QT_QUICK2_DELS) {
|
|
||||||
data_copy.commands += $(DEL_FILE) $$targetPath(\"$$GCS_APP_PATH/$${delfile}d.dll\") $$addNewline()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Remaining QtQuick plugin DLLs
|
# Remaining QtQuick plugin DLLs
|
||||||
QT_QUICK2_DLLS = QtQuick.2/qtquick2plugin$${DS}.dll \
|
QT_QUICK2_DLLS = QtQuick.2/qtquick2plugin$${DS}.dll \
|
||||||
QtQuick.2/plugins.qmltypes \
|
QtQuick.2/plugins.qmltypes \
|
||||||
|
@ -91,6 +91,7 @@ void InputChannelForm::minMaxUpdated()
|
|||||||
void InputChannelForm::neutralUpdated()
|
void InputChannelForm::neutralUpdated()
|
||||||
{
|
{
|
||||||
int neutralValue = ui->neutralValue->value();
|
int neutralValue = ui->neutralValue->value();
|
||||||
|
|
||||||
if (ui->channelRev->isChecked()) {
|
if (ui->channelRev->isChecked()) {
|
||||||
if (neutralValue > ui->channelMin->value()) {
|
if (neutralValue > ui->channelMin->value()) {
|
||||||
ui->channelMin->setValue(neutralValue);
|
ui->channelMin->setValue(neutralValue);
|
||||||
|
@ -50,8 +50,7 @@ ConnectionManager::ConnectionManager(Internal::MainWindow *mainWindow) :
|
|||||||
{
|
{
|
||||||
// device list
|
// device list
|
||||||
m_availableDevList = new QComboBox;
|
m_availableDevList = new QComboBox;
|
||||||
m_availableDevList->setMinimumWidth(120);
|
m_availableDevList->setMinimumContentsLength(tr("USB: OPLinkMini").length());
|
||||||
m_availableDevList->setMaximumWidth(180);
|
|
||||||
m_availableDevList->setContextMenuPolicy(Qt::CustomContextMenu);
|
m_availableDevList->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
|
|
||||||
// connect button
|
// connect button
|
||||||
@ -60,9 +59,9 @@ ConnectionManager::ConnectionManager(Internal::MainWindow *mainWindow) :
|
|||||||
|
|
||||||
// put everything together
|
// put everything together
|
||||||
QHBoxLayout *layout = new QHBoxLayout;
|
QHBoxLayout *layout = new QHBoxLayout;
|
||||||
layout->setSpacing(5);
|
layout->setSpacing(6);
|
||||||
// cheat a bit with the margin to "nicely" center things vertically
|
// cheat a bit with the margin to "nicely" center things vertically
|
||||||
layout->setContentsMargins(5, 0, 5, 4);
|
layout->setContentsMargins(6, 0, 4, 2);
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
|
|
||||||
layout->addWidget(new QLabel(tr("Connections:")), 0, Qt::AlignVCenter);
|
layout->addWidget(new QLabel(tr("Connections:")), 0, Qt::AlignVCenter);
|
||||||
|
@ -98,13 +98,13 @@ QGraphicsTextItem *createTextItem(QGraphicsSvgItem *parent, QString elementId, Q
|
|||||||
MonitorWidget::MonitorWidget(QWidget *parent) :
|
MonitorWidget::MonitorWidget(QWidget *parent) :
|
||||||
QGraphicsView(parent), aspectRatioMode(Qt::KeepAspectRatio)
|
QGraphicsView(parent), aspectRatioMode(Qt::KeepAspectRatio)
|
||||||
{
|
{
|
||||||
// setMinimumWidth(180);
|
setMinimumSize(180, 25);
|
||||||
|
|
||||||
QGraphicsScene *scene = new QGraphicsScene();
|
QGraphicsScene *scene = new QGraphicsScene();
|
||||||
|
|
||||||
setScene(scene);
|
setScene(scene);
|
||||||
|
|
||||||
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
|
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||||
|
|
||||||
// no scroll bars
|
// no scroll bars
|
||||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
|
Loading…
Reference in New Issue
Block a user