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
d22a9bb1
Commit
d22a9bb1
authored
Jul 09, 2019
by
Tomaz Canabrava
Committed by
Daniel Agar
Jul 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lists should use brace initializer
parent
29b2077a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
21 deletions
+13
-21
PX4AdvancedFlightModesController.cc
src/AutoPilotPlugins/PX4/PX4AdvancedFlightModesController.cc
+10
-12
PX4RadioComponent.cc
src/AutoPilotPlugins/PX4/PX4RadioComponent.cc
+3
-9
No files found.
src/AutoPilotPlugins/PX4/PX4AdvancedFlightModesController.cc
View file @
d22a9bb1
...
...
@@ -31,9 +31,10 @@ PX4AdvancedFlightModesController::PX4AdvancedFlightModesController(void) :
_returnModeSelected
(
false
),
_offboardModeSelected
(
false
)
{
QStringList
usedParams
;
usedParams
<<
"RC_MAP_THROTTLE"
<<
"RC_MAP_YAW"
<<
"RC_MAP_PITCH"
<<
"RC_MAP_ROLL"
<<
"RC_MAP_FLAPS"
<<
"RC_MAP_AUX1"
<<
"RC_MAP_AUX2"
<<
"RC_MAP_MODE_SW"
<<
"RC_MAP_RETURN_SW"
<<
"RC_MAP_LOITER_SW"
<<
"RC_MAP_POSCTL_SW"
<<
"RC_MAP_OFFB_SW"
<<
"RC_MAP_ACRO_SW"
;
QStringList
usedParams
=
QStringList
({
"RC_MAP_THROTTLE"
,
"RC_MAP_YAW"
,
"RC_MAP_PITCH"
,
"RC_MAP_ROLL"
,
"RC_MAP_FLAPS"
,
"RC_MAP_AUX1"
,
"RC_MAP_AUX2"
,
"RC_MAP_MODE_SW"
,
"RC_MAP_RETURN_SW"
,
"RC_MAP_LOITER_SW"
,
"RC_MAP_POSCTL_SW"
,
"RC_MAP_OFFB_SW"
,
"RC_MAP_ACRO_SW"
});
if
(
!
_allParametersExists
(
FactSystem
::
defaultComponentId
,
usedParams
))
{
return
;
}
...
...
@@ -98,12 +99,9 @@ void PX4AdvancedFlightModesController::_init(void)
}
// Setup the channel combobox model
QVector
<
int
>
usedChannels
;
QList
<
int
>
usedChannels
;
QStringList
attitudeParams
;
attitudeParams
<<
"RC_MAP_THROTTLE"
<<
"RC_MAP_YAW"
<<
"RC_MAP_PITCH"
<<
"RC_MAP_ROLL"
<<
"RC_MAP_FLAPS"
<<
"RC_MAP_AUX1"
<<
"RC_MAP_AUX2"
;
foreach
(
const
QString
&
attitudeParam
,
attitudeParams
)
{
for
(
const
QString
&
attitudeParam
:
{
"RC_MAP_THROTTLE"
,
"RC_MAP_YAW"
,
"RC_MAP_PITCH"
,
"RC_MAP_ROLL"
,
"RC_MAP_FLAPS"
,
"RC_MAP_AUX1"
,
"RC_MAP_AUX2"
})
{
int
channel
=
getParameterFact
(
-
1
,
attitudeParam
)
->
rawValue
().
toInt
();
if
(
channel
!=
0
)
{
usedChannels
<<
channel
;
...
...
src/AutoPilotPlugins/PX4/PX4RadioComponent.cc
View file @
d22a9bb1
...
...
@@ -43,9 +43,7 @@ bool PX4RadioComponent::setupComplete(void) const
if
(
_vehicle
->
parameterManager
()
->
getParameter
(
-
1
,
"COM_RC_IN_MODE"
)
->
rawValue
().
toInt
()
!=
1
)
{
// The best we can do to detect the need for a radio calibration is look for attitude
// controls to be mapped.
QStringList
attitudeMappings
;
attitudeMappings
<<
"RC_MAP_ROLL"
<<
"RC_MAP_PITCH"
<<
"RC_MAP_YAW"
<<
"RC_MAP_THROTTLE"
;
foreach
(
const
QString
&
mapParam
,
attitudeMappings
)
{
for
(
const
QString
&
mapParam
:
{
"RC_MAP_ROLL"
,
"RC_MAP_PITCH"
,
"RC_MAP_YAW"
,
"RC_MAP_THROTTLE"
})
{
if
(
_vehicle
->
parameterManager
()
->
getParameter
(
FactSystem
::
defaultComponentId
,
mapParam
)
->
rawValue
().
toInt
()
==
0
)
{
return
false
;
}
...
...
@@ -57,11 +55,7 @@ bool PX4RadioComponent::setupComplete(void) const
QStringList
PX4RadioComponent
::
setupCompleteChangedTriggerList
(
void
)
const
{
QStringList
triggers
;
triggers
<<
"COM_RC_IN_MODE"
<<
"RC_MAP_ROLL"
<<
"RC_MAP_PITCH"
<<
"RC_MAP_YAW"
<<
"RC_MAP_THROTTLE"
;
return
triggers
;
return
{
"COM_RC_IN_MODE"
,
"RC_MAP_ROLL"
,
"RC_MAP_PITCH"
,
"RC_MAP_YAW"
,
"RC_MAP_THROTTLE"
};
}
QUrl
PX4RadioComponent
::
setupSource
(
void
)
const
...
...
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