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
3b341f01
Commit
3b341f01
authored
Mar 11, 2015
by
Bryant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable the CDI display for the PFD widget.
parent
f8195186
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
2 deletions
+18
-2
UAS.cc
src/uas/UAS.cc
+1
-0
UASInterface.h
src/uas/UASInterface.h
+1
-0
PrimaryFlightDisplay.cc
src/ui/PrimaryFlightDisplay.cc
+15
-2
PrimaryFlightDisplay.h
src/ui/PrimaryFlightDisplay.h
+1
-0
No files found.
src/uas/UAS.cc
View file @
3b341f01
...
...
@@ -1342,6 +1342,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
setDistToWaypoint
(
p
.
wp_dist
);
setBearingToWaypoint
(
p
.
nav_bearing
);
emit
navigationControllerErrorsChanged
(
this
,
p
.
alt_error
,
p
.
aspd_error
,
p
.
xtrack_error
);
emit
NavigationControllerDataChanged
(
this
,
p
.
nav_roll
,
p
.
nav_pitch
,
p
.
nav_bearing
,
p
.
target_bearing
,
p
.
wp_dist
);
}
break
;
// Messages to ignore
...
...
src/uas/UASInterface.h
View file @
3b341f01
...
...
@@ -544,6 +544,7 @@ signals:
void
velocityChanged_NED
(
UASInterface
*
,
double
vx
,
double
vy
,
double
vz
,
quint64
usec
);
void
navigationControllerErrorsChanged
(
UASInterface
*
,
double
altitudeError
,
double
speedError
,
double
xtrackError
);
void
NavigationControllerDataChanged
(
UASInterface
*
uas
,
float
navRoll
,
float
navPitch
,
float
navBearing
,
float
targetBearing
,
float
targetDist
);
void
imageStarted
(
int
imgid
,
int
width
,
int
height
,
int
depth
,
int
channels
);
void
imageDataReceived
(
int
imgid
,
const
unsigned
char
*
imageData
,
int
length
,
int
startIndex
);
...
...
src/ui/PrimaryFlightDisplay.cc
View file @
3b341f01
...
...
@@ -121,7 +121,7 @@ PrimaryFlightDisplay::PrimaryFlightDisplay(QWidget *parent) :
airSpeed
(
std
::
numeric_limits
<
double
>::
quiet_NaN
()),
climbRate
(
std
::
numeric_limits
<
double
>::
quiet_NaN
()),
navigationCrosstrackError
(
0
),
navigationCrosstrackError
(
std
::
numeric_limits
<
double
>::
quiet_NaN
()
),
navigationTargetBearing
(
std
::
numeric_limits
<
double
>::
quiet_NaN
()),
layout
(
COMPASS_INTEGRATED
),
...
...
@@ -221,6 +221,7 @@ void PrimaryFlightDisplay::forgetUAS(UASInterface* uas)
disconnect
(
this
->
uas
,
SIGNAL
(
speedChanged
(
UASInterface
*
,
double
,
double
,
quint64
)),
this
,
SLOT
(
updateSpeed
(
UASInterface
*
,
double
,
double
,
quint64
)));
disconnect
(
this
->
uas
,
SIGNAL
(
altitudeChanged
(
UASInterface
*
,
double
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
updateAltitude
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
disconnect
(
this
->
uas
,
SIGNAL
(
navigationControllerErrorsChanged
(
UASInterface
*
,
double
,
double
,
double
)),
this
,
SLOT
(
updateNavigationControllerErrors
(
UASInterface
*
,
double
,
double
,
double
)));
disconnect
(
this
->
uas
,
&
UASInterface
::
NavigationControllerDataChanged
,
this
,
&
PrimaryFlightDisplay
::
UpdateNavigationControllerData
);
}
}
...
...
@@ -244,6 +245,7 @@ void PrimaryFlightDisplay::setActiveUAS(UASInterface* uas)
connect
(
uas
,
SIGNAL
(
speedChanged
(
UASInterface
*
,
double
,
double
,
quint64
)),
this
,
SLOT
(
updateSpeed
(
UASInterface
*
,
double
,
double
,
quint64
)));
connect
(
uas
,
SIGNAL
(
altitudeChanged
(
UASInterface
*
,
double
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
updateAltitude
(
UASInterface
*
,
double
,
double
,
double
,
double
,
quint64
)));
connect
(
uas
,
SIGNAL
(
navigationControllerErrorsChanged
(
UASInterface
*
,
double
,
double
,
double
)),
this
,
SLOT
(
updateNavigationControllerErrors
(
UASInterface
*
,
double
,
double
,
double
)));
connect
(
uas
,
&
UASInterface
::
NavigationControllerDataChanged
,
this
,
&
PrimaryFlightDisplay
::
UpdateNavigationControllerData
);
// Set new UAS
this
->
uas
=
uas
;
...
...
@@ -346,6 +348,16 @@ void PrimaryFlightDisplay::updateAltitude(UASInterface* uas, double _altitudeAMS
climbRate
=
_climbRate
;
}
void
PrimaryFlightDisplay
::
UpdateNavigationControllerData
(
UASInterface
*
uas
,
float
navRoll
,
float
navPitch
,
float
navBearing
,
float
targetBearing
,
float
targetDistance
)
{
Q_UNUSED
(
navRoll
);
Q_UNUSED
(
navPitch
);
Q_UNUSED
(
navBearing
);
Q_UNUSED
(
targetDistance
);
if
(
this
->
uas
==
uas
)
{
this
->
navigationTargetBearing
=
targetBearing
;
}
}
void
PrimaryFlightDisplay
::
updateNavigationControllerErrors
(
UASInterface
*
uas
,
double
altitudeError
,
double
speedError
,
double
xtrackError
)
{
Q_UNUSED
(
uas
);
this
->
navigationAltitudeError
=
altitudeError
;
...
...
@@ -862,7 +874,8 @@ void PrimaryFlightDisplay::drawAICompassDisk(QPainter& painter, QRectF area, flo
drawTextCenter
(
painter
,
s_digitalCompass
,
largeTextSize
,
0
,
-
radius
*
0.38
-
digitalCompassUpshift
);
// The CDI
if
(
shouldDisplayNavigationData
()
&&
!
isnan
(
navigationTargetBearing
)
&&
!
isinf
(
navigationCrosstrackError
))
{
// We only display this navigation data if both the target bearing and crosstrack error are valid
if
(
shouldDisplayNavigationData
()
&&
!
isnan
(
navigationTargetBearing
)
&&
!
isnan
(
navigationCrosstrackError
))
{
painter
.
resetTransform
();
painter
.
translate
(
area
.
center
());
// TODO : Sign might be wrong?
...
...
src/ui/PrimaryFlightDisplay.h
View file @
3b341f01
...
...
@@ -21,6 +21,7 @@ public slots:
void
updateSpeed
(
UASInterface
*
uas
,
double
_groundSpeed
,
double
_airSpeed
,
quint64
timestamp
);
void
updateAltitude
(
UASInterface
*
uas
,
double
_altitudeAMSL
,
double
_altitudeWGS84
,
double
_altitudeRelative
,
double
_climbRate
,
quint64
timestamp
);
void
updateNavigationControllerErrors
(
UASInterface
*
uas
,
double
altitudeError
,
double
speedError
,
double
xtrackError
);
void
UpdateNavigationControllerData
(
UASInterface
*
uas
,
float
navRoll
,
float
navPitch
,
float
navBearing
,
float
targetBearing
,
float
targetDistance
);
/** @brief Set the currently monitored UAS */
void
forgetUAS
(
UASInterface
*
uas
);
...
...
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