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
cacad2b2
Commit
cacad2b2
authored
Feb 10, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2774 from DonLakeFlyer/HomeLine
Fix line to home logic
parents
79959dcb
35118d54
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
17 deletions
+7
-17
MissionController.cc
src/MissionManager/MissionController.cc
+7
-17
No files found.
src/MissionManager/MissionController.cc
View file @
cacad2b2
...
...
@@ -455,6 +455,7 @@ void MissionController::_recalcWaypointLines(void)
_waypointLines
.
clear
();
bool
linkBackToHome
=
false
;
for
(
int
i
=
1
;
i
<
_missionItems
->
count
();
i
++
)
{
MissionItem
*
item
=
qobject_cast
<
MissionItem
*>
(
_missionItems
->
get
(
i
));
...
...
@@ -462,6 +463,10 @@ void MissionController::_recalcWaypointLines(void)
item
->
setAzimuth
(
0.0
);
item
->
setDistance
(
-
1.0
);
if
(
firstCoordinateItem
&&
item
->
command
()
==
MavlinkQmlSingleton
::
MAV_CMD_NAV_TAKEOFF
)
{
linkBackToHome
=
true
;
}
if
(
item
->
specifiesCoordinate
())
{
double
absoluteAltitude
=
item
->
coordinate
().
altitude
();
if
(
item
->
relativeAltitude
())
{
...
...
@@ -471,23 +476,8 @@ void MissionController::_recalcWaypointLines(void)
maxAltSeen
=
std
::
max
(
maxAltSeen
,
absoluteAltitude
);
if
(
!
item
->
standaloneCoordinate
())
{
if
(
firstCoordinateItem
)
{
if
(
item
->
command
()
==
MavlinkQmlSingleton
::
MAV_CMD_NAV_TAKEOFF
)
{
// The first coordinate we hit is a takeoff command so link back to home position
if
(
showHomePosition
)
{
double
azimuth
,
distance
,
altDifference
;
_waypointLines
.
append
(
new
CoordinateVector
(
homeItem
->
coordinate
(),
item
->
coordinate
()));
_calcPrevWaypointValues
(
homeAlt
,
item
,
homeItem
,
&
azimuth
,
&
distance
,
&
altDifference
);
item
->
setAltDifference
(
altDifference
);
item
->
setAzimuth
(
azimuth
);
item
->
setDistance
(
distance
);
}
}
else
{
// First coordiante is not a takeoff command, it does not link backwards to anything
}
firstCoordinateItem
=
false
;
}
else
if
(
!
lastCoordinateItem
->
homePosition
()
||
showHomePosition
)
{
if
(
!
lastCoordinateItem
->
homePosition
()
||
(
showHomePosition
&&
linkBackToHome
)
)
{
double
azimuth
,
distance
,
altDifference
;
// Subsequent coordinate items link to last coordinate item. If the last coordinate item
...
...
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