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
ed692bfd
Commit
ed692bfd
authored
Feb 19, 2011
by
lm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reading out heading from VFR_HUD
parent
c6c70beb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
UAS.cc
src/uas/UAS.cc
+11
-1
UAS.h
src/uas/UAS.h
+2
-0
No files found.
src/uas/UAS.cc
View file @
ed692bfd
...
...
@@ -72,7 +72,8 @@ pitch(0.0),
yaw
(
0.0
),
statusTimeout
(
new
QTimer
(
this
)),
paramsOnceRequested
(
false
),
airframe
(
0
)
airframe
(
0
),
attitudeKnown
(
false
)
{
color
=
UASInterface
::
getNextColor
();
setBattery
(
LIPOLY
,
3
);
...
...
@@ -448,6 +449,8 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
compass
-=
360.0
f
;
}
attitudeKnown
=
true
;
emit
valueChanged
(
uasId
,
"roll deg"
,
"deg"
,
(
roll
/
M_PI
)
*
180.0
,
time
);
emit
valueChanged
(
uasId
,
"pitch deg"
,
"deg"
,
(
pitch
/
M_PI
)
*
180.0
,
time
);
emit
valueChanged
(
uasId
,
"heading deg"
,
"deg"
,
compass
,
time
);
...
...
@@ -472,6 +475,13 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
emit
valueChanged
(
uasId
,
"climbrate"
,
"m/s"
,
hud
.
climb
,
time
);
emit
valueChanged
(
uasId
,
"throttle"
,
"%"
,
hud
.
throttle
,
time
);
emit
thrustChanged
(
this
,
hud
.
throttle
/
100.0
);
if
(
!
attitudeKnown
)
{
yaw
=
QGC
::
limitAngleToPMPId
((((
double
)
hud
.
heading
-
180.0
)
/
360.0
)
*
M_PI
);
emit
attitudeChanged
(
this
,
roll
,
pitch
,
yaw
,
time
);
}
emit
altitudeChanged
(
uasId
,
hud
.
alt
);
//yaw = (hud.heading-180.0f/360.0f)*M_PI;
//emit attitudeChanged(this, roll, pitch, yaw, getUnixTime());
...
...
src/uas/UAS.h
View file @
ed692bfd
...
...
@@ -175,6 +175,8 @@ protected: //COMMENTS FOR TEST UNIT
QMap
<
int
,
QMap
<
QString
,
float
>*
>
parameters
;
///< All parameters
bool
paramsOnceRequested
;
///< If the parameter list has been read at least once
int
airframe
;
///< The airframe type
bool
attitudeKnown
;
///< True if attitude was received, false else
public:
/** @brief Set the current battery type */
void
setBattery
(
BatteryType
type
,
int
cells
);
...
...
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