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
d641b884
Commit
d641b884
authored
Oct 30, 2015
by
Roman Bapst
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2164 from mavlink/joystick_settings_fix
Fix Joystick instantitation from settings
parents
f9d58d34
ef452045
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
Vehicle.cc
src/Vehicle/Vehicle.cc
+15
-2
No files found.
src/Vehicle/Vehicle.cc
View file @
d641b884
...
...
@@ -813,16 +813,25 @@ bool Vehicle::joystickEnabled(void)
void
Vehicle
::
setJoystickEnabled
(
bool
enabled
)
{
// The magic parameter will go away,
// until then don't mess with the logic here!
Fact
*
fact
=
_autopilotPlugin
->
getParameterFact
(
FactSystem
::
defaultComponentId
,
"COM_RC_IN_MODE"
);
if
(
!
fact
)
{
qCWarning
(
JoystickLog
)
<<
"Missing COM_RC_IN_MODE parameter"
;
}
if
(
fact
->
value
().
toInt
()
!=
2
)
{
// Any value greater than one
// indicates special handling on
// the autopilot side. Force the
// joystick to on.
if
(
fact
->
value
().
toInt
()
>
1
)
{
// Mandatory in this setting
_joystickEnabled
=
true
;
}
else
{
fact
->
setValue
(
enabled
?
1
:
0
);
_joystickEnabled
=
enabled
;
}
_joystickEnabled
=
enabled
;
_startJoystick
(
_joystickEnabled
);
_saveSettings
();
}
...
...
@@ -1032,6 +1041,10 @@ void Vehicle::_parametersReady(bool parametersReady)
_missionManagerInitialRequestComplete
=
true
;
_missionManager
->
requestMissionItems
();
}
if
(
parametersReady
)
{
setJoystickEnabled
(
_joystickEnabled
);
}
}
void
Vehicle
::
_communicationInactivityTimedOut
(
void
)
...
...
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