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
879e1f6a
Commit
879e1f6a
authored
11 years ago
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #412 from thomasgubler/airspeed_calibration
differential pressure/airspeed calibration ui
parents
74ee8c7c
c086bcbb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
1 deletion
+63
-1
QGCPX4SensorCalibration.cc
src/ui/px4_configuration/QGCPX4SensorCalibration.cc
+39
-0
QGCPX4SensorCalibration.h
src/ui/px4_configuration/QGCPX4SensorCalibration.h
+2
-0
QGCPX4SensorCalibration.ui
src/ui/px4_configuration/QGCPX4SensorCalibration.ui
+22
-1
No files found.
src/ui/px4_configuration/QGCPX4SensorCalibration.cc
View file @
879e1f6a
...
...
@@ -17,6 +17,7 @@ QGCPX4SensorCalibration::QGCPX4SensorCalibration(QWidget *parent) :
connect
(
ui
->
gyroButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
gyroButtonClicked
()));
connect
(
ui
->
magButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
magButtonClicked
()));
connect
(
ui
->
accelButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
accelButtonClicked
()));
connect
(
ui
->
diffPressureButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
diffPressureButtonClicked
()));
ui
->
gyroButton
->
setEnabled
(
false
);
ui
->
magButton
->
setEnabled
(
false
);
...
...
@@ -168,6 +169,17 @@ void QGCPX4SensorCalibration::parameterChanged(int uas, int component, QString p
setAccelCalibrated
(
true
);
}
}
// Check differential pressure calibration naively
if
(
parameterName
.
contains
(
"SENS_DPRES_OFF"
))
{
float
offset
=
value
.
toFloat
();
if
(
offset
<
0.000001
f
&&
offset
>
-
0.000001
f
)
{
// Must be zero, not good
setDiffPressureCalibrated
(
false
);
}
else
{
setDiffPressureCalibrated
(
true
);
}
}
}
void
QGCPX4SensorCalibration
::
setMagCalibrated
(
bool
calibrated
)
...
...
@@ -215,6 +227,21 @@ void QGCPX4SensorCalibration::setAccelCalibrated(bool calibrated)
}
}
void
QGCPX4SensorCalibration
::
setDiffPressureCalibrated
(
bool
calibrated
)
{
if
(
calibrated
)
{
ui
->
diffPressureLabel
->
setText
(
tr
(
"DIFF. PRESSURE CALIBRATED"
));
ui
->
diffPressureLabel
->
setStyleSheet
(
"QLabel { color: #FFFFFF;"
"background-color: #20AA20;"
"}"
);
}
else
{
ui
->
diffPressureLabel
->
setText
(
tr
(
"DIFF. PRESSURE UNCALIBRATED"
));
ui
->
diffPressureLabel
->
setStyleSheet
(
"QLabel { color: #FFFFFF;"
"background-color: #FF0037;"
"}"
);
}
}
void
QGCPX4SensorCalibration
::
setInstructionImage
(
const
QString
&
path
)
{
instructionIcon
.
load
(
path
);
...
...
@@ -384,6 +411,11 @@ void QGCPX4SensorCalibration::handleTextMessage(int uasid, int compId, int sever
activeUAS
->
requestParameter
(
0
,
"SENS_MAG_ZSCALE"
);
activeUAS
->
requestParameter
(
0
,
"SENS_EXT_MAG_ROT"
);
}
if
(
text
.
startsWith
(
"dpress "
))
{
activeUAS
->
requestParameter
(
0
,
"SENS_DPRES_OFF"
);
activeUAS
->
requestParameter
(
0
,
"SENS_DPRES_ANA"
);
}
}
}
...
...
@@ -427,6 +459,13 @@ void QGCPX4SensorCalibration::accelButtonClicked()
ui
->
progressBar
->
setValue
(
0
);
}
void
QGCPX4SensorCalibration
::
diffPressureButtonClicked
()
{
setInstructionImage
(
":/files/images/px4/calibration/accel_z-.png"
);
activeUAS
->
executeCommand
(
MAV_CMD_PREFLIGHT_CALIBRATION
,
1
,
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
,
1.0
f
,
0.0
f
,
0
);
ui
->
progressBar
->
setValue
(
0
);
}
void
QGCPX4SensorCalibration
::
contextMenuEvent
(
QContextMenuEvent
*
event
)
{
QMenu
menu
(
this
);
...
...
This diff is collapsed.
Click to expand it.
src/ui/px4_configuration/QGCPX4SensorCalibration.h
View file @
879e1f6a
...
...
@@ -35,6 +35,7 @@ public slots:
void
gyroButtonClicked
();
void
magButtonClicked
();
void
accelButtonClicked
();
void
diffPressureButtonClicked
();
/**
* @brief Hand context menu event
...
...
@@ -70,6 +71,7 @@ protected:
void
setMagCalibrated
(
bool
calibrated
);
void
setGyroCalibrated
(
bool
calibrated
);
void
setAccelCalibrated
(
bool
calibrated
);
void
setDiffPressureCalibrated
(
bool
calibrated
);
void
updateIcons
();
...
...
This diff is collapsed.
Click to expand it.
src/ui/px4_configuration/QGCPX4SensorCalibration.ui
View file @
879e1f6a
...
...
@@ -25,7 +25,7 @@
border: 2px solid #465158;
}
QPushButton#gyroButton, QPushButton#accelButton {
QPushButton#gyroButton, QPushButton#accelButton
, QPushButton#diffPressureButton
{
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D3795D, stop: 1 #A81154);
border-radius: 8px;
min-height: 25px;
...
...
@@ -121,6 +121,27 @@ QPushButton#gyroButton, QPushButton#accelButton {
</property>
</widget>
</item>
<item
row=
"1"
column=
"3"
>
<widget
class=
"QPushButton"
name=
"diffPressureButton"
>
<property
name=
"text"
>
<string>
Diff. pressure
</string>
</property>
<property
name=
"icon"
>
<iconset
resource=
"../../../qgroundcontrol.qrc"
>
<normaloff>
:/files/images/px4/calibration/arrows.png
</normaloff>
:/files/images/px4/calibration/arrows.png
</iconset>
</property>
</widget>
</item>
<item
row=
"0"
column=
"3"
>
<widget
class=
"QLabel"
name=
"diffPressureLabel"
>
<property
name=
"text"
>
<string/>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
</widget>
</item>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"magLabel"
>
<property
name=
"text"
>
...
...
This diff is collapsed.
Click to expand it.
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