Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
df489c3e
Commit
df489c3e
authored
Feb 27, 2020
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Phase duration and time after smart RTL now displayed correctly
parent
86978aa1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
10 deletions
+25
-10
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+3
-2
FlightDisplayWimaMenu.qml
src/FlightDisplay/FlightDisplayWimaMenu.qml
+5
-0
WimaController.cc
src/Wima/WimaController.cc
+15
-8
WimaController.h
src/Wima/WimaController.h
+2
-0
No files found.
src/FlightDisplay/FlightDisplayView.qml
View file @
df489c3e
...
@@ -608,7 +608,8 @@ QGCView {
...
@@ -608,7 +608,8 @@ QGCView {
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.bottomMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.bottomMargin
:
ScreenTools
.
defaultFontPixelWidth
maxWidth
:
singleMultiSelector
.
x
-
ScreenTools
.
defaultFontPixelHeight
*
4
maxWidth
:
singleMultiSelector
.
x
-
ScreenTools
.
defaultFontPixelHeight
*
4
maxHeight
:
parent
.
height
-
toolStrip
.
height
-
toolStrip
.
y
-
ScreenTools
.
defaultFontPixelHeight
*
4
maxHeight
:
_flightMap
.
height
-
toolStrip
.
height
-
toolStrip
.
y
-
ScreenTools
.
defaultFontPixelHeight
*
4
wimaController
:
_wimaController
wimaController
:
_wimaController
...
@@ -679,7 +680,7 @@ QGCView {
...
@@ -679,7 +680,7 @@ QGCView {
maxHeight
:
(
_flightVideo
.
visible
?
_flightVideo
.
y
:
parent
.
height
)
-
toolStrip
.
y
maxHeight
:
(
_flightVideo
.
visible
?
_flightVideo
.
y
:
parent
.
height
)
-
toolStrip
.
y
buttonVisible
:
[
_useChecklist
,
_guidedController
.
showTakeoff
||
!
_guidedController
.
showLand
,
_guidedController
.
showLand
&&
!
_guidedController
.
showTakeoff
,
true
,
true
,
true
]
buttonVisible
:
[
_useChecklist
,
_guidedController
.
showTakeoff
||
!
_guidedController
.
showLand
,
_guidedController
.
showLand
&&
!
_guidedController
.
showTakeoff
,
true
,
true
,
true
]
buttonEnabled
:
[
_useChecklist
&&
_activeVehicle
,
_guidedController
.
showTakeoff
,
_guidedController
.
showLand
,
_guidedController
.
showRTL
,
_guidedController
.
showPause
,
_anyActionAvailable
]
buttonEnabled
:
[
_useChecklist
&&
_activeVehicle
,
_guidedController
.
showTakeoff
,
_guidedController
.
showLand
,
_guidedController
.
showRTL
,
_guidedController
.
showPause
,
_anyActionAvailable
]
horizontal
:
fals
e
horizontal
:
tru
e
enableSwitchButton
:
true
enableSwitchButton
:
true
property
bool
_anyActionAvailable
:
_guidedController
.
showStartMission
||
_guidedController
.
showResumeMission
||
_guidedController
.
showChangeAlt
||
_guidedController
.
showLandAbort
property
bool
_anyActionAvailable
:
_guidedController
.
showStartMission
||
_guidedController
.
showResumeMission
||
_guidedController
.
showChangeAlt
||
_guidedController
.
showLandAbort
...
...
src/FlightDisplay/FlightDisplayWimaMenu.qml
View file @
df489c3e
...
@@ -21,6 +21,7 @@ Item {
...
@@ -21,6 +21,7 @@ Item {
id
:
_root
id
:
_root
height
:
mainFrame
.
height
height
:
mainFrame
.
height
width
:
mainFrame
.
width
width
:
mainFrame
.
width
clip
:
true
property
int
maxHeight
:
500
property
int
maxHeight
:
500
property
int
maxWidth
:
300
property
int
maxWidth
:
300
...
@@ -36,6 +37,10 @@ Item {
...
@@ -36,6 +37,10 @@ Item {
signal
initSmartRTL
();
signal
initSmartRTL
();
DeadMouseArea
{
anchors.fill
:
parent
}
Item
{
Item
{
id
:
_private
id
:
_private
property
bool
missionReadyForStart
:
true
property
bool
missionReadyForStart
:
true
...
...
src/Wima/WimaController.cc
View file @
df489c3e
...
@@ -42,6 +42,8 @@ WimaController::WimaController(QObject *parent)
...
@@ -42,6 +42,8 @@ WimaController::WimaController(QObject *parent)
,
_returnPathLength
(
-
1
)
,
_returnPathLength
(
-
1
)
,
_phaseDistance
(
-
1
)
,
_phaseDistance
(
-
1
)
,
_phaseDuration
(
-
1
)
,
_phaseDuration
(
-
1
)
,
_phaseDistanceBuffer
(
-
1
)
,
_phaseDurationBuffer
(
-
1
)
,
_vehicleHasLowBattery
(
false
)
,
_vehicleHasLowBattery
(
false
)
,
_lowBatteryHandlingTriggered
(
false
)
,
_lowBatteryHandlingTriggered
(
false
)
,
_executingSmartRTL
(
false
)
,
_executingSmartRTL
(
false
)
...
@@ -807,10 +809,12 @@ bool WimaController::calcNextPhase()
...
@@ -807,10 +809,12 @@ bool WimaController::calcNextPhase()
_currentMissionItems
.
append
(
visualItemCopy
);
_currentMissionItems
.
append
(
visualItemCopy
);
}
}
_setPhaseDistance
(
_measurementPathLength
+
_arrivalPathLength
+
_returnPathLength
);
double
dist
=
0
;
_setPhaseDuration
(
_measurementPathLength
/
_flightSpeed
.
rawValue
().
toDouble
()
double
time
=
0
;
+
(
_arrivalPathLength
+
_returnPathLength
)
if
(
!
_missionController
->
distanceTimeToMissionEnd
(
dist
,
time
,
1
,
false
))
/
_arrivalReturnSpeed
.
rawValue
().
toDouble
());
qWarning
(
"WimaController::calcNextPhase: distanceTimeToMissionEnd returned false!"
);
_setPhaseDistance
(
dist
);
_setPhaseDuration
(
time
);
_missionController
->
removeAll
();
// remove items from _missionController, will be added on upload
_missionController
->
removeAll
();
// remove items from _missionController, will be added on upload
updateAltitude
();
updateAltitude
();
...
@@ -978,6 +982,8 @@ void WimaController::smartRTLCleanUp(bool flying)
...
@@ -978,6 +982,8 @@ void WimaController::smartRTLCleanUp(bool flying)
if
(
_executingSmartRTL
)
{
if
(
_executingSmartRTL
)
{
_executingSmartRTL
=
false
;
_executingSmartRTL
=
false
;
_loadCurrentMissionItemsFromBuffer
();
_loadCurrentMissionItemsFromBuffer
();
_setPhaseDistance
(
_phaseDistanceBuffer
);
_setPhaseDuration
(
_phaseDurationBuffer
);
_showAllMissionItems
.
setRawValue
(
true
);
_showAllMissionItems
.
setRawValue
(
true
);
_missionController
->
removeAllFromVehicle
();
_missionController
->
removeAllFromVehicle
();
_missionController
->
removeAll
();
_missionController
->
removeAll
();
...
@@ -1062,6 +1068,9 @@ bool WimaController::_calcReturnPath(QString &errorSring)
...
@@ -1062,6 +1068,9 @@ bool WimaController::_calcReturnPath(QString &errorSring)
// qWarning() << "returnPath.size()" << returnPath.size();
// qWarning() << "returnPath.size()" << returnPath.size();
_saveCurrentMissionItemsToBuffer
();
_saveCurrentMissionItemsToBuffer
();
_phaseDistanceBuffer
=
_phaseDistance
;
_phaseDurationBuffer
=
_phaseDuration
;
// create Mission Items
// create Mission Items
removeFromVehicle
();
removeFromVehicle
();
...
@@ -1127,10 +1136,8 @@ bool WimaController::_calcReturnPath(QString &errorSring)
...
@@ -1127,10 +1136,8 @@ bool WimaController::_calcReturnPath(QString &errorSring)
}
}
//qWarning() << "_currentMissionItems.count()" << _currentMissionItems.count();
//qWarning() << "_currentMissionItems.count()" << _currentMissionItems.count();
_setPhaseDistance
(
_phaseDistance
+
_arrivalPathLength
+
_returnPathLength
);
_setPhaseDistance
(
-
1
);
_setPhaseDuration
(
_phaseDistance
/
_flightSpeed
.
rawValue
().
toDouble
()
_setPhaseDuration
(
-
1
);
+
(
_arrivalPathLength
+
_returnPathLength
)
/
_arrivalReturnSpeed
.
rawValue
().
toDouble
());
_missionController
->
removeAll
();
// remove items from _missionController, will be added on upload
_missionController
->
removeAll
();
// remove items from _missionController, will be added on upload
updateAltitude
();
updateAltitude
();
...
...
src/Wima/WimaController.h
View file @
df489c3e
...
@@ -238,6 +238,8 @@ private:
...
@@ -238,6 +238,8 @@ private:
double
_returnPathLength
;
// the length of the arrival and return path in meters
double
_returnPathLength
;
// the length of the arrival and return path in meters
double
_phaseDistance
;
// the lenth in meters of the current phase
double
_phaseDistance
;
// the lenth in meters of the current phase
double
_phaseDuration
;
// the phase duration in seconds
double
_phaseDuration
;
// the phase duration in seconds
double
_phaseDistanceBuffer
;
// buffer for storing _phaseDistance when doing smart RTL
double
_phaseDurationBuffer
;
// buffer for storing _phaseDuration when doing smart RTL
QTimer
_checkBatteryTimer
;
QTimer
_checkBatteryTimer
;
bool
_vehicleHasLowBattery
;
bool
_vehicleHasLowBattery
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment