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
6d80c11f
Commit
6d80c11f
authored
Jul 04, 2015
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Autopilot plugins: Generate audio strings
parent
97d9118c
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
82 additions
and
0 deletions
+82
-0
AutoPilotPluginManager.cc
src/AutoPilotPlugins/AutoPilotPluginManager.cc
+11
-0
AutoPilotPluginManager.h
src/AutoPilotPlugins/AutoPilotPluginManager.h
+3
-0
GenericAutoPilotPlugin.cc
src/AutoPilotPlugins/Generic/GenericAutoPilotPlugin.cc
+9
-0
GenericAutoPilotPlugin.h
src/AutoPilotPlugins/Generic/GenericAutoPilotPlugin.h
+1
-0
PX4AutoPilotPlugin.cc
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc
+57
-0
PX4AutoPilotPlugin.h
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.h
+1
-0
No files found.
src/AutoPilotPlugins/AutoPilotPluginManager.cc
View file @
6d80c11f
...
...
@@ -124,6 +124,17 @@ QList<AutoPilotPluginManager::FullMode_t> AutoPilotPluginManager::getModes(int a
}
}
QString
AutoPilotPluginManager
::
getAudioModeText
(
uint8_t
baseMode
,
uint32_t
customMode
,
int
autopilotType
)
const
{
switch
(
autopilotType
)
{
case
MAV_AUTOPILOT_PX4
:
return
PX4AutoPilotPlugin
::
getAudioModeText
(
baseMode
,
customMode
);
case
MAV_AUTOPILOT_GENERIC
:
default:
return
GenericAutoPilotPlugin
::
getAudioModeText
(
baseMode
,
customMode
);
}
}
QString
AutoPilotPluginManager
::
getShortModeText
(
uint8_t
baseMode
,
uint32_t
customMode
,
int
autopilotType
)
const
{
switch
(
autopilotType
)
{
...
...
src/AutoPilotPlugins/AutoPilotPluginManager.h
View file @
6d80c11f
...
...
@@ -63,6 +63,9 @@ public:
/// @brief Returns a human readable short description for the specified mode.
QString
getShortModeText
(
uint8_t
baseMode
,
uint32_t
customMode
,
int
autopilotType
)
const
;
/// @brief Returns a human hearable short description for the specified mode.
QString
getAudioModeText
(
uint8_t
baseMode
,
uint32_t
customMode
,
int
autopilotType
)
const
;
private
slots
:
void
_uasCreated
(
UASInterface
*
uas
);
void
_uasDeleted
(
UASInterface
*
uas
);
...
...
src/AutoPilotPlugins/Generic/GenericAutoPilotPlugin.cc
View file @
6d80c11f
...
...
@@ -60,6 +60,15 @@ QList<AutoPilotPluginManager::FullMode_t> GenericAutoPilotPlugin::getModes(void)
return
modeList
;
}
QString
GenericAutoPilotPlugin
::
getAudioModeText
(
uint8_t
baseMode
,
uint32_t
customMode
)
{
Q_UNUSED
(
customMode
);
QString
mode
=
""
;
return
mode
;
}
QString
GenericAutoPilotPlugin
::
getShortModeText
(
uint8_t
baseMode
,
uint32_t
customMode
)
{
Q_UNUSED
(
customMode
);
...
...
src/AutoPilotPlugins/Generic/GenericAutoPilotPlugin.h
View file @
6d80c11f
...
...
@@ -44,6 +44,7 @@ public:
virtual
const
QVariantList
&
vehicleComponents
(
void
);
static
QList
<
AutoPilotPluginManager
::
FullMode_t
>
getModes
(
void
);
static
QString
getAudioModeText
(
uint8_t
baseMode
,
uint32_t
customMode
);
static
QString
getShortModeText
(
uint8_t
baseMode
,
uint32_t
customMode
);
static
void
clearStaticData
(
void
);
...
...
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc
View file @
6d80c11f
...
...
@@ -141,6 +141,63 @@ QList<AutoPilotPluginManager::FullMode_t> PX4AutoPilotPlugin::getModes(void)
return
modeList
;
}
QString
PX4AutoPilotPlugin
::
getAudioModeText
(
uint8_t
baseMode
,
uint32_t
customMode
)
{
QString
mode
;
Q_ASSERT
(
baseMode
&
MAV_MODE_FLAG_CUSTOM_MODE_ENABLED
);
if
(
baseMode
&
MAV_MODE_FLAG_CUSTOM_MODE_ENABLED
)
{
union
px4_custom_mode
px4_mode
;
px4_mode
.
data
=
customMode
;
if
(
px4_mode
.
main_mode
==
PX4_CUSTOM_MAIN_MODE_MANUAL
)
{
mode
=
"manual"
;
}
else
if
(
px4_mode
.
main_mode
==
PX4_CUSTOM_MAIN_MODE_ACRO
)
{
mode
=
"caro"
;
}
else
if
(
px4_mode
.
main_mode
==
PX4_CUSTOM_MAIN_MODE_STABILIZED
)
{
mode
=
"stabilized"
;
}
else
if
(
px4_mode
.
main_mode
==
PX4_CUSTOM_MAIN_MODE_ALTCTL
)
{
mode
=
"altitude control"
;
}
else
if
(
px4_mode
.
main_mode
==
PX4_CUSTOM_MAIN_MODE_POSCTL
)
{
mode
=
"position control"
;
}
else
if
(
px4_mode
.
main_mode
==
PX4_CUSTOM_MAIN_MODE_AUTO
)
{
mode
=
"auto and "
;
if
(
px4_mode
.
sub_mode
==
PX4_CUSTOM_SUB_MODE_AUTO_READY
)
{
mode
+=
"ready"
;
}
else
if
(
px4_mode
.
sub_mode
==
PX4_CUSTOM_SUB_MODE_AUTO_TAKEOFF
)
{
mode
+=
"taking off"
;
}
else
if
(
px4_mode
.
sub_mode
==
PX4_CUSTOM_SUB_MODE_AUTO_LOITER
)
{
mode
+=
"loitering"
;
}
else
if
(
px4_mode
.
sub_mode
==
PX4_CUSTOM_SUB_MODE_AUTO_MISSION
)
{
mode
+=
"following waypoints"
;
}
else
if
(
px4_mode
.
sub_mode
==
PX4_CUSTOM_SUB_MODE_AUTO_RTL
)
{
mode
+=
"returning to land"
;
}
else
if
(
px4_mode
.
sub_mode
==
PX4_CUSTOM_SUB_MODE_AUTO_LAND
)
{
mode
+=
"landing"
;
}
}
else
if
(
px4_mode
.
main_mode
==
PX4_CUSTOM_MAIN_MODE_OFFBOARD
)
{
mode
=
"offboard controlled"
;
}
if
(
baseMode
!=
0
)
{
mode
+=
" mode"
;
}
// ARMED STATE DECODING
if
(
baseMode
&
(
uint8_t
)
MAV_MODE_FLAG_DECODE_POSITION_SAFETY
)
{
mode
.
append
(
" and armed"
);
}
}
else
{
mode
=
""
;
}
return
mode
;
}
QString
PX4AutoPilotPlugin
::
getShortModeText
(
uint8_t
baseMode
,
uint32_t
customMode
)
{
QString
mode
;
...
...
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.h
View file @
6d80c11f
...
...
@@ -53,6 +53,7 @@ public:
virtual
const
QVariantList
&
vehicleComponents
(
void
);
static
QList
<
AutoPilotPluginManager
::
FullMode_t
>
getModes
(
void
);
static
QString
getAudioModeText
(
uint8_t
baseMode
,
uint32_t
customMode
);
static
QString
getShortModeText
(
uint8_t
baseMode
,
uint32_t
customMode
);
static
void
clearStaticData
(
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