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
315bda6b
Commit
315bda6b
authored
Mar 23, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update flight mode naming
parent
7c6397de
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
16 deletions
+48
-16
PX4FirmwarePlugin.cc
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc
+30
-16
PX4FirmwarePlugin.h
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.h
+18
-0
No files found.
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc
View file @
315bda6b
...
...
@@ -68,26 +68,40 @@ struct Modes2Name {
bool
canBeSet
;
///< true: Vehicle can be set to this flight mode
};
const
char
*
PX4FirmwarePlugin
::
manualFlightMode
=
"Manual"
;
const
char
*
PX4FirmwarePlugin
::
acroFlightMode
=
"Acro"
;
const
char
*
PX4FirmwarePlugin
::
stabilizedFlightMode
=
"Stabilized"
;
const
char
*
PX4FirmwarePlugin
::
rattitudeFlightMode
=
"Rattitude"
;
const
char
*
PX4FirmwarePlugin
::
altCtlFlightMode
=
"Altitude Control"
;
const
char
*
PX4FirmwarePlugin
::
posCtlFlightMode
=
"Position Control"
;
const
char
*
PX4FirmwarePlugin
::
offboardFlightMode
=
"Offboard Control"
;
const
char
*
PX4FirmwarePlugin
::
readyFlightMode
=
"Ready"
;
const
char
*
PX4FirmwarePlugin
::
takeoffFlightMode
=
"Takeoff"
;
const
char
*
PX4FirmwarePlugin
::
pauseFlightMode
=
"Pause"
;
const
char
*
PX4FirmwarePlugin
::
missionFlightMode
=
"Mission"
;
const
char
*
PX4FirmwarePlugin
::
rtlFlightMode
=
"Return To Land"
;
const
char
*
PX4FirmwarePlugin
::
landingFlightMode
=
"Landing"
;
const
char
*
PX4FirmwarePlugin
::
rtgsFlightMode
=
"Return, Link Loss"
;
/// Tranlates from PX4 custom modes to flight mode names
static
const
struct
Modes2Name
rgModes2Name
[]
=
{
{
PX4_CUSTOM_MAIN_MODE_MANUAL
,
0
,
"Manual"
,
true
},
{
PX4_CUSTOM_MAIN_MODE_ACRO
,
0
,
"Acro"
,
true
},
{
PX4_CUSTOM_MAIN_MODE_STABILIZED
,
0
,
"Stabilized"
,
true
},
{
PX4_CUSTOM_MAIN_MODE_RATTITUDE
,
0
,
"Rattitude"
,
true
},
{
PX4_CUSTOM_MAIN_MODE_ALTCTL
,
0
,
"Altitude Control"
,
true
},
{
PX4_CUSTOM_MAIN_MODE_POSCTL
,
0
,
"Position Control"
,
true
},
{
PX4_CUSTOM_MAIN_MODE_OFFBOARD
,
0
,
"Offboard Control"
,
true
},
{
PX4_CUSTOM_MAIN_MODE_AUTO
,
PX4_CUSTOM_SUB_MODE_AUTO_READY
,
"Auto: Ready"
,
false
},
{
PX4_CUSTOM_MAIN_MODE_AUTO
,
PX4_CUSTOM_SUB_MODE_AUTO_TAKEOFF
,
"Auto: Takeoff"
,
false
},
{
PX4_CUSTOM_MAIN_MODE_AUTO
,
PX4_CUSTOM_SUB_MODE_AUTO_LOITER
,
"Auto: Pause"
,
true
},
{
PX4_CUSTOM_MAIN_MODE_AUTO
,
PX4_CUSTOM_SUB_MODE_AUTO_MISSION
,
"Auto: Mission"
,
true
},
{
PX4_CUSTOM_MAIN_MODE_AUTO
,
PX4_CUSTOM_SUB_MODE_AUTO_RTL
,
"Auto: Return To Land"
,
true
},
{
PX4_CUSTOM_MAIN_MODE_AUTO
,
PX4_CUSTOM_SUB_MODE_AUTO_LAND
,
"Auto: Landing"
,
false
},
{
PX4_CUSTOM_MAIN_MODE_AUTO
,
PX4_CUSTOM_SUB_MODE_AUTO_RTGS
,
"Return, Link Loss"
,
false
},
{
PX4_CUSTOM_MAIN_MODE_MANUAL
,
0
,
PX4FirmwarePlugin
::
manualFlightMode
,
true
},
{
PX4_CUSTOM_MAIN_MODE_ACRO
,
0
,
PX4FirmwarePlugin
::
acroFlightMode
,
true
},
{
PX4_CUSTOM_MAIN_MODE_STABILIZED
,
0
,
PX4FirmwarePlugin
::
stabilizedFlightMode
,
true
},
{
PX4_CUSTOM_MAIN_MODE_RATTITUDE
,
0
,
PX4FirmwarePlugin
::
rattitudeFlightMode
,
true
},
{
PX4_CUSTOM_MAIN_MODE_ALTCTL
,
0
,
PX4FirmwarePlugin
::
altCtlFlightMode
,
true
},
{
PX4_CUSTOM_MAIN_MODE_POSCTL
,
0
,
PX4FirmwarePlugin
::
posCtlFlightMode
,
true
},
{
PX4_CUSTOM_MAIN_MODE_OFFBOARD
,
0
,
PX4FirmwarePlugin
::
offboardFlightMode
,
true
},
{
PX4_CUSTOM_MAIN_MODE_AUTO
,
PX4_CUSTOM_SUB_MODE_AUTO_READY
,
PX4FirmwarePlugin
::
readyFlightMode
,
false
},
{
PX4_CUSTOM_MAIN_MODE_AUTO
,
PX4_CUSTOM_SUB_MODE_AUTO_TAKEOFF
,
PX4FirmwarePlugin
::
takeoffFlightMode
,
false
},
{
PX4_CUSTOM_MAIN_MODE_AUTO
,
PX4_CUSTOM_SUB_MODE_AUTO_LOITER
,
PX4FirmwarePlugin
::
pauseFlightMode
,
true
},
{
PX4_CUSTOM_MAIN_MODE_AUTO
,
PX4_CUSTOM_SUB_MODE_AUTO_MISSION
,
PX4FirmwarePlugin
::
missionFlightMode
,
true
},
{
PX4_CUSTOM_MAIN_MODE_AUTO
,
PX4_CUSTOM_SUB_MODE_AUTO_RTL
,
PX4FirmwarePlugin
::
rtlFlightMode
,
true
},
{
PX4_CUSTOM_MAIN_MODE_AUTO
,
PX4_CUSTOM_SUB_MODE_AUTO_LAND
,
PX4FirmwarePlugin
::
landingFlightMode
,
false
},
{
PX4_CUSTOM_MAIN_MODE_AUTO
,
PX4_CUSTOM_SUB_MODE_AUTO_RTGS
,
PX4FirmwarePlugin
::
rtgsFlightMode
,
false
},
};
QList
<
VehicleComponent
*>
PX4FirmwarePlugin
::
componentsForVehicle
(
AutoPilotPlugin
*
vehicle
)
{
Q_UNUSED
(
vehicle
);
...
...
@@ -244,5 +258,5 @@ QObject* PX4FirmwarePlugin::loadParameterMetaData(const QString& metaDataFile)
void
PX4FirmwarePlugin
::
pauseVehicle
(
Vehicle
*
vehicle
)
{
vehicle
->
setFlightMode
(
"Auto: Pause"
);
vehicle
->
setFlightMode
(
pauseFlightMode
);
}
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.h
View file @
315bda6b
...
...
@@ -56,6 +56,24 @@ public:
QString
internalParameterMetaDataFile
(
void
)
final
{
return
QString
(
":/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml"
);
}
void
getParameterMetaDataVersionInfo
(
const
QString
&
metaDataFile
,
int
&
majorVersion
,
int
&
minorVersion
)
final
{
PX4ParameterMetaData
::
getParameterMetaDataVersionInfo
(
metaDataFile
,
majorVersion
,
minorVersion
);
}
QObject
*
loadParameterMetaData
(
const
QString
&
metaDataFile
);
// Use these constants to set flight modes using setFlightMode method. Don't use hardcoded string names since the
// names may change.
static
const
char
*
manualFlightMode
;
static
const
char
*
acroFlightMode
;
static
const
char
*
stabilizedFlightMode
;
static
const
char
*
rattitudeFlightMode
;
static
const
char
*
altCtlFlightMode
;
static
const
char
*
posCtlFlightMode
;
static
const
char
*
offboardFlightMode
;
static
const
char
*
readyFlightMode
;
static
const
char
*
takeoffFlightMode
;
static
const
char
*
pauseFlightMode
;
static
const
char
*
missionFlightMode
;
static
const
char
*
rtlFlightMode
;
static
const
char
*
landingFlightMode
;
static
const
char
*
rtgsFlightMode
;
};
#endif
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