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
85e653ee
Commit
85e653ee
authored
Aug 27, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup of calibration UI
parent
c07de6fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
43 deletions
+64
-43
QGCPX4SensorCalibration.cc
src/ui/px4_configuration/QGCPX4SensorCalibration.cc
+43
-15
QGCPX4SensorCalibration.ui
src/ui/px4_configuration/QGCPX4SensorCalibration.ui
+21
-28
No files found.
src/ui/px4_configuration/QGCPX4SensorCalibration.cc
View file @
85e653ee
...
...
@@ -90,6 +90,10 @@ void QGCPX4SensorCalibration::setActiveUAS(UASInterface* uas)
void
QGCPX4SensorCalibration
::
handleTextMessage
(
int
uasid
,
int
compId
,
int
severity
,
QString
text
)
{
Q_UNUSED
(
uasid
);
Q_UNUSED
(
compId
);
Q_UNUSED
(
severity
);
if
(
text
.
startsWith
(
"[cmd]"
)
||
text
.
startsWith
(
"[mavlink pm]"
))
return
;
...
...
@@ -105,38 +109,51 @@ void QGCPX4SensorCalibration::handleTextMessage(int uasid, int compId, int sever
return
;
}
ui
->
instructionLabel
->
setText
(
QString
(
"%1"
).
arg
(
text
));
if
(
text
.
contains
(
"accel"
))
{
qDebug
()
<<
"ACCEL"
<<
text
;
if
(
text
.
startsWith
(
"accel meas started: "
))
{
QString
axis
=
text
.
split
(
"meas
started: "
).
last
().
righ
t
(
2
);
if
(
text
.
startsWith
(
"accel meas
urement
started: "
))
{
QString
axis
=
text
.
split
(
"meas
urement started: "
).
last
().
lef
t
(
2
);
qDebug
()
<<
"AXIS"
<<
axis
<<
"STR"
<<
text
;
setInstructionImage
(
QString
(
":/files/images/px4/calibration/accel_%1.png"
).
arg
(
axis
));
}
}
if
(
text
.
startsWith
(
"meas result for"
))
{
if
(
text
.
startsWith
(
"directions left"
))
{
for
(
int
i
=
0
;
i
<
6
;
i
++
)
{
if
(
!
text
.
contains
(
accelAxes
[
i
]))
{
qDebug
()
<<
"FINISHED"
<<
accelAxes
[
i
];
accelDone
[
i
]
=
true
;
}
}
}
if
(
text
.
startsWith
(
"result for"
))
{
QString
axis
=
text
.
split
(
"
meas
result for "
).
last
().
left
(
2
);
QString
axis
=
text
.
split
(
"result for "
).
last
().
left
(
2
);
qDebug
()
<<
"ACCELDONE AXIS"
<<
axis
<<
"STR"
<<
text
;
for
(
int
i
=
0
;
i
<
6
;
i
++
)
{
if
(
a
ccelAxes
[
i
]
==
axis
)
if
(
a
xis
==
accelAxes
[
i
]
)
accelDone
[
i
]
=
true
;
if
(
!
accelDone
[
i
])
{
qDebug
()
<<
"NEW AXIS: "
<<
accelAxes
[
i
];
setInstructionImage
(
QString
(
":/files/images/px4/calibration/accel_%1.png"
).
arg
(
accelAxes
[
i
]));
ui
->
calibrationExplanationLabel
->
setText
(
tr
(
"Axis %1 completed. Please rotate to a different axis, e.g. the one shown here."
).
arg
(
axis
));
ui
->
instructionLabel
->
setText
(
tr
(
"Axis %1 completed. Please rotate like shown here."
).
arg
(
axis
));
break
;
}
}
}
if
(
text
.
contains
(
"please rotate in a figure 8"
))
{
ui
->
calibrationExplanationLabel
->
setText
(
tr
(
"Rotate the system around all its axes, e.g. in a figure eight."
));
setInstructionImage
(
":/files/images/px4/calibration/mag_calibration_figure8.png"
);
}
...
...
@@ -144,24 +161,35 @@ void QGCPX4SensorCalibration::handleTextMessage(int uasid, int compId, int sever
accelStarted
=
false
;
// XXX use a confirmation image or something
setInstructionImage
(
":/files/images/px4/calibration/accel_z-.png"
);
ui
->
calibrationExplanationLabel
->
setText
(
tr
(
"Accelerometer calibration completed. Parameters permanently stored."
));
}
if
(
text
.
contains
(
"gyro calibration done"
))
{
gyroStarted
=
false
;
// XXX use a confirmation image or something
setInstructionImage
(
":/files/images/px4/calibration/accel_z-.png"
);
ui
->
calibrationExplanationLabel
->
setText
(
tr
(
"Gyroscope calibration completed. Parameters permanently stored."
));
}
if
(
text
.
contains
(
"mag calibration done"
))
{
if
(
text
.
contains
(
"mag calibration done"
)
||
text
.
contains
(
"magnetometer calibration completed"
))
{
magStarted
=
false
;
// XXX use a confirmation image or something
setInstructionImage
(
":/files/images/px4/calibration/accel_z-.png"
);
ui
->
calibrationExplanationLabel
->
setText
(
tr
(
"Magnetometer calibration completed. Parameters permanently stored."
));
}
ui
->
instructionLabel
->
setText
(
QString
(
"%1"
).
arg
(
text
));
if
(
text
.
contains
(
"accel calibration started"
))
{
accelStarted
=
true
;
setInstructionImage
(
":/files/images/px4/calibration/accel_z-.png"
);
}
if
(
text
.
contains
(
"gyro calibration started"
))
{
gyroStarted
=
true
;
setInstructionImage
(
":/files/images/px4/calibration/accel_z-.png"
);
}
if
(
text
.
contains
(
"mag calibration started"
))
{
magStarted
=
false
;
setInstructionImage
(
":/files/images/px4/calibration/accel_z-.png"
);
}
// XXX color messages according to severity
...
...
@@ -184,7 +212,7 @@ void QGCPX4SensorCalibration::gyroButtonClicked()
setInstructionImage
(
":/files/images/px4/calibration/accel_z-.png"
);
activeUAS
->
executeCommand
(
MAV_CMD_PREFLIGHT_CALIBRATION
,
1
,
1.0
f
,
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
,
0
);
ui
->
progressBar
->
setValue
(
0
);
ui
->
calibrationExplanationLabel
->
setText
(
tr
(
"Please do not move the system at all and wait for calibration to complete
."
));
ui
->
instructionLabel
->
setText
(
tr
(
"Please do not move the system at all
."
));
}
void
QGCPX4SensorCalibration
::
magButtonClicked
()
...
...
@@ -192,7 +220,7 @@ void QGCPX4SensorCalibration::magButtonClicked()
setInstructionImage
(
":/files/images/px4/calibration/accel_z-.png"
);
activeUAS
->
executeCommand
(
MAV_CMD_PREFLIGHT_CALIBRATION
,
1
,
0.0
f
,
1.0
f
,
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
,
0
);
ui
->
progressBar
->
setValue
(
0
);
ui
->
calibrationExplanationLabel
->
setText
(
tr
(
"Please put the system in a rest position and wait for instructions
."
));
ui
->
instructionLabel
->
setText
(
tr
(
"Please put the system in a rest position
."
));
}
void
QGCPX4SensorCalibration
::
accelButtonClicked
()
...
...
@@ -208,7 +236,7 @@ void QGCPX4SensorCalibration::accelButtonClicked()
accelDone
[
4
]
=
false
;
accelDone
[
5
]
=
false
;
ui
->
calibrationExplanationLabel
->
setText
(
tr
(
"Please hold the system very still in the shown orientations. Start with the one shown
."
));
ui
->
instructionLabel
->
setText
(
tr
(
"Please hold the system very still in the shown orientations
."
));
}
void
QGCPX4SensorCalibration
::
contextMenuEvent
(
QContextMenuEvent
*
event
)
...
...
src/ui/px4_configuration/QGCPX4SensorCalibration.ui
View file @
85e653ee
...
...
@@ -36,29 +36,29 @@ QPushButton#gyroButton, QPushButton#accelButton {
border: 2px solid #465158;
}
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
rowstretch=
"1,
20,3,2,1,1,0"
columnstretch=
"30,15,5
"
>
<item
row=
"
6"
column=
"2
"
>
<spacer
name=
"
horizont
alSpacer"
>
<layout
class=
"QGridLayout"
name=
"gridLayout"
rowstretch=
"1,
0,0,0,0,0,0"
columnstretch=
"30,0,0
"
>
<item
row=
"
4"
column=
"0"
colspan=
"3
"
>
<spacer
name=
"
vertic
alSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::
Horizont
al
</enum>
<enum>
Qt::
Vertic
al
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
4
0
</width>
<height>
2
0
</height>
<width>
4
98
</width>
<height>
2
1
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"
4"
column=
"0"
colspan=
"3
"
>
<spacer
name=
"
vertic
alSpacer"
>
<item
row=
"
6"
column=
"2
"
>
<spacer
name=
"
horizont
alSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::
Vertic
al
</enum>
<enum>
Qt::
Horizont
al
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
4
98
</width>
<height>
2
1
</height>
<width>
4
0
</width>
<height>
2
0
</height>
</size>
</property>
</spacer>
...
...
@@ -70,16 +70,6 @@ QPushButton#gyroButton, QPushButton#accelButton {
</property>
</widget>
</item>
<item
row=
"5"
column=
"0"
colspan=
"3"
>
<widget
class=
"QProgressBar"
name=
"progressBar"
>
<property
name=
"value"
>
<number>
24
</number>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
rowspan=
"2"
colspan=
"2"
>
<widget
class=
"QPlainTextEdit"
name=
"textView"
/>
</item>
<item
row=
"6"
column=
"0"
colspan=
"2"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<item>
...
...
@@ -117,13 +107,6 @@ QPushButton#gyroButton, QPushButton#accelButton {
</item>
</layout>
</item>
<item
row=
"2"
column=
"0"
colspan=
"3"
>
<widget
class=
"QLabel"
name=
"calibrationExplanationLabel"
>
<property
name=
"text"
>
<string>
To calibrate the system, execute the three calibration steps below.
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"0"
rowspan=
"2"
>
<widget
class=
"QLabel"
name=
"iconLabel"
>
<property
name=
"text"
>
...
...
@@ -134,6 +117,16 @@ QPushButton#gyroButton, QPushButton#accelButton {
</property>
</widget>
</item>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QProgressBar"
name=
"progressBar"
>
<property
name=
"value"
>
<number>
24
</number>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
rowspan=
"3"
colspan=
"2"
>
<widget
class=
"QPlainTextEdit"
name=
"textView"
/>
</item>
</layout>
</widget>
<resources>
...
...
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