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
12c77152
Commit
12c77152
authored
Jun 27, 2016
by
Don Gagne
Committed by
GitHub
Jun 27, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix airspeed checking (#3672)
parent
c87b34b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
SensorsComponent.cc
src/AutoPilotPlugins/PX4/SensorsComponent.cc
+16
-7
SensorsComponent.h
src/AutoPilotPlugins/PX4/SensorsComponent.h
+2
-0
No files found.
src/AutoPilotPlugins/PX4/SensorsComponent.cc
View file @
12c77152
...
...
@@ -16,13 +16,14 @@
#include "QGCQmlWidgetHolder.h"
#include "SensorsComponentController.h"
const
char
*
SensorsComponent
::
_airspeedBreaker
=
"CBRK_AIRSPD_CHK"
;
const
char
*
SensorsComponent
::
_airspeedBreaker
=
"CBRK_AIRSPD_CHK"
;
const
char
*
SensorsComponent
::
_airspeedCal
=
"SENS_DPRES_OFF"
;
SensorsComponent
::
SensorsComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
VehicleComponent
(
vehicle
,
autopilot
,
parent
),
_name
(
tr
(
"Sensors"
))
{
_deviceIds
<<
QStringLiteral
(
"CAL_MAG0_ID"
)
<<
QStringLiteral
(
"CAL_GYRO0_ID"
)
<<
QStringLiteral
(
"CAL_ACC0_ID"
);
}
QString
SensorsComponent
::
name
(
void
)
const
...
...
@@ -48,12 +49,20 @@ bool SensorsComponent::requiresSetup(void) const
bool
SensorsComponent
::
setupComplete
(
void
)
const
{
foreach
(
const
QString
&
triggerParam
,
setupCompleteChangedTriggerList
()
)
{
if
(
triggerParam
!=
_airspeedBreaker
&&
_autopilot
->
getParameterFact
(
FactSystem
::
defaultComponentId
,
triggerParam
)
->
rawValue
().
toFloat
()
==
0.0
f
)
{
foreach
(
const
QString
&
triggerParam
,
_deviceIds
)
{
if
(
_autopilot
->
getParameterFact
(
FactSystem
::
defaultComponentId
,
triggerParam
)
->
rawValue
().
toFloat
()
==
0.0
f
)
{
return
false
;
}
}
if
(
_vehicle
->
fixedWing
()
||
_vehicle
->
vtol
())
{
if
(
_autopilot
->
getParameterFact
(
FactSystem
::
defaultComponentId
,
_airspeedBreaker
)
->
rawValue
().
toInt
()
!=
162128
)
{
if
(
_autopilot
->
getParameterFact
(
FactSystem
::
defaultComponentId
,
_airspeedCal
)
->
rawValue
().
toFloat
()
==
0.0
f
)
{
return
false
;
}
}
}
return
true
;
}
...
...
@@ -61,9 +70,9 @@ QStringList SensorsComponent::setupCompleteChangedTriggerList(void) const
{
QStringList
triggers
;
triggers
<<
"CAL_MAG0_ID"
<<
"CAL_GYRO0_ID"
<<
"CAL_ACC0_ID"
<<
"CBRK_AIRSPD_CHK"
;
if
(
(
_vehicle
->
fixedWing
()
||
_vehicle
->
vtol
())
&&
_autopilot
->
getParameterFact
(
FactSystem
::
defaultComponentId
,
_airspeedBreaker
)
->
rawValue
().
toInt
()
!=
162128
)
{
triggers
<<
"SENS_DPRES_OFF"
;
triggers
<<
_deviceIds
;
if
(
_vehicle
->
fixedWing
()
||
_vehicle
->
vtol
()
)
{
triggers
<<
_airspeedCal
<<
_airspeedBreaker
;
}
return
triggers
;
...
...
src/AutoPilotPlugins/PX4/SensorsComponent.h
View file @
12c77152
...
...
@@ -40,8 +40,10 @@ public:
private:
const
QString
_name
;
QVariantList
_summaryItems
;
QStringList
_deviceIds
;
static
const
char
*
_airspeedBreaker
;
static
const
char
*
_airspeedCal
;
};
#endif
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