Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
6411609d
Commit
6411609d
authored
Feb 19, 2012
by
TobiasSimon
Browse files
Added emits for gps and controller flags in HSI window
parent
9cebfd49
Changes
2
Show whitespace changes
Inline
Side-by-side
src/uas/UAS.cc
View file @
6411609d
...
...
@@ -450,6 +450,14 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
stopLowBattAlarm
();
}
// control_sensors_enabled:
// relevant bits: 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control
emit
attitudeControlEnabled
(
state
.
onboard_control_sensors_enabled
&
(
1
<<
11
));
emit
positionYawControlEnabled
(
state
.
onboard_control_sensors_enabled
&
(
1
<<
12
));
emit
positionZControlEnabled
(
state
.
onboard_control_sensors_enabled
&
(
1
<<
13
));
emit
positionXYControlEnabled
(
state
.
onboard_control_sensors_enabled
&
(
1
<<
14
));
// Trigger drop rate updates as needed. Here we convert the incoming
// drop_rate_comm value from 1/100 of a percent in a uint16 to a true
// percentage as a float. We also cap the incoming value at 100% as defined
...
...
@@ -579,6 +587,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
speedZ
=
pos
.
vz
/
100.0
;
emit
globalPositionChanged
(
this
,
latitude
,
longitude
,
altitude
,
time
);
emit
speedChanged
(
this
,
speedX
,
speedY
,
speedZ
,
time
);
// Set internal state
if
(
!
positionLock
)
{
...
...
@@ -601,6 +610,15 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
// quint64 time = getUnixTime(pos.time_usec);
quint64
time
=
getUnixTime
(
pos
.
time_usec
);
emit
gpsLocalizationChanged
(
this
,
pos
.
fix_type
);
// TODO: track localization state not only for gps but also for other loc. sources
int
loc_type
=
pos
.
fix_type
;
if
(
loc_type
==
1
)
{
loc_type
=
0
;
}
emit
localizationChanged
(
this
,
loc_type
);
if
(
pos
.
fix_type
>
2
)
{
emit
globalPositionChanged
(
this
,
pos
.
lat
/
(
double
)
1E7
,
pos
.
lon
/
(
double
)
1E7
,
pos
.
alt
/
1000.0
,
time
);
...
...
src/ui/HSIDisplay.cc
View file @
6411609d
...
...
@@ -472,25 +472,45 @@ void HSIDisplay::drawPositionLock(float x, float y, QString label, int status, b
void
HSIDisplay
::
updatePositionLock
(
UASInterface
*
uas
,
bool
lock
)
{
Q_UNUSED
(
uas
);
bool
changed
=
positionLock
!=
lock
;
positionLock
=
lock
;
if
(
changed
)
{
update
();
}
}
void
HSIDisplay
::
updateAttitudeControllerEnabled
(
bool
enabled
)
{
bool
changed
=
attControlEnabled
!=
enabled
;
attControlEnabled
=
enabled
;
attControlKnown
=
true
;
if
(
changed
)
{
update
();
}
}
void
HSIDisplay
::
updatePositionXYControllerEnabled
(
bool
enabled
)
{
bool
changed
=
xyControlEnabled
!=
enabled
;
xyControlEnabled
=
enabled
;
xyControlKnown
=
true
;
if
(
changed
)
{
update
();
}
}
void
HSIDisplay
::
updatePositionZControllerEnabled
(
bool
enabled
)
{
bool
changed
=
zControlEnabled
!=
enabled
;
zControlEnabled
=
enabled
;
zControlKnown
=
true
;
if
(
changed
)
{
update
();
}
}
void
HSIDisplay
::
updateObjectPosition
(
unsigned
int
time
,
int
id
,
int
type
,
const
QString
&
name
,
int
quality
,
float
bearing
,
float
distance
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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