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
cf178232
Commit
cf178232
authored
Jan 09, 2012
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some bugs that allowed to have multiple or no "current" mission elements in Edit list
parent
763ec366
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
UASWaypointManager.cc
src/uas/UASWaypointManager.cc
+13
-0
WaypointList.cc
src/ui/WaypointList.cc
+2
-2
No files found.
src/uas/UASWaypointManager.cc
View file @
cf178232
...
...
@@ -401,6 +401,19 @@ int UASWaypointManager::removeWaypoint(quint16 seq)
if
(
seq
<
waypointsEditable
.
size
())
{
Waypoint
*
t
=
waypointsEditable
[
seq
];
if
(
t
->
getCurrent
()
==
true
)
//trying to remove the current waypoint
{
if
(
seq
+
1
<
waypointsEditable
.
size
())
// setting the next waypoint as current
{
waypointsEditable
[
seq
+
1
]
->
setCurrent
(
true
);
}
else
if
(
seq
-
1
>=
0
)
//if deleting the last on the list, then setting the previous waypoint as current
{
waypointsEditable
[
seq
-
1
]
->
setCurrent
(
true
);
}
}
waypointsEditable
.
remove
(
seq
);
delete
t
;
t
=
NULL
;
...
...
src/ui/WaypointList.cc
View file @
cf178232
...
...
@@ -293,7 +293,7 @@ void WaypointList::addCurrentPositionWaypoint()
yawGlobal
=
last
->
getYaw
();
}
// Create global frame waypoint per default
wp
=
new
Waypoint
(
0
,
uas
->
getLatitude
(),
uas
->
getLongitude
(),
uas
->
getAltitude
(),
0
,
acceptanceRadiusGlobal
,
holdTime
,
yawGlobal
,
true
,
tru
e
,
MAV_FRAME_GLOBAL_RELATIVE_ALT
,
MAV_CMD_NAV_WAYPOINT
);
wp
=
new
Waypoint
(
0
,
uas
->
getLatitude
(),
uas
->
getLongitude
(),
uas
->
getAltitude
(),
0
,
acceptanceRadiusGlobal
,
holdTime
,
yawGlobal
,
true
,
fals
e
,
MAV_FRAME_GLOBAL_RELATIVE_ALT
,
MAV_CMD_NAV_WAYPOINT
);
WPM
->
addWaypointEditable
(
wp
);
updateStatusLabel
(
tr
(
"Added GLOBAL, ALTITUDE OVER GROUND waypoint"
));
}
...
...
@@ -307,7 +307,7 @@ void WaypointList::addCurrentPositionWaypoint()
holdTime
=
last
->
getHoldTime
();
}
// Create local frame waypoint as second option
wp
=
new
Waypoint
(
0
,
uas
->
getLocalX
(),
uas
->
getLocalY
(),
uas
->
getLocalZ
(),
uas
->
getYaw
(),
acceptanceRadiusLocal
,
holdTime
,
0.0
,
true
,
tru
e
,
MAV_FRAME_LOCAL_NED
,
MAV_CMD_NAV_WAYPOINT
);
wp
=
new
Waypoint
(
0
,
uas
->
getLocalX
(),
uas
->
getLocalY
(),
uas
->
getLocalZ
(),
uas
->
getYaw
(),
acceptanceRadiusLocal
,
holdTime
,
0.0
,
true
,
fals
e
,
MAV_FRAME_LOCAL_NED
,
MAV_CMD_NAV_WAYPOINT
);
WPM
->
addWaypointEditable
(
wp
);
updateStatusLabel
(
tr
(
"Added LOCAL (NED) waypoint"
));
}
...
...
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