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
8b3ba659
Commit
8b3ba659
authored
Mar 11, 2015
by
Bryant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display the crosstrack error in the HSI widget.
parent
56473f8c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
HSIDisplay.cc
src/ui/HSIDisplay.cc
+20
-2
HSIDisplay.h
src/ui/HSIDisplay.h
+4
-0
No files found.
src/ui/HSIDisplay.cc
View file @
8b3ba659
...
...
@@ -94,6 +94,7 @@ HSIDisplay::HSIDisplay(QWidget *parent) :
uiZSetCoordinate
(
0.0
f
),
uiYawSet
(
0.0
f
),
metricWidth
(
4.0
),
crosstrackError
(
std
::
numeric_limits
<
double
>::
quiet_NaN
()),
xCenterPos
(
0
),
yCenterPos
(
0
),
positionLock
(
false
),
...
...
@@ -412,9 +413,13 @@ void HSIDisplay::renderOverlay()
paintText
(
tr
(
"%1 m/s"
).
arg
(
speed
,
5
,
'f'
,
2
,
'0'
),
valueColor
,
2.2
f
,
12
,
topMargin
+
2
,
&
painter
);
// Draw crosstrack error to top right
float
crossTrackError
=
0
;
paintText
(
tr
(
"XTRACK"
),
labelColor
,
2.2
f
,
54
,
topMargin
+
2
,
&
painter
);
paintText
(
tr
(
"%1 m"
).
arg
(
crossTrackError
,
5
,
'f'
,
2
,
'0'
),
valueColor
,
2.2
f
,
67
,
topMargin
+
2
,
&
painter
);
if
(
!
isnan
(
crosstrackError
))
{
paintText
(
tr
(
"%1 m"
).
arg
(
crosstrackError
,
5
,
'f'
,
2
,
'0'
),
valueColor
,
2.2
f
,
67
,
topMargin
+
2
,
&
painter
);
}
else
{
paintText
(
tr
(
"-- m"
),
valueColor
,
2.2
f
,
67
,
topMargin
+
2
,
&
painter
);
}
// Draw position to bottom left
if
(
localAvailable
>
0
)
...
...
@@ -945,6 +950,8 @@ void HSIDisplay::setActiveUAS(UASInterface* uas)
disconnect
(
this
->
uas
,
SIGNAL
(
laserStatusChanged
(
bool
,
bool
,
bool
)),
this
,
SLOT
(
updateLaserStatus
(
bool
,
bool
,
bool
)));
disconnect
(
this
->
uas
,
SIGNAL
(
groundTruthSensorStatusChanged
(
bool
,
bool
,
bool
)),
this
,
SLOT
(
updateGroundTruthSensorStatus
(
bool
,
bool
,
bool
)));
disconnect
(
this
->
uas
,
SIGNAL
(
actuatorStatusChanged
(
bool
,
bool
,
bool
)),
this
,
SLOT
(
updateActuatorStatus
(
bool
,
bool
,
bool
)));
disconnect
(
this
->
uas
,
&
UASInterface
::
navigationControllerErrorsChanged
,
this
,
&
HSIDisplay
::
UpdateNavErrors
);
}
if
(
uas
)
...
...
@@ -1003,6 +1010,8 @@ void HSIDisplay::setActiveUAS(UASInterface* uas)
this
,
SLOT
(
updateGroundTruthSensorStatus
(
bool
,
bool
,
bool
)));
connect
(
uas
,
SIGNAL
(
actuatorStatusChanged
(
bool
,
bool
,
bool
)),
this
,
SLOT
(
updateActuatorStatus
(
bool
,
bool
,
bool
)));
connect
(
uas
,
&
UASInterface
::
navigationControllerErrorsChanged
,
this
,
&
HSIDisplay
::
UpdateNavErrors
);
statusClearTimer
.
start
(
3000
);
}
else
...
...
@@ -1159,6 +1168,15 @@ void HSIDisplay::updateLocalPosition(UASInterface*, double x, double y, double z
localAvailable
=
usec
;
}
void
HSIDisplay
::
UpdateNavErrors
(
UASInterface
*
uas
,
double
altitudeError
,
double
airspeedError
,
double
crosstrackError
)
{
Q_UNUSED
(
altitudeError
);
Q_UNUSED
(
airspeedError
);
if
(
this
->
uas
==
uas
)
{
this
->
crosstrackError
=
crosstrackError
;
}
}
void
HSIDisplay
::
updateGlobalPosition
(
UASInterface
*
,
double
lat
,
double
lon
,
double
altAMSL
,
double
altWGS84
,
quint64
usec
)
{
Q_UNUSED
(
altAMSL
);
...
...
src/ui/HSIDisplay.h
View file @
8b3ba659
...
...
@@ -62,6 +62,7 @@ public slots:
void
updateLocalPosition
(
UASInterface
*
,
double
x
,
double
y
,
double
z
,
quint64
usec
);
void
updateGlobalPosition
(
UASInterface
*
,
double
lat
,
double
lon
,
double
altAMSL
,
double
altWGS84
,
quint64
usec
);
void
updateSpeed
(
UASInterface
*
uas
,
double
vx
,
double
vy
,
double
vz
,
quint64
time
);
void
UpdateNavErrors
(
UASInterface
*
uas
,
double
altitudeError
,
double
airspeedError
,
double
crosstrackError
);
void
updatePositionLock
(
UASInterface
*
uas
,
bool
lock
);
void
updateAttitudeControllerEnabled
(
bool
enabled
);
void
updatePositionXYControllerEnabled
(
bool
enabled
);
...
...
@@ -341,6 +342,9 @@ protected:
float
uiYawSet
;
///< Yaw Setpoint wanted by the UI
double
metricWidth
;
///< Width the instrument represents in meters (the width of the ground shown by the widget)
// Navigation parameters
double
crosstrackError
;
///< The crosstrack error (m) reported by the UAS
//
float
xCenterPos
;
///< X center of instrument in virtual coordinates
float
yCenterPos
;
///< Y center of instrument in virtual coordinates
...
...
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