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
b44d5ad4
Unverified
Commit
b44d5ad4
authored
Jul 08, 2020
by
Don Gagne
Committed by
GitHub
Jul 08, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8892 from DonLakeFlyer/RCChannelMax
Radio Cal/Monitor: Handle max channel correctly
parents
8fdbaf3f
c16638d0
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
72 deletions
+39
-72
RadioComponentController.cc
src/AutoPilotPlugins/Common/RadioComponentController.cc
+34
-49
RadioComponentController.h
src/AutoPilotPlugins/Common/RadioComponentController.h
+4
-10
RCChannelMonitorController.cc
src/QmlControls/RCChannelMonitorController.cc
+1
-8
RCChannelMonitorController.h
src/QmlControls/RCChannelMonitorController.h
+0
-5
No files found.
src/AutoPilotPlugins/Common/RadioComponentController.cc
View file @
b44d5ad4
This diff is collapsed.
Click to expand it.
src/AutoPilotPlugins/Common/RadioComponentController.h
View file @
b44d5ad4
...
...
@@ -232,8 +232,6 @@ private:
void
_signalAllAttitudeValueChanges
(
void
);
int
_chanMax
(
void
)
const
;
bool
_channelReversedParamValue
(
int
channel
);
void
_setChannelReversedParamValue
(
int
channel
,
bool
reversed
);
...
...
@@ -272,14 +270,10 @@ private:
static
const
int
_attitudeControls
=
5
;
int
_chanCount
;
///< Number of actual rc channels available
static
const
int
_chanMaxPX4
=
18
;
///< Maximum number of supported rc channels, PX4 Firmware
static
const
int
_chanMaxAPM
=
14
;
///< Maximum number of supported rc channels, APM firmware
static
const
int
_chanMaxAny
=
18
;
///< Maximum number of support rc channels by this implementation
static
const
int
_chanMax
=
18
;
///< Maximum number of support rc channels by this implementation
static
const
int
_chanMinimum
=
5
;
///< Minimum numner of channels required to run
struct
ChannelInfo
_rgChannelInfo
[
_chanMaxAny
];
///< Information associated with each rc channel
QList
<
int
>
_apmPossibleMissingRCChannelParams
;
///< List of possible missing RC*_* params for APM stack
struct
ChannelInfo
_rgChannelInfo
[
_chanMax
];
///< Information associated with each rc channel
enum
rcCalStates
_rcCalState
;
///< Current calibration state
int
_rcCalStateCurrentChannel
;
///< Current channel being worked on in rcCalStateIdentify and rcCalStateDetectInversion
...
...
@@ -302,9 +296,9 @@ private:
QString
_revParamFormat
;
bool
_revParamIsBool
;
int
_rcValueSave
[
_chanMax
Any
];
///< Saved values prior to detecting channel movement
int
_rcValueSave
[
_chanMax
];
///< Saved values prior to detecting channel movement
int
_rcRawValue
[
_chanMax
Any
];
///< Current set of raw channel values
int
_rcRawValue
[
_chanMax
];
///< Current set of raw channel values
int
_stickDetectChannel
;
int
_stickDetectInitialValue
;
...
...
src/QmlControls/RCChannelMonitorController.cc
View file @
b44d5ad4
...
...
@@ -18,9 +18,7 @@ RCChannelMonitorController::RCChannelMonitorController(void)
void
RCChannelMonitorController
::
_rcChannelsChanged
(
int
channelCount
,
int
pwmValues
[
Vehicle
::
cMaxRcChannels
])
{
int
maxChannel
=
std
::
min
(
channelCount
,
_chanMax
());
for
(
int
channel
=
0
;
channel
<
maxChannel
;
channel
++
)
{
for
(
int
channel
=
0
;
channel
<
channelCount
;
channel
++
)
{
int
channelValue
=
pwmValues
[
channel
];
if
(
_chanCount
!=
channelCount
)
{
...
...
@@ -33,8 +31,3 @@ void RCChannelMonitorController::_rcChannelsChanged(int channelCount, int pwmVal
}
}
}
int
RCChannelMonitorController
::
_chanMax
(
void
)
const
{
return
_vehicle
->
firmwareType
()
==
MAV_AUTOPILOT_PX4
?
_chanMaxPX4
:
_chanMaxAPM
;
}
src/QmlControls/RCChannelMonitorController.h
View file @
b44d5ad4
...
...
@@ -37,12 +37,7 @@ private slots:
void
_rcChannelsChanged
(
int
channelCount
,
int
pwmValues
[
Vehicle
::
cMaxRcChannels
]);
private:
int
_chanMax
(
void
)
const
;
int
_chanCount
;
static
const
int
_chanMaxPX4
=
18
;
///< Maximum number of supported rc channels, PX4 Firmware
static
const
int
_chanMaxAPM
=
14
;
///< Maximum number of supported rc channels, APM firmware
};
#endif // RCChannelMonitorController_H
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