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
2735dae7
Commit
2735dae7
authored
May 25, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Validate against Acro switch setting
parent
1c03185a
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
31 deletions
+39
-31
FlightModesComponent.cc
src/AutoPilotPlugins/PX4/FlightModesComponent.cc
+2
-1
FlightModesComponent.qml
src/AutoPilotPlugins/PX4/FlightModesComponent.qml
+27
-28
FlightModesComponentController.cc
src/AutoPilotPlugins/PX4/FlightModesComponentController.cc
+6
-0
PX4RCCalibrationTest.cc
src/qgcunittest/PX4RCCalibrationTest.cc
+1
-1
PX4RCCalibration.cc
src/ui/px4_configuration/PX4RCCalibration.cc
+1
-0
PX4RCCalibration.h
src/ui/px4_configuration/PX4RCCalibration.h
+2
-1
No files found.
src/AutoPilotPlugins/PX4/FlightModesComponent.cc
View file @
2735dae7
...
...
@@ -38,7 +38,8 @@ static const SwitchListItem switchList[] = {
{
"RC_MAP_MODE_SW"
,
"Mode Switch:"
},
// First entry must be mode switch
{
"RC_MAP_POSCTL_SW"
,
"Position Control Switch:"
},
{
"RC_MAP_LOITER_SW"
,
"Loiter Switch:"
},
{
"RC_MAP_RETURN_SW"
,
"Return Switch:"
}
{
"RC_MAP_RETURN_SW"
,
"Return Switch:"
},
{
"RC_MAP_ACRO_SW"
,
"Acro Switch:"
},
};
static
const
size_t
cSwitchList
=
sizeof
(
switchList
)
/
sizeof
(
switchList
[
0
]);
...
...
src/AutoPilotPlugins/PX4/FlightModesComponent.qml
View file @
2735dae7
...
...
@@ -47,29 +47,31 @@ Item {
Component
{
id
:
validComponent
Rectangle
{
Fact
{
id
:
rc_map_throttle
;
name
:
"
RC_MAP_THROTTLE
"
}
Fact
{
id
:
rc_map_yaw
;
name
:
"
RC_MAP_YAW
"
}
Fact
{
id
:
rc_map_pitch
;
name
:
"
RC_MAP_PITCH
"
}
Fact
{
id
:
rc_map_roll
;
name
:
"
RC_MAP_ROLL
"
}
Fact
{
id
:
rc_map_flaps
;
name
:
"
RC_MAP_FLAPS
"
}
Fact
{
id
:
rc_map_aux1
;
name
:
"
RC_MAP_AUX1
"
}
Fact
{
id
:
rc_map_aux2
;
name
:
"
RC_MAP_AUX2
"
}
Fact
{
id
:
rc_map_mode_sw
;
name
:
"
RC_MAP_MODE_SW
"
}
Fact
{
id
:
rc_map_posctl_sw
;
name
:
"
RC_MAP_POSCTL_SW
"
}
Fact
{
id
:
rc_map_return_sw
;
name
:
"
RC_MAP_RETURN_SW
"
}
Fact
{
id
:
rc_map_offboard_sw
;
name
:
"
RC_MAP_OFFB_SW
"
}
Fact
{
id
:
rc_map_loiter_sw
;
name
:
"
RC_MAP_LOITER_SW
"
}
Fact
{
id
:
rc_assist_th
;
name
:
"
RC_ASSIST_TH
"
}
Fact
{
id
:
rc_posctl_th
;
name
:
"
RC_POSCTL_TH
"
}
Fact
{
id
:
rc_auto_th
;
name
:
"
RC_AUTO_TH
"
}
Fact
{
id
:
rc_loiter_th
;
name
:
"
RC_LOITER_TH
"
}
Fact
{
id
:
rc_return_th
;
name
:
"
RC_RETURN_TH
"
}
Fact
{
id
:
rc_offboard_th
;
name
:
"
RC_OFFB_TH
"
}
Fact
{
id
:
rc_th_user
;
name
:
"
RC_TH_USER
"
}
FactPanel
{
Fact
{
id
:
rc_map_throttle
;
name
:
"
RC_MAP_THROTTLE
"
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
Fact
{
id
:
rc_map_yaw
;
name
:
"
RC_MAP_YAW
"
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
Fact
{
id
:
rc_map_pitch
;
name
:
"
RC_MAP_PITCH
"
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
Fact
{
id
:
rc_map_roll
;
name
:
"
RC_MAP_ROLL
"
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
Fact
{
id
:
rc_map_flaps
;
name
:
"
RC_MAP_FLAPS
"
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
Fact
{
id
:
rc_map_aux1
;
name
:
"
RC_MAP_AUX1
"
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
Fact
{
id
:
rc_map_aux2
;
name
:
"
RC_MAP_AUX2
"
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
Fact
{
id
:
rc_map_mode_sw
;
name
:
"
RC_MAP_MODE_SW
"
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
Fact
{
id
:
rc_map_posctl_sw
;
name
:
"
RC_MAP_POSCTL_SW
"
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
Fact
{
id
:
rc_map_return_sw
;
name
:
"
RC_MAP_RETURN_SW
"
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
Fact
{
id
:
rc_map_offboard_sw
;
name
:
"
RC_MAP_OFFB_SW
"
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
Fact
{
id
:
rc_map_loiter_sw
;
name
:
"
RC_MAP_LOITER_SW
"
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
Fact
{
id
:
rc_map_acro_sw
;
name
:
"
RC_MAP_ACRO_SW
"
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
Fact
{
id
:
rc_posctl_th
;
name
:
"
RC_POSCTL_TH
"
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
Fact
{
id
:
rc_return_th
;
name
:
"
RC_RETURN_TH
"
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
Fact
{
id
:
rc_offboard_th
;
name
:
"
RC_OFFB_TH
"
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
Fact
{
id
:
rc_loiter_th
;
name
:
"
RC_LOITER_TH
"
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
Fact
{
id
:
rc_acro_th
;
name
:
"
RC_ACRO_TH
"
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
Fact
{
id
:
rc_assist_th
;
name
:
"
RC_ASSIST_TH
"
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
Fact
{
id
:
rc_auto_th
;
name
:
"
RC_AUTO_TH
"
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
Fact
{
id
:
rc_th_user
;
name
:
"
RC_TH_USER
"
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
property
int
throttleChannel
:
rc_map_throttle
.
value
property
int
yawChannel
:
rc_map_yaw
.
value
...
...
@@ -98,9 +100,6 @@ Item {
anchors.fill
:
parent
color
:
qgcPal
.
window
Component
{
id
:
dragHandle
...
...
@@ -136,7 +135,7 @@ Item {
id
:
unassignedModeTileComponent
Rectangle
{
Fact
{
id
:
fact
;
name
:
tileParam
}
Fact
{
id
:
fact
;
name
:
tileParam
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
property
bool
dragEnabled
:
fact
.
value
==
0
id
:
outerRect
...
...
@@ -222,7 +221,7 @@ Item {
id
:
assignedModeTileComponent
Rectangle
{
Fact
{
id
:
fact
;
name
:
tileDragEnabled
?
tileParam
:
""
}
Fact
{
id
:
fact
;
name
:
tileDragEnabled
?
tileParam
:
""
;
onFactMissing
:
showMissingFactOverlay
(
name
)
}
width
:
tileWidth
height
:
tileHeight
...
...
src/AutoPilotPlugins/PX4/FlightModesComponentController.cc
View file @
2735dae7
...
...
@@ -77,6 +77,12 @@ 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
(
_autoPilotPlugin
->
getParameterFact
(
"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
;
...
...
src/qgcunittest/PX4RCCalibrationTest.cc
View file @
2735dae7
...
...
@@ -409,7 +409,7 @@ void PX4RCCalibrationTest::_fullCalibration_test(void)
// First make sure this function isn't being use for a switch
QStringList
switchList
;
switchList
<<
"RC_MAP_MODE_SW"
<<
"RC_MAP_LOITER_SW"
<<
"RC_MAP_RETURN_SW"
<<
"RC_MAP_POSCTL_SW"
;
switchList
<<
"RC_MAP_MODE_SW"
<<
"RC_MAP_LOITER_SW"
<<
"RC_MAP_RETURN_SW"
<<
"RC_MAP_POSCTL_SW"
<<
"RC_MAP_ACRO_SW"
;
foreach
(
QString
switchParam
,
switchList
)
{
Q_ASSERT
(
_autopilot
->
getParameterFact
(
switchParam
)
->
value
().
toInt
()
!=
channel
+
1
);
...
...
src/ui/px4_configuration/PX4RCCalibration.cc
View file @
2735dae7
...
...
@@ -76,6 +76,7 @@ const struct PX4RCCalibration::FunctionInfo PX4RCCalibration::_rgFunctionInfo[PX
{
"RC_MAP_POSCTL_SW"
},
{
"RC_MAP_LOITER_SW"
},
{
"RC_MAP_RETURN_SW"
},
{
"RC_MAP_ACRO_SW"
},
{
"RC_MAP_FLAPS"
},
{
"RC_MAP_AUX1"
},
{
"RC_MAP_AUX2"
},
...
...
src/ui/px4_configuration/PX4RCCalibration.h
View file @
2735dae7
...
...
@@ -78,7 +78,7 @@ private slots:
private:
/// @brief These identify the various controls functions. They are also used as indices into the _rgFunctioInfo
/// aray.
/// ar
r
ay.
enum
rcCalFunctions
{
rcCalFunctionRoll
,
rcCalFunctionPitch
,
...
...
@@ -88,6 +88,7 @@ private:
rcCalFunctionPosCtlSwitch
,
rcCalFunctionLoiterSwitch
,
rcCalFunctionReturnSwitch
,
rcCalFunctionAcroSwitch
,
rcCalFunctionFlaps
,
rcCalFunctionAux1
,
rcCalFunctionAux2
,
...
...
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