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
3b82d52d
Commit
3b82d52d
authored
Aug 01, 2016
by
Rustom Jehangir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make supportsThrottleModeCenterZero a plugin option
parent
0538e94e
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
1 deletion
+26
-1
ArduSubFirmwarePlugin.cc
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc
+5
-0
ArduSubFirmwarePlugin.h
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h
+2
-0
FirmwarePlugin.cc
src/FirmwarePlugin/FirmwarePlugin.cc
+6
-0
FirmwarePlugin.h
src/FirmwarePlugin/FirmwarePlugin.h
+5
-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
No files found.
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc
View file @
3b82d52d
...
...
@@ -52,3 +52,8 @@ int ArduSubFirmwarePlugin::manualControlReservedButtonCount(void)
{
return
0
;
}
bool
ArduSubFirmwarePlugin
::
supportsThrottleModeCenterZero
(
void
)
{
return
false
;
}
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h
View file @
3b82d52d
...
...
@@ -69,6 +69,8 @@ public:
// Overrides from FirmwarePlugin
int
manualControlReservedButtonCount
(
void
);
bool
supportsThrottleModeCenterZero
(
void
);
};
#endif
src/FirmwarePlugin/FirmwarePlugin.cc
View file @
3b82d52d
...
...
@@ -83,6 +83,12 @@ int FirmwarePlugin::manualControlReservedButtonCount(void)
return
-
1
;
}
bool
FirmwarePlugin
::
supportsThrottleModeCenterZero
(
void
)
{
// By default, this is supported
return
true
;
}
bool
FirmwarePlugin
::
adjustIncomingMavlinkMessage
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
)
{
Q_UNUSED
(
vehicle
);
...
...
src/FirmwarePlugin/FirmwarePlugin.h
View file @
3b82d52d
...
...
@@ -128,6 +128,11 @@ public:
/// @return -1: reserver all buttons, >0 number of buttons to reserve
virtual
int
manualControlReservedButtonCount
(
void
);
/// Returns true if the vehicle and firmware supports the use of a throttle joystick that
/// is zero when centered. Typically not supported on vehicles that have bidirectional
/// throttle.
virtual
bool
supportsThrottleModeCenterZero
(
void
);
/// Called before any mavlink message is processed by Vehicle such that the firmwre plugin
/// can adjust any message characteristics. This is handy to adjust or differences in mavlink
/// spec implementations such that the base code can remain mavlink generic.
...
...
src/Joystick/Joystick.cc
View file @
3b82d52d
...
...
@@ -284,7 +284,7 @@ void Joystick::run(void)
throttle
=
std
::
max
(
-
1.0
f
,
std
::
min
(
tanf
(
asinf
(
throttle_limited
)),
1.0
f
));
// Adjust throttle to 0:1 range
if
(
_throttleMode
==
ThrottleModeCenterZero
&&
!
_activeVehicle
->
sub
())
{
if
(
_throttleMode
==
ThrottleModeCenterZero
&&
_activeVehicle
->
supportsThrottleModeCenterZero
())
{
throttle
=
std
::
max
(
0.0
f
,
throttle
);
}
else
{
throttle
=
(
throttle
+
1.0
f
)
/
2.0
f
;
...
...
src/Vehicle/Vehicle.cc
View file @
3b82d52d
...
...
@@ -1528,6 +1528,11 @@ bool Vehicle::supportsManualControl(void) const
return
false
;
}
bool
Vehicle
::
supportsThrottleModeCenterZero
(
void
)
const
{
return
_firmwarePlugin
->
supportsThrottleModeCenterZero
();
}
void
Vehicle
::
_setCoordinateValid
(
bool
coordinateValid
)
{
if
(
coordinateValid
!=
_coordinateValid
)
{
...
...
src/Vehicle/Vehicle.h
View file @
3b82d52d
...
...
@@ -276,6 +276,7 @@ public:
Q_PROPERTY
(
bool
vtol
READ
vtol
CONSTANT
)
Q_PROPERTY
(
bool
rover
READ
rover
CONSTANT
)
Q_PROPERTY
(
bool
supportsManualControl
READ
supportsManualControl
CONSTANT
)
Q_PROPERTY
(
bool
supportsThrottleModeCenterZero
READ
supportsThrottleModeCenterZero
CONSTANT
)
Q_PROPERTY
(
bool
sub
READ
sub
CONSTANT
)
Q_PROPERTY
(
bool
autoDisconnect
MEMBER
_autoDisconnect
NOTIFY
autoDisconnectChanged
)
Q_PROPERTY
(
QString
prearmError
READ
prearmError
WRITE
setPrearmError
NOTIFY
prearmErrorChanged
)
...
...
@@ -473,6 +474,7 @@ public:
bool
sub
(
void
)
const
;
bool
supportsManualControl
(
void
)
const
;
bool
supportsThrottleModeCenterZero
(
void
)
const
;
void
setFlying
(
bool
flying
);
void
setGuidedMode
(
bool
guidedMode
);
...
...
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