Skip to content

Commit 62e72db

Browse files
committed
Merged in f5soh/librepilot/LP-601_WP_output_file_locale (pull request #517)
LP-601 Waypoint fixes Approved-by: Lalanne Laurent <f5soh@free.fr> Approved-by: Eric Price <corvuscorax@cybertrench.com>
2 parents 1ea6a3d + 62f48ac commit 62e72db

File tree

6 files changed

+17
-14
lines changed

6 files changed

+17
-14
lines changed

flight/modules/PathPlanner/pathplanner.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -604,16 +604,15 @@ static uint8_t conditionBelowError()
604604
/**
605605
* the AboveAltitude measures the flight altitude relative to home position
606606
* returns true if above critical altitude
607-
* WARNING! Altitudes are always negative (down coordinate)
608-
* Parameter 0: altitude in meters (negative!)
607+
* Parameter 0: altitude in meters
609608
*/
610609
static uint8_t conditionAboveAltitude()
611610
{
612611
PositionStateData positionState;
613612

614613
PositionStateGet(&positionState);
615614

616-
if (positionState.Down <= pathAction.ConditionParameters[0]) {
615+
if (-positionState.Down >= pathAction.ConditionParameters[0]) {
617616
return true;
618617
}
619618
return false;

ground/gcs/src/libs/opmapcontrol/src/core/providerstrings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ ProviderStrings::ProviderStrings()
4141
{
4242
// Google version strings
4343
VersionGoogleMap = "m@301";
44-
QString version = "810";
44+
QString version = "823";
4545
QString envVersion = qgetenv("GCS_GOOGLE_SAT_VERSION").constData();
4646
VersionGoogleSatellite = (envVersion.toInt() > version.toInt()) ? envVersion : version;
4747
VersionGoogleLabels = "h@301";

ground/gcs/src/plugins/opmap/flightdatamodel.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -453,27 +453,27 @@ bool flightDataModel::writeToFile(QString fileName)
453453
waypoint.appendChild(field);
454454

455455
field = doc.createElement("field");
456-
field.setAttribute("value", obj->latPosition);
456+
field.setAttribute("value", QString::number(obj->latPosition, 'f', 16));
457457
field.setAttribute("name", "latitude");
458458
waypoint.appendChild(field);
459459

460460
field = doc.createElement("field");
461-
field.setAttribute("value", obj->lngPosition);
461+
field.setAttribute("value", QString::number(obj->lngPosition, 'f', 16));
462462
field.setAttribute("name", "longitude");
463463
waypoint.appendChild(field);
464464

465465
field = doc.createElement("field");
466-
field.setAttribute("value", obj->disRelative);
466+
field.setAttribute("value", QString::number(obj->disRelative, 'f', 16));
467467
field.setAttribute("name", "distance_to_home");
468468
waypoint.appendChild(field);
469469

470470
field = doc.createElement("field");
471-
field.setAttribute("value", obj->beaRelative);
471+
field.setAttribute("value", QString::number(obj->beaRelative, 'f', 16));
472472
field.setAttribute("name", "bearing_from_home");
473473
waypoint.appendChild(field);
474474

475475
field = doc.createElement("field");
476-
field.setAttribute("value", obj->altitudeRelative);
476+
field.setAttribute("value", QString::number(obj->altitudeRelative, 'f', 16));
477477
field.setAttribute("name", "altitude_above_home");
478478
waypoint.appendChild(field);
479479

ground/gcs/src/plugins/opmap/modelmapproxy.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ modelMapProxy::overlayType modelMapProxy::overlayTranslate(int type)
8989
case MapDataDelegate::MODE_GOTOENDPOINT:
9090
case MapDataDelegate::MODE_FOLLOWVECTOR:
9191
case MapDataDelegate::MODE_VELOCITY:
92+
case MapDataDelegate::MODE_FIXEDATTITUDE:
9293
case MapDataDelegate::MODE_LAND:
9394
case MapDataDelegate::MODE_AUTOTAKEOFF:
9495
case MapDataDelegate::MODE_BRAKE:
@@ -98,8 +99,12 @@ modelMapProxy::overlayType modelMapProxy::overlayTranslate(int type)
9899
return OVERLAY_CIRCLE_RIGHT;
99100

100101
case MapDataDelegate::MODE_CIRCLELEFT:
101-
default:
102102
return OVERLAY_CIRCLE_LEFT;
103+
104+
case MapDataDelegate::MODE_SETACCESSORY:
105+
case MapDataDelegate::MODE_DISARMALARM:
106+
default:
107+
return OVERLAY_NOLINE;
103108
}
104109
}
105110

ground/gcs/src/plugins/opmap/modelmapproxy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
using namespace mapcontrol;
4141
class modelMapProxy : public QObject {
42-
typedef enum { OVERLAY_LINE, OVERLAY_CIRCLE_RIGHT, OVERLAY_CIRCLE_LEFT } overlayType;
42+
typedef enum { OVERLAY_LINE, OVERLAY_CIRCLE_RIGHT, OVERLAY_CIRCLE_LEFT, OVERLAY_NOLINE } overlayType;
4343
Q_OBJECT
4444
public:
4545
explicit modelMapProxy(QObject *parent, OPMapWidget *map, flightDataModel *model, QItemSelectionModel *selectionModel);

ground/gcs/src/plugins/opmap/opmap_edit_waypoint_dialog.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ opmap_edit_waypoint_dialog::opmap_edit_waypoint_dialog(QWidget *parent, QAbstrac
7373
mapper->addMapping(ui->dsb_condParam1, flightDataModel::CONDITION_PARAMS0);
7474
mapper->addMapping(ui->dsb_condParam2, flightDataModel::CONDITION_PARAMS1);
7575
mapper->addMapping(ui->dsb_condParam3, flightDataModel::CONDITION_PARAMS2);
76-
mapper->addMapping(ui->dsb_condParam4, flightDataModel::CONDITION_PARAMS0);
76+
mapper->addMapping(ui->dsb_condParam4, flightDataModel::CONDITION_PARAMS3);
7777

7878
mapper->addMapping(ui->cbCommand, flightDataModel::COMMAND);
7979
mapper->addMapping(ui->sbJump, flightDataModel::JUMPDESTINATION);
@@ -290,8 +290,7 @@ void opmap_edit_waypoint_dialog::setupConditionWidgets()
290290
ui->condParam1->setEnabled(true);
291291
ui->dsb_condParam1->setEnabled(true);
292292
ui->condParam1->setText("Altitude (m):");
293-
ui->descriptionConditionLabel->setText(tr("<p>The AboveAltitude condition measures the flight altitude relative to home position, returns true if "
294-
"above critical altitude.</p><p><b>WARNING!</b> altitudes set here are always <b>negative</b> if above Home. (down coordinate)</p>"));
293+
ui->descriptionConditionLabel->setText(tr("<p>The AboveAltitude condition measures the flight altitude relative to home position, returns true if above critical altitude.</p>"));
295294
break;
296295
case MapDataDelegate::ENDCONDITION_ABOVESPEED:
297296
ui->condParam1->setEnabled(true);

0 commit comments

Comments
 (0)