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
bbc987bc
Commit
bbc987bc
authored
Jul 08, 2013
by
dongfang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'lorenz/master'
parents
f3793fa1
55f61af4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
4 deletions
+27
-4
QGCXPlaneLink.cc
src/comm/QGCXPlaneLink.cc
+27
-4
No files found.
src/comm/QGCXPlaneLink.cc
View file @
bbc987bc
...
...
@@ -577,8 +577,8 @@ void QGCXPlaneLink::readBytes()
Eigen
::
Vector3f
magbody
=
m
*
mag
;
qDebug
()
<<
"yaw mag:"
<<
p
.
f
[
2
]
<<
"x"
<<
xmag
<<
"y"
<<
ymag
;
qDebug
()
<<
"yaw mag in body:"
<<
magbody
(
0
)
<<
magbody
(
1
)
<<
magbody
(
2
);
//
qDebug() << "yaw mag:" << p.f[2] << "x" << xmag << "y" << ymag;
//
qDebug() << "yaw mag in body:" << magbody(0) << magbody(1) << magbody(2);
xmag
=
magbody
(
0
);
ymag
=
magbody
(
1
);
...
...
@@ -664,8 +664,31 @@ void QGCXPlaneLink::readBytes()
if
(
_sensorHilEnabled
)
{
diff_pressure
=
0.0
f
;
pressure_alt
=
alt
;
diff_pressure
=
(
ind_airspeed
*
ind_airspeed
*
1.225
f
)
/
2.0
f
;
/* tropospheric properties (0-11km) for standard atmosphere */
const
double
T1
=
15.0
+
273.15
;
/* temperature at base height in Kelvin */
const
double
a
=
-
6.5
/
1000
;
/* temperature gradient in degrees per metre */
const
double
g
=
9.80665
;
/* gravity constant in m/s/s */
const
double
R
=
287.05
;
/* ideal gas constant in J/kg/K */
/* current pressure at MSL in kPa */
double
p1
=
1013.25
/
10.0
;
/* measured pressure in hPa */
double
p
=
abs_pressure
/
10.0
;
/*
* Solve:
*
* / -(aR / g) \
* | (p / p1) . T1 | - T1
* \ /
* h = ------------------------------- + h1
* a
*/
pressure_alt
=
(((
pow
((
p
/
p1
),
(
-
(
a
*
R
)
/
g
)))
*
T1
)
-
T1
)
/
a
;
// set pressure alt to changed
fields_changed
|=
(
1
<<
11
);
...
...
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