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
76d2d867
Commit
76d2d867
authored
Aug 21, 2017
by
khancyr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Joystick: make negativethrust visible by firmwarePlugin
parent
8f1ee3c9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
1 deletion
+19
-1
FirmwarePlugin.cc
src/FirmwarePlugin/FirmwarePlugin.cc
+6
-0
FirmwarePlugin.h
src/FirmwarePlugin/FirmwarePlugin.h
+4
-0
Joystick.cc
src/Joystick/Joystick.cc
+1
-1
Vehicle.cc
src/Vehicle/Vehicle.cc
+5
-0
Vehicle.h
src/Vehicle/Vehicle.h
+2
-0
JoystickConfig.qml
src/VehicleSetup/JoystickConfig.qml
+1
-0
No files found.
src/FirmwarePlugin/FirmwarePlugin.cc
View file @
76d2d867
...
...
@@ -129,6 +129,12 @@ bool FirmwarePlugin::supportsThrottleModeCenterZero(void)
return
true
;
}
bool
FirmwarePlugin
::
supportsNegativeThrust
(
void
)
{
// By default, this is not supported
return
false
;
}
bool
FirmwarePlugin
::
supportsManualControl
(
void
)
{
return
false
;
...
...
src/FirmwarePlugin/FirmwarePlugin.h
View file @
76d2d867
...
...
@@ -158,6 +158,10 @@ public:
/// throttle.
virtual
bool
supportsThrottleModeCenterZero
(
void
);
/// Returns true if the vehicle and firmware supports the use of negative thrust
/// Typically supported rover.
virtual
bool
supportsNegativeThrust
(
void
);
/// Returns true if the firmware supports the use of the MAVlink "MANUAL_CONTROL" message.
/// By default, this returns false unless overridden in the firmware plugin.
virtual
bool
supportsManualControl
(
void
);
...
...
src/Joystick/Joystick.cc
View file @
76d2d867
...
...
@@ -463,7 +463,7 @@ void Joystick::run(void)
// Adjust throttle to 0:1 range
if
(
_throttleMode
==
ThrottleModeCenterZero
&&
_activeVehicle
->
supportsThrottleModeCenterZero
())
{
if
(
!
_negativeThrust
)
{
if
(
!
_
activeVehicle
->
supportsNegativeThrust
()
||
!
_
negativeThrust
)
{
throttle
=
std
::
max
(
0.0
f
,
throttle
);
}
}
else
{
...
...
src/Vehicle/Vehicle.cc
View file @
76d2d867
...
...
@@ -2118,6 +2118,11 @@ bool Vehicle::supportsThrottleModeCenterZero(void) const
return
_firmwarePlugin
->
supportsThrottleModeCenterZero
();
}
bool
Vehicle
::
supportsNegativeThrust
(
void
)
const
{
return
_firmwarePlugin
->
supportsNegativeThrust
();
}
bool
Vehicle
::
supportsRadio
(
void
)
const
{
return
_firmwarePlugin
->
supportsRadio
();
...
...
src/Vehicle/Vehicle.h
View file @
76d2d867
...
...
@@ -284,6 +284,7 @@ public:
Q_PROPERTY
(
bool
sub
READ
sub
NOTIFY
vehicleTypeChanged
)
Q_PROPERTY
(
bool
supportsManualControl
READ
supportsManualControl
CONSTANT
)
Q_PROPERTY
(
bool
supportsThrottleModeCenterZero
READ
supportsThrottleModeCenterZero
CONSTANT
)
Q_PROPERTY
(
bool
supportsNegativeThrust
READ
supportsNegativeThrust
CONSTANT
)
Q_PROPERTY
(
bool
supportsJSButton
READ
supportsJSButton
CONSTANT
)
Q_PROPERTY
(
bool
supportsRadio
READ
supportsRadio
CONSTANT
)
Q_PROPERTY
(
bool
supportsMotorInterference
READ
supportsMotorInterference
CONSTANT
)
...
...
@@ -522,6 +523,7 @@ public:
bool
supportsManualControl
(
void
)
const
;
bool
supportsThrottleModeCenterZero
(
void
)
const
;
bool
supportsNegativeThrust
(
void
)
const
;
bool
supportsRadio
(
void
)
const
;
bool
supportsJSButton
(
void
)
const
;
bool
supportsMotorInterference
(
void
)
const
;
...
...
src/VehicleSetup/JoystickConfig.qml
View file @
76d2d867
...
...
@@ -455,6 +455,7 @@ SetupPage {
}
QGCCheckBox
{
visible
:
_activeVehicle
.
supportsNegativeThrust
id
:
negativeThrust
text
:
qsTr
(
"
Allow negative Thrust
"
)
checked
:
_activeJoystick
?
_activeJoystick
.
negativeThrust
:
false
...
...
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