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
ca2d4a91
Commit
ca2d4a91
authored
Dec 24, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working Safety Component setup
parent
2f73dea3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
101 additions
and
40 deletions
+101
-40
qgroundcontrol.qrc
qgroundcontrol.qrc
+2
-0
ParameterFactMetaData.xml
src/AutoPilotPlugins/PX4/ParameterFactMetaData.xml
+2
-1
SafetyComponent.cc
src/AutoPilotPlugins/PX4/SafetyComponent.cc
+14
-34
SafetyComponent.qml
src/AutoPilotPlugins/PX4/SafetyComponent.qml
+83
-5
No files found.
qgroundcontrol.qrc
View file @
ca2d4a91
...
...
@@ -244,12 +244,14 @@
<file alias="QGroundControl/FactControls/SetupButton.qml">qml/QGroundControl/FactControls/SetupButton.qml</file>
<file alias="QGroundControl/FactControls/FactLabel.qml">qml/QGroundControl/FactControls/FactLabel.qml</file>
<file alias="QGroundControl/FactControls/FactTextField.qml">qml/QGroundControl/FactControls/FactTextField.qml</file>
<file alias="QGroundControl/FactControls/FactCheckBox.qml">qml/QGroundControl/FactControls/FactCheckBox.qml</file>
<file alias="octo_x.png">files/images/px4/airframes/octo_x.png</file>
<file alias="px4fmu_2.x.png">files/images/px4/boards/px4fmu_2.x.png</file>
<file alias="SetupViewConnected.qml">src/VehicleSetup/SetupViewConnected.qml</file>
<file alias="SetupViewDisconnected.qml">src/VehicleSetup/SetupViewDisconnected.qml</file>
<file alias="SetupPane.qml">src/VehicleSetup/SetupPane.qml</file>
<file alias="SafetyComponent.qml">src/AutoPilotPlugins/PX4/SafetyComponent.qml</file>
</qresource>
...
...
src/AutoPilotPlugins/PX4/ParameterFactMetaData.xml
View file @
ca2d4a91
...
...
@@ -159,6 +159,7 @@
<default>
2
</default>
<min>
0
</min>
<max>
1000
</max>
<unit>
timeouts
</unit>
</parameter>
<parameter
name=
"NAV_DLL_CHSK"
type=
"INT32"
>
<short_desc>
Skip comms hold wp
</short_desc>
...
...
@@ -2041,7 +2042,7 @@
<default>
0.5
</default>
<min>
0
</min>
<max>
35
</max>
<unit>
second
</unit>
<unit>
second
s
</unit>
</parameter>
</group>
<group
name=
"mTECS"
>
...
...
src/AutoPilotPlugins/PX4/SafetyComponent.cc
View file @
ca2d4a91
...
...
@@ -102,55 +102,35 @@ QWidget* SafetyComponent::setupWidget(void) const
const
QVariantList
&
SafetyComponent
::
summaryItems
(
void
)
{
// FIXME: No summary items yet
#if 0
if
(
!
_summaryItems
.
count
())
{
QString
name
;
QString
state
;
// FIXME: Need to pull receiver type from RSSI value
name = "Receiver type:";
state = "n/a";
name
=
"RTL min alt:"
;
VehicleComponentSummaryItem
*
item
=
new
VehicleComponentSummaryItem
(
name
,
state
,
this
);
_summaryItems
.
append
(
QVariant
::
fromValue
(
item
));
static const char* stickParams[] = { "RC_MAP_ROLL", "RC_MAP_PITCH", "RC_MAP_YAW", "RC_MAP_THROTTLE" }
;
name
=
"RTL home alt:"
;
QString summary("Chan ");
item
=
new
VehicleComponentSummaryItem
(
name
,
state
,
this
);
_summaryItems
.
append
(
QVariant
::
fromValue
(
item
));
name
=
"RTL home loiter:"
;
item
=
new
VehicleComponentSummaryItem
(
name
,
state
,
this
);
_summaryItems
.
append
(
QVariant
::
fromValue
(
item
));
bool allSticksMapped = true;
for (size_t i=0; i<sizeof(stickParams)/sizeof(stickParams[0]); i++) {
QVariant value;
if (_paramMgr->getParameterValue(_paramMgr->getDefaultComponentId(), stickParams[i], value)) {
if (value.toInt() == 0) {
allSticksMapped = false;
break;
} else {
if (i != 0) {
summary += ",";
}
summary += value.toString();
}
} else {
// Why is the parameter missing?
Q_ASSERT(false);
summary += "?";
}
}
name
=
"Telemetry loss RTL:"
;
if (!allSticksMapped) {
summary = "Not mapped";
}
name = "Ail, Ele, Rud, Throt:";
state = summary;
item
=
new
VehicleComponentSummaryItem
(
name
,
state
,
this
);
_summaryItems
.
append
(
QVariant
::
fromValue
(
item
));
name
=
"RC loss RTL:"
;
item
=
new
VehicleComponentSummaryItem
(
name
,
state
,
this
);
_summaryItems
.
append
(
QVariant
::
fromValue
(
item
));
}
#endif
return
_summaryItems
;
}
src/AutoPilotPlugins/PX4/SafetyComponent.qml
View file @
ca2d4a91
...
...
@@ -7,14 +7,92 @@ import QGroundControl.FactControls 1.0
Rectangle
{
QGCPalette
{
id
:
palette
;
colorGroup
:
QGCPalette
.
Active
}
width
:
4
00
width
:
6
00
height
:
400
color
:
palette
.
window
Column
{
Label
{
text
:
"
Work in Progress
"
;
color
:
palette
.
windowText
}
Label
{
text
:
"
Return to Land Altitude
"
;
color
:
palette
.
windowText
}
FactLabel
{
fact
:
autopilot
.
parameters
[
"
RTL_RETURN_ALT
"
]
}
FactTextField
{
fact
:
autopilot
.
parameters
[
"
RTL_RETURN_ALT
"
]
}
anchors.fill
:
parent
spacing
:
20
Column
{
spacing
:
10
Label
{
text
:
"
Return to Land setup
"
;
color
:
palette
.
windowText
;
font.pointSize
:
20
}
Row
{
Label
{
text
:
"
Climb to minimum altitude of
"
;
color
:
palette
.
windowText
;
anchors.baseline
:
climbField
.
baseline
}
FactTextField
{
id
:
climbField
;
fact
:
autopilot
.
parameters
[
"
RTL_RETURN_ALT
"
];
showUnits
:
true
}
}
Row
{
Label
{
text
:
"
When Home is reached, descend to altitude of
"
;
color
:
palette
.
windowText
;
anchors.baseline
:
descendField
.
baseline
}
FactTextField
{
id
:
descendField
;
fact
:
autopilot
.
parameters
[
"
RTL_DESCEND_ALT
"
];
showUnits
:
true
}
}
Row
{
CheckBox
{
id
:
homeLoiterCheckbox
property
Fact
fact
:
autopilot
.
parameters
[
"
RTL_LAND_DELAY
"
]
checked
:
fact
.
value
<
0
text
:
"
Loiter at Home altitude for
"
onClicked
:
{
fact
.
value
=
checked
?
60
:
-
1
}
style
:
CheckBoxStyle
{
label
:
Text
{
color
:
palette
.
windowText
text
:
control
.
text
}
}
}
FactTextField
{
fact
:
autopilot
.
parameters
[
"
RTL_LAND_DELAY
"
];
showUnits
:
true
anchors.baseline
:
homeLoiterCheckbox
.
baseline
}
}
}
Column
{
spacing
:
10
Label
{
text
:
"
Return to Land Triggers
"
;
color
:
palette
.
windowText
;
font.pointSize
:
20
}
Row
{
FactCheckBox
{
id
:
telemetryLossCheckbox
fact
:
autopilot
.
parameters
[
"
COM_DL_LOSS_EN
"
]
checkedValue
:
1
uncheckedValue
:
0
text
:
"
Telemetry signal timeout - Return to Land
"
anchors.baseline
:
telemetryLossField
.
baseline
}
Label
{
text
:
"
after
"
;
color
:
palette
.
windowText
;
anchors.baseline
:
telemetryLossField
.
baseline
}
FactTextField
{
id
:
telemetryLossField
fact
:
autopilot
.
parameters
[
"
NAV_DLL_N
"
];
showUnits
:
true
}
}
Row
{
Label
{
text
:
"
RC Transmitter signal loss - Return to Land after
"
;
color
:
palette
.
windowText
;
anchors.baseline
:
rcLossField
.
baseline
}
FactTextField
{
id
:
rcLossField
;
fact
:
autopilot
.
parameters
[
"
COM_RC_LOSS_T
"
];
showUnits
:
true
}
}
}
Text
{
width
:
parent
.
width
text
:
"
Warning: You have an advanced safety configuration set using the NAV_RCL_OBC parameter. The above settings may not apply.
"
;
visible
:
autopilot
.
parameters
[
"
NAV_RCL_OBC
"
].
value
==
1
color
:
palette
.
windowText
wrapMode
:
Text
.
Wrap
}
Text
{
width
:
parent
.
width
text
:
"
Warning: You have an advanced safety configuration set using the NAV_DLL_OBC parameter. The above settings may not apply.
"
;
visible
:
autopilot
.
parameters
[
"
NAV_DLL_OBC
"
].
value
==
1
color
:
palette
.
windowText
wrapMode
:
Text
.
Wrap
}
}
}
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