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
3436500f
Unverified
Commit
3436500f
authored
Feb 16, 2019
by
Don Gagne
Committed by
GitHub
Feb 16, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7235 from DonLakeFlyer/PX4HITL
PX4: Warn if HITL is enabled on vehicle
parents
efd77cee
480f09bb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
57 deletions
+60
-57
PX4AutoPilotPlugin.cc
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc
+4
-8
SafetyComponent.qml
src/AutoPilotPlugins/PX4/SafetyComponent.qml
+55
-48
JoystickManager.cc
src/Joystick/JoystickManager.cc
+1
-1
No files found.
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc
View file @
3436500f
...
...
@@ -134,14 +134,10 @@ void PX4AutoPilotPlugin::parametersReadyPreChecks(void)
// Base class must be called
AutoPilotPlugin
::
parametersReadyPreChecks
();
// Check for older parameter version set
// FIXME: Firmware is moving to version stamp parameter set. Once that is complete the version stamp
// should be used instead.
if
(
_vehicle
->
parameterManager
()
->
parameterExists
(
FactSystem
::
defaultComponentId
,
"SENS_GYRO_XOFF"
)
||
_vehicle
->
parameterManager
()
->
parameterExists
(
FactSystem
::
defaultComponentId
,
"COM_DL_LOSS_EN"
))
{
_incorrectParameterVersion
=
true
;
qgcApp
()
->
showMessage
(
tr
(
"This version of GroundControl can only perform vehicle setup on a newer version of firmware. "
"Please perform a Firmware Upgrade if you wish to use Vehicle Setup."
));
QString
hitlParam
(
"SYS_HITL"
);
if
(
_vehicle
->
parameterManager
()
->
parameterExists
(
FactSystem
::
defaultComponentId
,
hitlParam
)
&&
_vehicle
->
parameterManager
()
->
getParameter
(
FactSystem
::
defaultComponentId
,
hitlParam
)
->
rawValue
().
toBool
())
{
qgcApp
()
->
showMessage
(
tr
(
"Warning: Hardware In The Loop (HITL) simulation is enabled for this vehicle."
));
}
}
...
...
src/AutoPilotPlugins/PX4/SafetyComponent.qml
View file @
3436500f
...
...
@@ -29,13 +29,15 @@ SetupPage {
Item
{
width
:
Math
.
max
(
availableWidth
,
outerGrid
.
width
)
height
:
lastRect
.
y
+
lastRect
.
height
height
:
_hitlAvailable
?
(
lastRect
.
y
+
lastRect
.
height
)
:
(
otherLastRect
.
y
+
otherLastRect
.
height
)
FactPanelController
{
id
:
controller
factPanel
:
safetyPage
.
viewPanel
}
readonly
property
string
hitlParam
:
"
SYS_HITL
"
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
property
real
_editFieldWidth
:
ScreenTools
.
defaultFontPixelWidth
*
20
property
real
_imageWidth
:
ScreenTools
.
defaultFontPixelWidth
*
15
...
...
@@ -50,18 +52,11 @@ SetupPage {
property
Fact
_dlLossAction
:
controller
.
getParameterFact
(
-
1
,
"
NAV_DLL_ACT
"
)
property
Fact
_disarmLandDelay
:
controller
.
getParameterFact
(
-
1
,
"
COM_DISARM_LAND
"
)
property
Fact
_landSpeedMC
:
controller
.
getParameterFact
(
-
1
,
"
MPC_LAND_SPEED
"
,
false
)
property
Fact
_hitlEnabled
:
controller
.
getParameterFact
(
-
1
,
"
SYS_HITL
"
,
false
)
property
bool
_hitlAvailable
:
controller
.
parameterExists
(
-
1
,
hitlParam
)
property
Fact
_hitlEnabled
:
controller
.
getParameterFact
(
-
1
,
hitlParam
,
false
)
ExclusiveGroup
{
id
:
homeLoiterGroup
}
Rectangle
{
x
:
hitlGrid
.
x
+
outerGrid
.
x
-
_margins
y
:
hitlGrid
.
y
+
outerGrid
.
y
-
_margins
width
:
hitlGrid
.
width
+
(
_margins
*
2
)
height
:
hitlGrid
.
height
+
(
_margins
*
2
)
color
:
qgcPal
.
windowShade
}
Rectangle
{
x
:
lowBattGrid
.
x
+
outerGrid
.
x
-
_margins
y
:
lowBattGrid
.
y
+
outerGrid
.
y
-
_margins
...
...
@@ -103,7 +98,7 @@ SetupPage {
}
Rectangle
{
id
:
l
astRect
id
:
otherL
astRect
x
:
landModeGrid
.
x
+
outerGrid
.
x
-
_margins
y
:
landModeGrid
.
y
+
outerGrid
.
y
-
_margins
width
:
landModeGrid
.
width
+
(
_margins
*
2
)
...
...
@@ -111,48 +106,21 @@ SetupPage {
color
:
qgcPal
.
windowShade
}
Rectangle
{
id
:
lastRect
x
:
hitlGrid
.
x
+
outerGrid
.
x
-
_margins
y
:
hitlGrid
.
y
+
outerGrid
.
y
-
_margins
width
:
hitlGrid
.
width
+
(
_margins
*
2
)
height
:
hitlGrid
.
height
+
(
_margins
*
2
)
color
:
qgcPal
.
windowShade
visible
:
_hitlAvailable
}
GridLayout
{
id
:
outerGrid
columns
:
3
anchors.horizontalCenter
:
parent
.
horizontalCenter
QGCLabel
{
text
:
qsTr
(
"
Hardware in the Loop Simulation
"
)
Layout.columnSpan
:
3
}
Item
{
width
:
1
;
height
:
_margins
;
Layout.columnSpan
:
3
}
Item
{
width
:
_margins
;
height
:
1
}
GridLayout
{
id
:
hitlGrid
columns
:
3
Image
{
mipmap
:
true
fillMode
:
Image
.
PreserveAspectFit
source
:
qgcPal
.
globalTheme
===
qgcPal
.
Light
?
"
/qmlimages/VehicleSummaryIcon.png
"
:
"
/qmlimages/VehicleSummaryIcon.png
"
Layout.rowSpan
:
3
Layout.maximumWidth
:
_imageWidth
Layout.maximumHeight
:
_imageHeight
width
:
_imageWidth
height
:
_imageHeight
}
QGCLabel
{
text
:
qsTr
(
"
HITL Enabled:
"
)
Layout.fillWidth
:
true
}
FactComboBox
{
fact
:
_hitlEnabled
indexModel
:
false
Layout.minimumWidth
:
_editFieldWidth
}
}
Item
{
width
:
1
;
height
:
_margins
;
Layout.columnSpan
:
3
}
QGCLabel
{
text
:
qsTr
(
"
Low Battery Failsafe Trigger
"
)
Layout.columnSpan
:
3
...
...
@@ -517,6 +485,45 @@ SetupPage {
Layout.minimumWidth
:
_editFieldWidth
}
}
Item
{
width
:
1
;
height
:
_margins
;
Layout.columnSpan
:
3
;
visible
:
_hitlAvailable
}
QGCLabel
{
text
:
qsTr
(
"
Hardware in the Loop Simulation
"
)
Layout.columnSpan
:
3
visible
:
_hitlAvailable
}
Item
{
width
:
1
;
height
:
_margins
;
Layout.columnSpan
:
3
;
visible
:
_hitlAvailable
}
Item
{
width
:
_margins
;
height
:
1
;
visible
:
_hitlAvailable
}
GridLayout
{
id
:
hitlGrid
columns
:
3
visible
:
_hitlAvailable
Image
{
mipmap
:
true
fillMode
:
Image
.
PreserveAspectFit
source
:
qgcPal
.
globalTheme
===
qgcPal
.
Light
?
"
/qmlimages/VehicleSummaryIcon.png
"
:
"
/qmlimages/VehicleSummaryIcon.png
"
Layout.rowSpan
:
3
Layout.maximumWidth
:
_imageWidth
Layout.maximumHeight
:
_imageHeight
width
:
_imageWidth
height
:
_imageHeight
}
QGCLabel
{
text
:
qsTr
(
"
HITL Enabled:
"
)
Layout.fillWidth
:
true
}
FactComboBox
{
fact
:
_hitlEnabled
indexModel
:
false
Layout.minimumWidth
:
_editFieldWidth
}
}
}
}
}
...
...
src/Joystick/JoystickManager.cc
View file @
3436500f
...
...
@@ -37,7 +37,7 @@ JoystickManager::JoystickManager(QGCApplication* app, QGCToolbox* toolbox)
JoystickManager
::~
JoystickManager
()
{
QMap
<
QString
,
Joystick
*>::
iterator
i
;
for
(
i
=
_name2JoystickMap
.
begin
();
i
!=
_name2JoystickMap
.
end
();
++
i
)
{
q
Debug
(
)
<<
"Releasing joystick:"
<<
i
.
key
();
q
CDebug
(
JoystickManagerLog
)
<<
"Releasing joystick:"
<<
i
.
key
();
delete
i
.
value
();
}
qDebug
()
<<
"Done"
;
...
...
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