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
56f7a034
Commit
56f7a034
authored
Dec 02, 2015
by
Nate Weibley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable binding mode commands to joystick buttons
parent
41a81a78
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
PX4FirmwarePlugin.cc
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc
+1
-1
Joystick.cc
src/Joystick/Joystick.cc
+9
-1
No files found.
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc
View file @
56f7a034
...
...
@@ -174,7 +174,7 @@ bool PX4FirmwarePlugin::setFlightMode(const QString& flightMode, uint8_t* base_m
int
PX4FirmwarePlugin
::
manualControlReservedButtonCount
(
void
)
{
return
8
;
// 8
buttons reserved for rc switch simulation
return
0
;
// 0
buttons reserved for rc switch simulation
}
void
PX4FirmwarePlugin
::
adjustMavlinkMessage
(
mavlink_message_t
*
message
)
...
...
src/Joystick/Joystick.cc
View file @
56f7a034
...
...
@@ -347,7 +347,9 @@ void Joystick::run(void)
}
// Mark the button as pressed as long as its pressed
buttonPressedBits
|=
buttonBit
;
if
(
buttonIndex
<
reservedButtonCount
)
{
buttonPressedBits
|=
buttonBit
;
}
}
}
...
...
@@ -461,6 +463,10 @@ QStringList Joystick::actions(void)
QStringList
list
;
list
<<
"Arm"
<<
"Disarm"
;
if
(
_activeVehicle
)
{
list
<<
_activeVehicle
->
flightModes
();
}
return
list
;
}
...
...
@@ -558,6 +564,8 @@ void Joystick::_buttonAction(const QString& action)
_activeVehicle
->
setArmed
(
true
);
}
else
if
(
action
==
"Disarm"
)
{
_activeVehicle
->
setArmed
(
false
);
}
else
if
(
_activeVehicle
->
flightModes
().
contains
(
action
))
{
_activeVehicle
->
setFlightMode
(
action
);
}
else
{
qCDebug
(
JoystickLog
)
<<
"_buttonAction unknown action:"
<<
action
;
}
...
...
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