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
91a34940
Commit
91a34940
authored
Nov 17, 2016
by
Don Gagne
Committed by
GitHub
Nov 17, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4216 from DonLakeFlyer/ChangeAlt
Correct altitude usage for Change Altitude
parents
8eab3f6e
cba2a722
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
PX4FirmwarePlugin.cc
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc
+8
-4
No files found.
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc
View file @
91a34940
...
...
@@ -365,7 +365,7 @@ void PX4FirmwarePlugin::guidedModeTakeoff(Vehicle* vehicle, double altitudeRel)
void
PX4FirmwarePlugin
::
guidedModeGotoLocation
(
Vehicle
*
vehicle
,
const
QGeoCoordinate
&
gotoCoord
)
{
if
(
qIsNaN
(
vehicle
->
altitude
Relative
()
->
rawValue
().
toDouble
()))
{
if
(
qIsNaN
(
vehicle
->
altitude
AMSL
()
->
rawValue
().
toDouble
()))
{
qgcApp
()
->
showMessage
(
QStringLiteral
(
"Unable to go to location, vehicle position not known."
));
return
;
}
...
...
@@ -397,8 +397,12 @@ void PX4FirmwarePlugin::guidedModeGotoLocation(Vehicle* vehicle, const QGeoCoord
void
PX4FirmwarePlugin
::
guidedModeChangeAltitude
(
Vehicle
*
vehicle
,
double
altitudeRel
)
{
if
(
qIsNaN
(
vehicle
->
altitudeRelative
()
->
rawValue
().
toDouble
()))
{
qgcApp
()
->
showMessage
(
QStringLiteral
(
"Unable to change altitude, vehicle altitude not known."
));
if
(
!
vehicle
->
homePositionAvailable
())
{
qgcApp
()
->
showMessage
(
QStringLiteral
(
"Unable to change altitude, home position unknown."
));
return
;
}
if
(
qIsNaN
(
vehicle
->
homePosition
().
altitude
()))
{
qgcApp
()
->
showMessage
(
QStringLiteral
(
"Unable to change altitude, home position altitude unknown."
));
return
;
}
...
...
@@ -413,7 +417,7 @@ void PX4FirmwarePlugin::guidedModeChangeAltitude(Vehicle* vehicle, double altitu
cmd
.
param4
=
NAN
;
cmd
.
param5
=
NAN
;
cmd
.
param6
=
NAN
;
cmd
.
param7
=
vehicle
->
altitudeAMSL
()
->
rawValue
().
toDoubl
e
()
+
altitudeRel
;
cmd
.
param7
=
vehicle
->
homePosition
().
altitud
e
()
+
altitudeRel
;
cmd
.
target_system
=
vehicle
->
id
();
cmd
.
target_component
=
vehicle
->
defaultComponentId
();
...
...
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