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
e7914214
Unverified
Commit
e7914214
authored
Mar 13, 2018
by
Don Gagne
Committed by
GitHub
Mar 13, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6206 from DonLakeFlyer/JoystickVTOL
Add support for VTOL transition from joystick buttons
parents
db44134c
9fe27450
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
Joystick.cc
src/Joystick/Joystick.cc
+17
-3
Joystick.h
src/Joystick/Joystick.h
+5
-0
No files found.
src/Joystick/Joystick.cc
View file @
e7914214
...
...
@@ -32,6 +32,11 @@ const char* Joystick::_roverTXModeSettingsKey = "TXMode_Rover";
const
char
*
Joystick
::
_vtolTXModeSettingsKey
=
"TXMode_VTOL"
;
const
char
*
Joystick
::
_submarineTXModeSettingsKey
=
"TXMode_Submarine"
;
const
char
*
Joystick
::
_buttonActionArm
=
QT_TR_NOOP
(
"Arm"
);
const
char
*
Joystick
::
_buttonActionDisarm
=
QT_TR_NOOP
(
"Disarm"
);
const
char
*
Joystick
::
_buttonActionVTOLFixedWing
=
QT_TR_NOOP
(
"VTOL: Fixed Wing"
);
const
char
*
Joystick
::
_buttonActionVTOLMultiRotor
=
QT_TR_NOOP
(
"VTOL: Multi-Rotor"
);
const
char
*
Joystick
::
_rgFunctionSettingsKey
[
Joystick
::
maxFunction
]
=
{
"RollAxis"
,
"PitchAxis"
,
...
...
@@ -84,6 +89,10 @@ Joystick::Joystick(const QString& name, int axisCount, int buttonCount, int hatC
Joystick
::~
Joystick
()
{
// Crash out of the thread if it is still running
terminate
();
wait
();
delete
[]
_rgAxisValues
;
delete
[]
_rgCalibration
;
delete
[]
_rgButtonValues
;
...
...
@@ -638,11 +647,12 @@ QStringList Joystick::actions(void)
{
QStringList
list
;
list
<<
"Arm"
<<
"Disarm"
;
list
<<
_buttonActionArm
<<
_buttonActionDisarm
;
if
(
_activeVehicle
)
{
list
<<
_activeVehicle
->
flightModes
();
}
list
<<
_buttonActionVTOLFixedWing
<<
_buttonActionVTOLMultiRotor
;
return
list
;
}
...
...
@@ -787,10 +797,14 @@ void Joystick::_buttonAction(const QString& action)
return
;
}
if
(
action
==
"Arm"
)
{
if
(
action
==
_buttonActionArm
)
{
_activeVehicle
->
setArmed
(
true
);
}
else
if
(
action
==
"Disarm"
)
{
}
else
if
(
action
==
_buttonActionDisarm
)
{
_activeVehicle
->
setArmed
(
false
);
}
else
if
(
action
==
_buttonActionVTOLFixedWing
)
{
_activeVehicle
->
setVtolInFwdFlight
(
true
);
}
else
if
(
action
==
_buttonActionVTOLMultiRotor
)
{
_activeVehicle
->
setVtolInFwdFlight
(
false
);
}
else
if
(
_activeVehicle
->
flightModes
().
contains
(
action
))
{
_activeVehicle
->
setFlightMode
(
action
);
}
else
{
...
...
src/Joystick/Joystick.h
View file @
e7914214
...
...
@@ -236,6 +236,11 @@ private:
static
const
char
*
_vtolTXModeSettingsKey
;
static
const
char
*
_submarineTXModeSettingsKey
;
static
const
char
*
_buttonActionArm
;
static
const
char
*
_buttonActionDisarm
;
static
const
char
*
_buttonActionVTOLFixedWing
;
static
const
char
*
_buttonActionVTOLMultiRotor
;
private
slots
:
void
_activeVehicleChanged
(
Vehicle
*
activeVehicle
);
};
...
...
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