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
ae16d99f
Commit
ae16d99f
authored
Feb 11, 2020
by
Valentin Platzgummer
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clear trajectory added to wima menu, zLevel of mission items in flight view fixed
parent
3b25253b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
19 deletions
+38
-19
FlightDisplayViewMap.qml
src/FlightDisplay/FlightDisplayViewMap.qml
+4
-4
FlightDisplayWimaMenu.qml
src/FlightDisplay/FlightDisplayWimaMenu.qml
+8
-0
Vehicle.h
src/Vehicle/Vehicle.h
+1
-1
WimaController.cc
src/Wima/WimaController.cc
+24
-14
WimaController.h
src/Wima/WimaController.h
+1
-0
No files found.
src/FlightDisplay/FlightDisplayViewMap.qml
View file @
ae16d99f
...
...
@@ -223,8 +223,8 @@ FlightMap {
missionItems
:
wimaController
.
missionItems
path
:
wimaController
.
waypointPath
showItems
:
_wimaEnabled
&&
_showAllWimaItems
zOrderWP
:
QGroundControl
.
zOrderWaypointIndicators
-
3
zOrderLines
:
QGroundControl
.
zOrderWaypointLines
-
1
zOrderWP
:
QGroundControl
.
zOrderWaypointIndicators
-
2
zOrderLines
:
QGroundControl
.
zOrderWaypointLines
-
2
color
:
"
gray
"
}
// current Items
...
...
@@ -235,8 +235,8 @@ FlightMap {
path
:
wimaController
.
currentWaypointPath
showItems
:
_wimaEnabled
&&
_showCurrentWimaItems
zOrderWP
:
QGroundControl
.
zOrderWaypointIndicators
-
1
zOrderLines
:
QGroundControl
.
zOrderWaypoint
Indicators
-
2
color
:
"
green
"
// gray with alpha 0.7
zOrderLines
:
QGroundControl
.
zOrderWaypoint
Lines
-
1
color
:
"
green
"
}
// Add trajectory points to the map
...
...
src/FlightDisplay/FlightDisplayWimaMenu.qml
View file @
ae16d99f
...
...
@@ -310,6 +310,14 @@ Item {
Layout.fillWidth
:
true
}
QGCButton
{
id
:
buttonRemoveTrajectoryHistory
text
:
qsTr
(
"
Clear Trajectory
"
)
onClicked
:
wimaController
.
removeVehicleTrajectoryHistory
()
Layout.columnSpan
:
2
Layout.fillWidth
:
true
}
// progess bar
Rectangle
{
...
...
src/Vehicle/Vehicle.h
View file @
ae16d99f
...
...
@@ -1051,7 +1051,7 @@ public:
QGCCameraManager
*
dynamicCameras
()
{
return
_cameras
;
}
QString
hobbsMeter
();
/// @true: When flying a mission the vehicle is always facing towards the next
waypoint
/// @true: When flying a mission the vehicle is always facing towards the next
setCurrentMissionSequence
bool
vehicleYawsToNextWaypointInMission
(
void
)
const
;
/// The vehicle is responsible for making the initial request for the Plan.
...
...
src/Wima/WimaController.cc
View file @
ae16d99f
...
...
@@ -292,24 +292,20 @@ bool WimaController::forceUploadToVehicle()
SimpleMissionItem
*
item
=
_currentMissionItems
.
value
<
SimpleMissionItem
*>
(
i
);
_missionController
->
insertSimpleMissionItem
(
*
item
,
visuals
->
count
());
if
(
item
->
command
()
==
MAV_CMD_DO_CHANGE_SPEED
)
{
qWarning
()
<<
item
->
missionItem
().
param2
();
}
}
qWarning
(
"blah"
);
for
(
int
i
=
0
;
i
<
_missionController
->
visualItems
()
->
count
();
i
++
){
SimpleMissionItem
*
item
=
_missionController
->
visualItems
()
->
value
<
SimpleMissionItem
*>
(
i
);
if
(
item
==
nullptr
)
continue
;
if
(
item
->
command
()
==
MAV_CMD_DO_CHANGE_SPEED
)
{
qWarning
()
<<
item
->
missionItem
().
param2
();
}
}
for
(
int
i
=
0
;
i
<
_missionController
->
visualItems
()
->
count
();
i
++
){
SimpleMissionItem
*
item
=
_missionController
->
visualItems
()
->
value
<
SimpleMissionItem
*>
(
i
);
if
(
item
==
nullptr
)
continue
;
qWarning
()
<<
i
<<
":"
<<
item
->
command
();
}
_masterController
->
sendToVehicle
();
...
...
@@ -363,9 +359,16 @@ bool WimaController::initSmartRTL()
bool
retValue
=
calcReturnPath
();
if
(
!
retValue
)
return
false
;
emit
uploadAndExecuteConfirmRequired
();
return
true
;
}
void
WimaController
::
removeVehicleTrajectoryHistory
()
{
Vehicle
*
managerVehicle
=
masterController
()
->
managerVehicle
();
managerVehicle
->
trajectoryPoints
()
->
clear
();
}
void
WimaController
::
saveToCurrent
()
{
...
...
@@ -939,20 +942,24 @@ void WimaController::checkBatteryLevel()
_setVehicleHasLowBattery
(
true
);
if
(
!
_lowBatteryHandlingTriggered
)
{
QString
errorString
;
attemptCounter
++
;
if
(
attemptCounter
>
3
)
{
_lowBatteryHandlingTriggered
=
true
;
attemptCounter
=
0
;
}
attemptCounter
++
;
if
(
_checkSmartRTLPreCondition
(
errorString
)
==
true
)
{
managerVehicle
->
pauseVehicle
();
if
(
_calcReturnPath
(
errorString
))
{
_lowBatteryHandlingTriggered
=
true
;
attemptCounter
=
0
;
emit
returnBatteryLowConfirmRequired
();
}
else
{
qgcApp
()
->
showMessage
(
tr
(
"Battery level is low. Smart RTL not possible."
));
qgcApp
()
->
showMessage
(
errorString
);
if
(
attemptCounter
>
3
)
{
qgcApp
()
->
showMessage
(
tr
(
"Battery level is low. Smart RTL not possible."
));
qgcApp
()
->
showMessage
(
errorString
);
}
}
}
if
(
attemptCounter
>
3
)
{
// try 3 times, somtimes vehicle is outside joined area
_lowBatteryHandlingTriggered
=
true
;
attemptCounter
=
0
;
}
}
}
else
{
...
...
@@ -971,6 +978,8 @@ void WimaController::smartRTLCleanUp(bool flying)
_executingSmartRTL
=
false
;
_loadCurrentMissionItemsFromBuffer
();
_showAllMissionItems
.
setRawValue
(
true
);
_missionController
->
removeAllFromVehicle
();
_missionController
->
removeAll
();
disconnect
(
masterController
()
->
managerVehicle
(),
&
Vehicle
::
flyingChanged
,
this
,
&
WimaController
::
smartRTLCleanUp
);
}
}
...
...
@@ -1132,7 +1141,6 @@ bool WimaController::_calcReturnPath(QString &errorSring)
_showAllMissionItems
.
setRawValue
(
false
);
managerVehicle
->
trajectoryPoints
()
->
clear
();
emit
uploadAndExecuteConfirmRequired
();
return
true
;
}
...
...
@@ -1160,6 +1168,7 @@ void WimaController::_loadCurrentMissionItemsFromBuffer()
{
_currentMissionItems
.
clear
();
int
numItems
=
_missionItemsBuffer
.
count
();
qWarning
()
<<
"WimaController::_loadCurrentMissionItemsFromBuffer: numItems"
<<
numItems
;
for
(
int
i
=
0
;
i
<
numItems
;
i
++
)
_currentMissionItems
.
append
(
_missionItemsBuffer
.
removeAt
(
0
));
...
...
@@ -1170,8 +1179,9 @@ void WimaController::_loadCurrentMissionItemsFromBuffer()
void
WimaController
::
_saveCurrentMissionItemsToBuffer
()
{
_missionItemsBuffer
.
clear
();
int
numCurrentMissionItems
=
_currentMissionItems
.
count
();
for
(
int
i
=
0
;
i
<
numCurrentMissionItems
;
i
++
)
int
numItems
=
_currentMissionItems
.
count
();
qWarning
()
<<
"WimaController::_saveCurrentMissionItemsToBuffer: numItems"
<<
numItems
;
for
(
int
i
=
0
;
i
<
numItems
;
i
++
)
_missionItemsBuffer
.
append
(
_currentMissionItems
.
removeAt
(
0
));
}
...
...
src/Wima/WimaController.h
View file @
ae16d99f
...
...
@@ -111,6 +111,7 @@ public:
Q_INVOKABLE
bool
calcReturnPath
();
// wrapper for _calcReturnPath(QString &errorSring)#
Q_INVOKABLE
bool
executeSmartRTL
();
// wrapper for _executeSmartRTL(QString &errorSring)
Q_INVOKABLE
bool
initSmartRTL
();
Q_INVOKABLE
void
removeVehicleTrajectoryHistory
();
Q_INVOKABLE
void
saveToCurrent
();
...
...
Valentin Platzgummer
@platzgummer
mentioned in commit
190cf9fe
·
Feb 12, 2020
mentioned in commit
190cf9fe
mentioned in commit 190cf9fe95b88e3c8e3365747b57d001e8a2d6fb
Toggle commit list
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