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
7f56c4f1
Commit
7f56c4f1
authored
Mar 16, 2019
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Making camera API available to all firmwares
parent
909b5147
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
35 deletions
+13
-35
FirmwarePlugin.cc
src/FirmwarePlugin/FirmwarePlugin.cc
+7
-17
FirmwarePlugin.h
src/FirmwarePlugin/FirmwarePlugin.h
+6
-6
PX4FirmwarePlugin.cc
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc
+0
-10
PX4FirmwarePlugin.h
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.h
+0
-2
No files found.
src/FirmwarePlugin/FirmwarePlugin.cc
View file @
7f56c4f1
...
...
@@ -14,13 +14,14 @@
#include "SettingsManager.h"
#include "AppSettings.h"
#include "QGCFileDownload.h"
#include "QGCCameraManager.h"
#include <QRegularExpression>
#include <QDebug>
QGC_LOGGING_CATEGORY
(
FirmwarePluginLog
,
"FirmwarePluginLog"
)
static
FirmwarePluginFactoryRegister
*
_instance
=
NULL
;
static
FirmwarePluginFactoryRegister
*
_instance
=
nullptr
;
const
QString
guided_mode_not_supported_by_vehicle
=
QObject
::
tr
(
"Guided mode not supported by Vehicle."
);
...
...
@@ -195,22 +196,16 @@ QString FirmwarePlugin::missionCommandOverrides(MAV_TYPE vehicleType) const
switch
(
vehicleType
)
{
case
MAV_TYPE_GENERIC
:
return
QStringLiteral
(
":/json/MavCmdInfoCommon.json"
);
break
;
case
MAV_TYPE_FIXED_WING
:
return
QStringLiteral
(
":/json/MavCmdInfoFixedWing.json"
);
break
;
case
MAV_TYPE_QUADROTOR
:
return
QStringLiteral
(
":/json/MavCmdInfoMultiRotor.json"
);
break
;
case
MAV_TYPE_VTOL_QUADROTOR
:
return
QStringLiteral
(
":/json/MavCmdInfoVTOL.json"
);
break
;
case
MAV_TYPE_SUBMARINE
:
return
QStringLiteral
(
":/json/MavCmdInfoSub.json"
);
break
;
case
MAV_TYPE_GROUND_ROVER
:
return
QStringLiteral
(
":/json/MavCmdInfoRover.json"
);
break
;
default:
qWarning
()
<<
"FirmwarePlugin::missionCommandOverrides called with bad MAV_TYPE:"
<<
vehicleType
;
return
QString
();
...
...
@@ -751,9 +746,9 @@ bool FirmwarePlugin::_setFlightModeAndValidate(Vehicle* vehicle, const QString&
void
FirmwarePlugin
::
batteryConsumptionData
(
Vehicle
*
vehicle
,
int
&
mAhBattery
,
double
&
hoverAmps
,
double
&
cruiseAmps
)
const
{
Q_UNUSED
(
vehicle
);
mAhBattery
=
0
;
hoverAmps
=
0
;
cruiseAmps
=
0
;
mAhBattery
=
0
;
hoverAmps
=
0
;
cruiseAmps
=
0
;
}
QString
FirmwarePlugin
::
autoDisarmParameter
(
Vehicle
*
vehicle
)
...
...
@@ -789,17 +784,12 @@ bool FirmwarePlugin::isVtol(const Vehicle* vehicle) const
QGCCameraManager
*
FirmwarePlugin
::
createCameraManager
(
Vehicle
*
vehicle
)
{
Q_UNUSED
(
vehicle
);
return
nullptr
;
return
new
QGCCameraManager
(
vehicle
);
}
QGCCameraControl
*
FirmwarePlugin
::
createCameraControl
(
const
mavlink_camera_information_t
*
info
,
Vehicle
*
vehicle
,
int
compID
,
QObject
*
parent
)
{
Q_UNUSED
(
info
);
Q_UNUSED
(
vehicle
);
Q_UNUSED
(
compID
);
Q_UNUSED
(
parent
);
return
nullptr
;
return
new
QGCCameraControl
(
info
,
vehicle
,
compID
,
parent
);
}
uint32_t
FirmwarePlugin
::
highLatencyCustomModeTo32Bits
(
uint16_t
hlCustomMode
)
...
...
src/FirmwarePlugin/FirmwarePlugin.h
View file @
7f56c4f1
...
...
@@ -210,12 +210,12 @@ public:
/// Loads the specified parameter meta data file.
/// @return Opaque parameter meta data information which must be stored with Vehicle. Vehicle is responsible to
/// call deleteParameterMetaData when no longer needed.
virtual
QObject
*
loadParameterMetaData
(
const
QString
&
metaDataFile
)
{
Q_UNUSED
(
metaDataFile
);
return
NULL
;
}
virtual
QObject
*
loadParameterMetaData
(
const
QString
&
metaDataFile
)
{
Q_UNUSED
(
metaDataFile
);
return
nullptr
;
}
/// Returns the FactMetaData associated with the parameter name
/// @param opaqueParameterMetaData Opaque pointer returned from loadParameterMetaData
/// @param name Parameter name
virtual
FactMetaData
*
getMetaDataForFact
(
QObject
*
parameterMetaData
,
const
QString
&
name
,
MAV_TYPE
vehicleType
)
{
Q_UNUSED
(
parameterMetaData
);
Q_UNUSED
(
name
);
Q_UNUSED
(
vehicleType
);
return
NULL
;
}
virtual
FactMetaData
*
getMetaDataForFact
(
QObject
*
parameterMetaData
,
const
QString
&
name
,
MAV_TYPE
vehicleType
)
{
Q_UNUSED
(
parameterMetaData
);
Q_UNUSED
(
name
);
Q_UNUSED
(
vehicleType
);
return
nullptr
;
}
/// Adds the parameter meta data to the Fact
/// @param opaqueParameterMetaData Opaque pointer returned from loadParameterMetaData
...
...
@@ -267,11 +267,11 @@ public:
/// TODO: This should go into QGCCameraManager
virtual
const
QVariantList
&
cameraList
(
const
Vehicle
*
vehicle
);
/// Creates vehicle camera manager.
Returns NULL if not supported.
/// Creates vehicle camera manager.
virtual
QGCCameraManager
*
createCameraManager
(
Vehicle
*
vehicle
);
/// Camera control.
Returns NULL if not supported.
virtual
QGCCameraControl
*
createCameraControl
(
const
mavlink_camera_information_t
*
info
,
Vehicle
*
vehicle
,
int
compID
,
QObject
*
parent
=
NULL
);
/// Camera control.
virtual
QGCCameraControl
*
createCameraControl
(
const
mavlink_camera_information_t
*
info
,
Vehicle
*
vehicle
,
int
compID
,
QObject
*
parent
=
nullptr
);
/// Returns a pointer to a dictionary of firmware-specific FactGroups
virtual
QMap
<
QString
,
FactGroup
*>*
factGroups
(
void
);
...
...
@@ -312,7 +312,7 @@ public:
/// Allows the Firmware plugin to override the facts meta data.
/// @param vehicleType - Type of current vehicle
/// @param metaData - MetaData for fact
virtual
void
adjustMetaData
(
MAV_TYPE
vehicleType
,
FactMetaData
*
metaData
)
{
Q_UNUSED
(
vehicleType
);
Q_UNUSED
(
metaData
);}
;
virtual
void
adjustMetaData
(
MAV_TYPE
vehicleType
,
FactMetaData
*
metaData
)
{
Q_UNUSED
(
vehicleType
);
Q_UNUSED
(
metaData
);}
// FIXME: Hack workaround for non pluginize FollowMe support
static
const
QString
px4FollowMeFlightMode
;
...
...
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc
View file @
7f56c4f1
...
...
@@ -576,16 +576,6 @@ bool PX4FirmwarePlugin::vehicleYawsToNextWaypointInMission(const Vehicle* vehicl
return
true
;
}
QGCCameraManager
*
PX4FirmwarePlugin
::
createCameraManager
(
Vehicle
*
vehicle
)
{
return
new
QGCCameraManager
(
vehicle
);
}
QGCCameraControl
*
PX4FirmwarePlugin
::
createCameraControl
(
const
mavlink_camera_information_t
*
info
,
Vehicle
*
vehicle
,
int
compID
,
QObject
*
parent
)
{
return
new
QGCCameraControl
(
info
,
vehicle
,
compID
,
parent
);
}
uint32_t
PX4FirmwarePlugin
::
highLatencyCustomModeTo32Bits
(
uint16_t
hlCustomMode
)
{
union
px4_custom_mode
px4_cm
;
...
...
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.h
View file @
7f56c4f1
...
...
@@ -67,8 +67,6 @@ public:
QString
brandImageOutdoor
(
const
Vehicle
*
vehicle
)
const
override
{
Q_UNUSED
(
vehicle
);
return
QStringLiteral
(
"/qmlimages/PX4/BrandImage"
);
}
bool
vehicleYawsToNextWaypointInMission
(
const
Vehicle
*
vehicle
)
const
override
;
QString
autoDisarmParameter
(
Vehicle
*
vehicle
)
override
{
Q_UNUSED
(
vehicle
);
return
QStringLiteral
(
"COM_DISARM_LAND"
);
}
QGCCameraManager
*
createCameraManager
(
Vehicle
*
vehicle
)
override
;
QGCCameraControl
*
createCameraControl
(
const
mavlink_camera_information_t
*
info
,
Vehicle
*
vehicle
,
int
compID
,
QObject
*
parent
=
NULL
)
override
;
uint32_t
highLatencyCustomModeTo32Bits
(
uint16_t
hlCustomMode
)
override
;
bool
supportsTerrainFrame
(
void
)
const
override
{
return
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