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
aa432752
Commit
aa432752
authored
May 30, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Acro switch support
parent
65b0f7e4
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
11 deletions
+91
-11
FlightModesComponent.qml
src/AutoPilotPlugins/PX4/FlightModesComponent.qml
+83
-3
FlightModesComponentController.cc
src/AutoPilotPlugins/PX4/FlightModesComponentController.cc
+6
-8
FlightModesComponentController.h
src/AutoPilotPlugins/PX4/FlightModesComponentController.h
+2
-0
No files found.
src/AutoPilotPlugins/PX4/FlightModesComponent.qml
View file @
aa432752
This diff is collapsed.
Click to expand it.
src/AutoPilotPlugins/PX4/FlightModesComponentController.cc
View file @
aa432752
...
...
@@ -72,19 +72,13 @@ void FlightModesComponentController::_validateConfiguration(void)
_channelCount
=
_chanMax
;
}
// Acro is not full supported yet. If Acro is mapped you uhave to set up the hard way.
if
(
getParameterFact
(
FactSystem
::
defaultComponentId
,
"RC_MAP_ACRO_SW"
)
->
value
().
toInt
()
!=
0
)
{
_validConfiguration
=
false
;
_configurationErrors
+=
"Flight Mode setup does not yet support Acro switch"
;
}
// Make sure switches are valid and within channel range
QStringList
switchParams
,
switchNames
;
QList
<
int
>
switchMappings
;
switchParams
<<
"RC_MAP_MODE_SW"
<<
"RC_MAP_RETURN_SW"
<<
"RC_MAP_LOITER_SW"
<<
"RC_MAP_POSCTL_SW"
<<
"RC_MAP_OFFB_SW"
;
switchNames
<<
"Mode Switch"
<<
"Return Switch"
<<
"Loiter Switch"
<<
"PosCtl Switch"
<<
"Offboard Switch"
;
switchParams
<<
"RC_MAP_MODE_SW"
<<
"RC_MAP_RETURN_SW"
<<
"RC_MAP_LOITER_SW"
<<
"RC_MAP_POSCTL_SW"
<<
"RC_MAP_OFFB_SW"
<<
"RC_MAP_ACRO_SW"
;
switchNames
<<
"Mode Switch"
<<
"Return Switch"
<<
"Loiter Switch"
<<
"PosCtl Switch"
<<
"Offboard Switch"
<<
"Acro Switch"
;
for
(
int
i
=
0
;
i
<
switchParams
.
count
();
i
++
)
{
int
map
=
getParameterFact
(
FactSystem
::
defaultComponentId
,
switchParams
[
i
])
->
value
().
toInt
();
...
...
@@ -224,3 +218,7 @@ double FlightModesComponentController::posCtlSwitchLiveRange(void)
return
_switchLiveRange
(
"RC_MAP_POSCTL_SW"
);
}
double
FlightModesComponentController
::
acroSwitchLiveRange
(
void
)
{
return
_switchLiveRange
(
"RC_MAP_ACRO_SW"
);
}
src/AutoPilotPlugins/PX4/FlightModesComponentController.h
View file @
aa432752
...
...
@@ -54,6 +54,7 @@ public:
Q_PROPERTY
(
double
posCtlSwitchLiveRange
READ
posCtlSwitchLiveRange
NOTIFY
switchLiveRangeChanged
)
Q_PROPERTY
(
double
returnSwitchLiveRange
READ
returnSwitchLiveRange
NOTIFY
switchLiveRangeChanged
)
Q_PROPERTY
(
double
offboardSwitchLiveRange
READ
offboardSwitchLiveRange
NOTIFY
switchLiveRangeChanged
)
Q_PROPERTY
(
double
acroSwitchLiveRange
READ
acroSwitchLiveRange
NOTIFY
switchLiveRangeChanged
)
Q_PROPERTY
(
bool
sendLiveRCSwitchRanges
READ
sendLiveRCSwitchRanges
WRITE
setSendLiveRCSwitchRanges
NOTIFY
liveRCSwitchRangesChanged
)
...
...
@@ -62,6 +63,7 @@ public:
double
posCtlSwitchLiveRange
(
void
);
double
returnSwitchLiveRange
(
void
);
double
offboardSwitchLiveRange
(
void
);
double
acroSwitchLiveRange
(
void
);
bool
sendLiveRCSwitchRanges
(
void
)
{
return
_liveRCValues
;
}
void
setSendLiveRCSwitchRanges
(
bool
start
);
...
...
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