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
927c066e
Commit
927c066e
authored
Feb 19, 2012
by
Bryant Mairs
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/mavlink/qgroundcontrol
parents
93821e15
deddf85c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
+38
-0
UAS.cc
src/uas/UAS.cc
+18
-0
HSIDisplay.cc
src/ui/HSIDisplay.cc
+20
-0
No files found.
src/uas/UAS.cc
View file @
927c066e
...
@@ -451,6 +451,14 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
...
@@ -451,6 +451,14 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
stopLowBattAlarm
();
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
// 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
// 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
// percentage as a float. We also cap the incoming value at 100% as defined
...
@@ -580,6 +588,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
...
@@ -580,6 +588,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
speedZ
=
pos
.
vz
/
100.0
;
speedZ
=
pos
.
vz
/
100.0
;
emit
globalPositionChanged
(
this
,
latitude
,
longitude
,
altitude
,
time
);
emit
globalPositionChanged
(
this
,
latitude
,
longitude
,
altitude
,
time
);
emit
speedChanged
(
this
,
speedX
,
speedY
,
speedZ
,
time
);
emit
speedChanged
(
this
,
speedX
,
speedY
,
speedZ
,
time
);
// Set internal state
// Set internal state
if
(
!
positionLock
)
if
(
!
positionLock
)
{
{
...
@@ -601,6 +610,15 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
...
@@ -601,6 +610,15 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
// only accept values in a realistic range
// only accept values in a realistic range
// quint64 time = getUnixTime(pos.time_usec);
// quint64 time = getUnixTime(pos.time_usec);
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
)
if
(
pos
.
fix_type
>
2
)
{
{
...
...
src/ui/HSIDisplay.cc
View file @
927c066e
...
@@ -472,25 +472,45 @@ void HSIDisplay::drawPositionLock(float x, float y, QString label, int status, b
...
@@ -472,25 +472,45 @@ void HSIDisplay::drawPositionLock(float x, float y, QString label, int status, b
void
HSIDisplay
::
updatePositionLock
(
UASInterface
*
uas
,
bool
lock
)
void
HSIDisplay
::
updatePositionLock
(
UASInterface
*
uas
,
bool
lock
)
{
{
Q_UNUSED
(
uas
);
Q_UNUSED
(
uas
);
bool
changed
=
positionLock
!=
lock
;
positionLock
=
lock
;
positionLock
=
lock
;
if
(
changed
)
{
update
();
}
}
}
void
HSIDisplay
::
updateAttitudeControllerEnabled
(
bool
enabled
)
void
HSIDisplay
::
updateAttitudeControllerEnabled
(
bool
enabled
)
{
{
bool
changed
=
attControlEnabled
!=
enabled
;
attControlEnabled
=
enabled
;
attControlEnabled
=
enabled
;
attControlKnown
=
true
;
attControlKnown
=
true
;
if
(
changed
)
{
update
();
}
}
}
void
HSIDisplay
::
updatePositionXYControllerEnabled
(
bool
enabled
)
void
HSIDisplay
::
updatePositionXYControllerEnabled
(
bool
enabled
)
{
{
bool
changed
=
xyControlEnabled
!=
enabled
;
xyControlEnabled
=
enabled
;
xyControlEnabled
=
enabled
;
xyControlKnown
=
true
;
xyControlKnown
=
true
;
if
(
changed
)
{
update
();
}
}
}
void
HSIDisplay
::
updatePositionZControllerEnabled
(
bool
enabled
)
void
HSIDisplay
::
updatePositionZControllerEnabled
(
bool
enabled
)
{
{
bool
changed
=
zControlEnabled
!=
enabled
;
zControlEnabled
=
enabled
;
zControlEnabled
=
enabled
;
zControlKnown
=
true
;
zControlKnown
=
true
;
if
(
changed
)
{
update
();
}
}
}
void
HSIDisplay
::
updateObjectPosition
(
unsigned
int
time
,
int
id
,
int
type
,
const
QString
&
name
,
int
quality
,
float
bearing
,
float
distance
)
void
HSIDisplay
::
updateObjectPosition
(
unsigned
int
time
,
int
id
,
int
type
,
const
QString
&
name
,
int
quality
,
float
bearing
,
float
distance
)
...
...
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