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
710fffe1
Commit
710fffe1
authored
Jul 09, 2016
by
Don Gagne
Committed by
GitHub
Jul 09, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3758 from DonLakeFlyer/CopyCoordFrame
Plan: Copy coordinate frame from prev waypoint as well
parents
ddb22c89
28c0bf9e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
MissionController.cc
src/MissionManager/MissionController.cc
+11
-7
MissionController.h
src/MissionManager/MissionController.h
+1
-1
No files found.
src/MissionManager/MissionController.cc
View file @
710fffe1
...
...
@@ -175,11 +175,13 @@ int MissionController::insertSimpleMissionItem(QGeoCoordinate coordinate, int i)
newItem
->
setDefaultsForCommand
();
if
((
MAV_CMD
)
newItem
->
command
()
==
MAV_CMD_NAV_WAYPOINT
)
{
double
lastValue
;
MAV_FRAME
lastFrame
;
if
(
_findLastAcceptanceRadius
(
&
lastValue
))
{
newItem
->
missionItem
().
setParam2
(
lastValue
);
}
if
(
_findLastAltitude
(
&
lastValue
))
{
if
(
_findLastAltitude
(
&
lastValue
,
&
lastFrame
))
{
newItem
->
missionItem
().
setFrame
(
lastFrame
);
newItem
->
missionItem
().
setParam7
(
lastValue
);
}
}
...
...
@@ -1047,23 +1049,24 @@ void MissionController::_inProgressChanged(bool inProgress)
}
}
bool
MissionController
::
_findLastAltitude
(
double
*
lastAltitude
)
bool
MissionController
::
_findLastAltitude
(
double
*
lastAltitude
,
MAV_FRAME
*
frame
)
{
bool
found
=
false
;
bool
found
=
false
;
double
foundAltitude
;
MAV_FRAME
foundFrame
;
// Don't use home position
for
(
int
i
=
1
;
i
<
_visualItems
->
count
();
i
++
)
{
VisualMissionItem
*
visualItem
=
qobject_cast
<
VisualMissionItem
*>
(
_visualItems
->
get
(
i
));
if
(
visualItem
->
specifiesCoordinate
()
&&
!
visualItem
->
isStandaloneCoordinate
())
{
foundAltitude
=
visualItem
->
exitCoordinate
().
altitude
();
found
=
true
;
if
(
visualItem
->
isSimpleItem
())
{
SimpleMissionItem
*
simpleItem
=
qobject_cast
<
SimpleMissionItem
*>
(
visualItem
);
if
((
MAV_CMD
)
simpleItem
->
command
()
==
MAV_CMD_NAV_TAKEOFF
)
{
found
=
false
;
if
((
MAV_CMD
)
simpleItem
->
command
()
!=
MAV_CMD_NAV_TAKEOFF
)
{
foundAltitude
=
simpleItem
->
exitCoordinate
().
altitude
();
foundFrame
=
simpleItem
->
missionItem
().
frame
();
found
=
true
;
}
}
}
...
...
@@ -1071,6 +1074,7 @@ bool MissionController::_findLastAltitude(double* lastAltitude)
if
(
found
)
{
*
lastAltitude
=
foundAltitude
;
*
frame
=
foundFrame
;
}
return
found
;
...
...
src/MissionManager/MissionController.h
View file @
710fffe1
...
...
@@ -103,7 +103,7 @@ private:
void
_autoSyncSend
(
void
);
void
_setupActiveVehicle
(
Vehicle
*
activeVehicle
,
bool
forceLoadFromVehicle
);
static
void
_calcPrevWaypointValues
(
double
homeAlt
,
VisualMissionItem
*
currentItem
,
VisualMissionItem
*
prevItem
,
double
*
azimuth
,
double
*
distance
,
double
*
altDifference
);
bool
_findLastAltitude
(
double
*
lastAltitude
);
bool
_findLastAltitude
(
double
*
lastAltitude
,
MAV_FRAME
*
frame
);
bool
_findLastAcceptanceRadius
(
double
*
lastAcceptanceRadius
);
void
_addPlannedHomePosition
(
QmlObjectListModel
*
visualItems
,
bool
addToCenter
);
double
_normalizeLat
(
double
lat
);
...
...
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