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
0a86e02d
Commit
0a86e02d
authored
Feb 16, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ArduPlane FLTMODE_CH usage
parent
68908488
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
APMFlightModesComponentController.cc
...AutoPilotPlugins/APM/APMFlightModesComponentController.cc
+10
-2
APMFlightModesComponentController.h
src/AutoPilotPlugins/APM/APMFlightModesComponentController.h
+1
-0
No files found.
src/AutoPilotPlugins/APM/APMFlightModesComponentController.cc
View file @
0a86e02d
...
@@ -32,6 +32,8 @@ APMFlightModesComponentController::APMFlightModesComponentController(void)
...
@@ -32,6 +32,8 @@ APMFlightModesComponentController::APMFlightModesComponentController(void)
:
_activeFlightMode
(
0
)
:
_activeFlightMode
(
0
)
,
_channelCount
(
Vehicle
::
cMaxRcChannels
)
,
_channelCount
(
Vehicle
::
cMaxRcChannels
)
,
_fixedWing
(
_vehicle
->
vehicleType
()
==
MAV_TYPE_FIXED_WING
)
,
_fixedWing
(
_vehicle
->
vehicleType
()
==
MAV_TYPE_FIXED_WING
)
,
_flightModeChannel
(
4
)
{
{
QStringList
usedParams
;
QStringList
usedParams
;
usedParams
<<
QStringLiteral
(
"FLTMODE1"
)
<<
QStringLiteral
(
"FLTMODE2"
)
<<
QStringLiteral
(
"FLTMODE3"
)
usedParams
<<
QStringLiteral
(
"FLTMODE1"
)
<<
QStringLiteral
(
"FLTMODE2"
)
<<
QStringLiteral
(
"FLTMODE3"
)
...
@@ -40,6 +42,10 @@ APMFlightModesComponentController::APMFlightModesComponentController(void)
...
@@ -40,6 +42,10 @@ APMFlightModesComponentController::APMFlightModesComponentController(void)
return
;
return
;
}
}
if
(
parameterExists
(
FactSystem
::
defaultComponentId
,
QStringLiteral
(
"FLTMODE_CH"
)))
{
_flightModeChannel
=
getParameterFact
(
FactSystem
::
defaultComponentId
,
QStringLiteral
(
"FLTMODE_CH"
))
->
rawValue
().
toInt
();
}
_rgChannelOptionEnabled
<<
QVariant
(
false
)
<<
QVariant
(
false
)
<<
QVariant
(
false
)
<<
QVariant
(
false
)
<<
QVariant
(
false
)
<<
QVariant
(
false
);
_rgChannelOptionEnabled
<<
QVariant
(
false
)
<<
QVariant
(
false
)
<<
QVariant
(
false
)
<<
QVariant
(
false
)
<<
QVariant
(
false
)
<<
QVariant
(
false
);
connect
(
_vehicle
,
&
Vehicle
::
rcChannelsChanged
,
this
,
&
APMFlightModesComponentController
::
_rcChannelsChanged
);
connect
(
_vehicle
,
&
Vehicle
::
rcChannelsChanged
,
this
,
&
APMFlightModesComponentController
::
_rcChannelsChanged
);
...
@@ -48,10 +54,12 @@ APMFlightModesComponentController::APMFlightModesComponentController(void)
...
@@ -48,10 +54,12 @@ APMFlightModesComponentController::APMFlightModesComponentController(void)
/// Connected to Vehicle::rcChannelsChanged signal
/// Connected to Vehicle::rcChannelsChanged signal
void
APMFlightModesComponentController
::
_rcChannelsChanged
(
int
channelCount
,
int
pwmValues
[
Vehicle
::
cMaxRcChannels
])
void
APMFlightModesComponentController
::
_rcChannelsChanged
(
int
channelCount
,
int
pwmValues
[
Vehicle
::
cMaxRcChannels
])
{
{
Q_UNUSED
(
channelCount
);
if
(
_flightModeChannel
>
channelCount
)
{
return
;
}
_activeFlightMode
=
0
;
_activeFlightMode
=
0
;
int
channelValue
=
pwmValues
[
4
];
int
channelValue
=
pwmValues
[
_flightModeChannel
-
1
];
if
(
channelValue
!=
-
1
)
{
if
(
channelValue
!=
-
1
)
{
bool
found
=
false
;
bool
found
=
false
;
int
rgThreshold
[]
=
{
1230
,
1360
,
1490
,
1620
,
1749
};
int
rgThreshold
[]
=
{
1230
,
1360
,
1490
,
1620
,
1749
};
...
...
src/AutoPilotPlugins/APM/APMFlightModesComponentController.h
View file @
0a86e02d
...
@@ -62,6 +62,7 @@ private:
...
@@ -62,6 +62,7 @@ private:
int
_channelCount
;
int
_channelCount
;
QVariantList
_rgChannelOptionEnabled
;
QVariantList
_rgChannelOptionEnabled
;
bool
_fixedWing
;
bool
_fixedWing
;
int
_flightModeChannel
;
};
};
#endif
#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