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
bf3b5ebe
Commit
bf3b5ebe
authored
Oct 19, 2019
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upload issue in flight view fixed
parent
145d193b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
8 deletions
+79
-8
MissionController.cc
src/MissionManager/MissionController.cc
+22
-8
MissionController.h
src/MissionManager/MissionController.h
+5
-0
WimaController.cc
src/Wima/WimaController.cc
+52
-0
No files found.
src/MissionManager/MissionController.cc
View file @
bf3b5ebe
...
...
@@ -391,24 +391,38 @@ int MissionController::insertSimpleMissionItem(const MissionItem &missionItem, i
int
sequenceNumber
=
_nextSequenceNumber
();
SimpleMissionItem
*
newItem
=
new
SimpleMissionItem
(
_controllerVehicle
,
_flyView
,
missionItem
,
this
);
newItem
->
setSequenceNumber
(
sequenceNumber
);
newItem
->
setCommand
(
MAV_CMD_NAV_WAYPOINT
);
_initVisualItem
(
newItem
);
MAV_CMD
takeoffCmd
=
_controllerVehicle
->
vtol
()
?
MAV_CMD_NAV_VTOL_TAKEOFF
:
MAV_CMD_NAV_TAKEOFF
;
if
(
newItem
->
command
()
==
takeoffCmd
)
{
if
(
!
_controllerVehicle
->
firmwarePlugin
()
->
supportedMissionCommands
().
contains
(
takeoffCmd
))
{
newItem
->
setCommand
(
MAV_CMD_NAV_WAYPOINT
);
return
-
1
;
// can not add this takeoff command for this vehicle
}
}
if
(
newItem
->
specifiesAltitude
())
{
double
prevAltitude
;
int
prevAltitudeMode
;
if
(
newItem
->
specifiesAltitude
())
{
newItem
->
altitude
()
->
setRawValue
(
missionItem
.
relativeAltitude
());
newItem
->
setAltitudeMode
(
QGroundControlQmlGlobal
::
AltitudeMode
::
AltitudeModeRelative
);
}
newItem
->
setMissionFlightStatus
(
_missionFlightStatus
);
_visualItems
->
insert
(
i
,
newItem
);
if
(
_findPreviousAltitude
(
i
,
&
prevAltitude
,
&
prevAltitudeMode
))
{
newItem
->
altitude
()
->
setRawValue
(
prevAltitude
);
newItem
->
setAltitudeMode
(
static_cast
<
QGroundControlQmlGlobal
::
AltitudeMode
>
(
prevAltitudeMode
));
return
newItem
->
sequenceNumber
();
}
int
MissionController
::
insertSimpleMissionItem
(
SimpleMissionItem
&
missionItem
,
int
i
)
{
int
sequenceNumber
=
_nextSequenceNumber
();
SimpleMissionItem
*
newItem
=
new
SimpleMissionItem
(
missionItem
,
_flyView
,
this
);
newItem
->
setSequenceNumber
(
sequenceNumber
);
_initVisualItem
(
newItem
);
MAV_CMD
takeoffCmd
=
_controllerVehicle
->
vtol
()
?
MAV_CMD_NAV_VTOL_TAKEOFF
:
MAV_CMD_NAV_TAKEOFF
;
if
(
newItem
->
command
()
==
takeoffCmd
)
{
if
(
!
_controllerVehicle
->
firmwarePlugin
()
->
supportedMissionCommands
().
contains
(
takeoffCmd
))
{
newItem
->
setCommand
(
MAV_CMD_NAV_WAYPOINT
);
return
-
1
;
// can not add this takeoff command for this vehicle
}
}
newItem
->
setMissionFlightStatus
(
_missionFlightStatus
);
//
newItem->setMissionFlightStatus(_missionFlightStatus);
_visualItems
->
insert
(
i
,
newItem
);
return
newItem
->
sequenceNumber
();
...
...
src/MissionManager/MissionController.h
View file @
bf3b5ebe
...
...
@@ -113,6 +113,11 @@ public:
/// @return Sequence number for new item
int
insertSimpleMissionItem
(
const
MissionItem
&
missionItem
,
int
i
);
/// Add a new simple mission item to the list
/// @param i: index to insert at
/// @return Sequence number for new item
int
insertSimpleMissionItem
(
SimpleMissionItem
&
missionItem
,
int
i
);
/// Add a new ROI mission item to the list
/// @param i: index to insert at
/// @return Sequence number for new item
...
...
src/Wima/WimaController.cc
View file @
bf3b5ebe
...
...
@@ -165,6 +165,56 @@ void WimaController::resetPhase()
void
WimaController
::
uploadToVehicle
()
{
if
(
_currentMissionItems
.
count
()
<
1
)
return
;
_missionController
->
removeAll
();
// set homeposition of settingsItem
QmlObjectListModel
*
visuals
=
_missionController
->
visualItems
();
MissionSettingsItem
*
settingsItem
=
visuals
->
value
<
MissionSettingsItem
*>
(
0
);
if
(
settingsItem
==
nullptr
)
{
qWarning
(
"WimaController::updateCurrentMissionItems(): nullptr"
);
return
;
}
settingsItem
->
setCoordinate
(
_takeoffLandPostion
);
// copy mission items from _currentMissionItems to _missionController
for
(
int
i
=
0
;
i
<
_currentMissionItems
.
count
();
i
++
){
SimpleMissionItem
*
item
=
_currentMissionItems
.
value
<
SimpleMissionItem
*>
(
i
);
_missionController
->
insertSimpleMissionItem
(
*
item
,
visuals
->
count
());
}
// // set land command for last mission item
// SimpleMissionItem *landItem = visuals->value<SimpleMissionItem*>(visuals->count()-1);
// if (landItem == nullptr) {
// qWarning("WimaController::uploadToVehicle(): nullptr");
// _missionController->removeAll();
// return;
// }
// // check vehicle type, before setting land command
// Vehicle* controllerVehicle = _masterController->controllerVehicle();
// MAV_CMD landCmd = controllerVehicle->vtol() ? MAV_CMD_NAV_VTOL_LAND : MAV_CMD_NAV_LAND;
// if (controllerVehicle->firmwarePlugin()->supportedMissionCommands().contains(landCmd)) {
// landItem->setCommand(landCmd);
// } else {
// _missionController->removeAll();
// return;
// }
for
(
int
i
=
1
;
i
<
visuals
->
count
();
i
++
)
{
SimpleMissionItem
*
item
=
visuals
->
value
<
SimpleMissionItem
*>
(
i
);
qWarning
()
<<
item
->
coordinate
();
qWarning
()
<<
item
->
command
();
qWarning
()
<<
item
->
missionItem
().
param1
();
qWarning
()
<<
item
->
missionItem
().
param2
();
qWarning
()
<<
item
->
missionItem
().
param3
();
qWarning
()
<<
item
->
missionItem
().
param4
();
qWarning
()
<<
item
->
missionItem
().
param5
();
qWarning
()
<<
item
->
missionItem
().
param6
();
qWarning
()
<<
item
->
missionItem
().
param7
();
qWarning
(
" "
);
}
_masterController
->
sendToVehicle
();
}
...
...
@@ -542,6 +592,8 @@ void WimaController::calcNextPhase()
_currentMissionItems
.
append
(
visualItemCopy
);
}
_missionController
->
removeAll
();
// remove items from _missionController, will be added on upload
updateCurrentPath
();
emit
currentMissionItemsChanged
();
}
...
...
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