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
d2c0b167
Unverified
Commit
d2c0b167
authored
Jun 15, 2019
by
Gus Grubba
Committed by
GitHub
Jun 15, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7521 from mavlink/px4Rover
Initial support for PX4 Rover
parents
60ea3a78
5b3311a3
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
33 additions
and
34 deletions
+33
-34
ChangeLog.md
ChangeLog.md
+1
-0
ArduRoverFirmwarePlugin.cc
src/FirmwarePlugin/APM/ArduRoverFirmwarePlugin.cc
+1
-1
ArduRoverFirmwarePlugin.h
src/FirmwarePlugin/APM/ArduRoverFirmwarePlugin.h
+1
-1
FirmwarePlugin.cc
src/FirmwarePlugin/FirmwarePlugin.cc
+1
-1
FirmwarePlugin.h
src/FirmwarePlugin/FirmwarePlugin.h
+1
-1
PX4FirmwarePlugin.cc
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc
+18
-18
PX4FirmwarePlugin.h
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.h
+4
-3
PX4FirmwarePluginFactory.cc
src/FirmwarePlugin/PX4/PX4FirmwarePluginFactory.cc
+3
-6
Vehicle.cc
src/Vehicle/Vehicle.cc
+2
-2
Vehicle.h
src/Vehicle/Vehicle.h
+1
-1
No files found.
ChangeLog.md
View file @
d2c0b167
...
...
@@ -6,6 +6,7 @@ Note: This file only contains high level features or important fixes.
### 3.6.0 - Daily Build
*
For text to speech engine on Linux to English (all messages are in English)
*
Automated the ingestion of localization from Crowdin
*
Automated the generation of language resources into the application
*
Added all languages that come from Crowdin, even if empty.
...
...
src/FirmwarePlugin/APM/ArduRoverFirmwarePlugin.cc
View file @
d2c0b167
...
...
@@ -74,7 +74,7 @@ void ArduRoverFirmwarePlugin::guidedModeChangeAltitude(Vehicle* vehicle, double
qgcApp
()
->
showMessage
(
QStringLiteral
(
"Change altitude not supported."
));
}
bool
ArduRoverFirmwarePlugin
::
supportsNegativeThrust
(
void
)
bool
ArduRoverFirmwarePlugin
::
supportsNegativeThrust
(
Vehicle
*
/*vehicle*/
)
{
return
true
;
}
src/FirmwarePlugin/APM/ArduRoverFirmwarePlugin.h
View file @
d2c0b167
...
...
@@ -50,7 +50,7 @@ public:
void
guidedModeChangeAltitude
(
Vehicle
*
vehicle
,
double
altitudeChange
)
final
;
int
remapParamNameHigestMinorVersionNumber
(
int
majorVersionNumber
)
const
final
;
const
FirmwarePlugin
::
remapParamNameMajorVersionMap_t
&
paramNameRemapMajorVersionMap
(
void
)
const
final
{
return
_remapParamName
;
}
bool
supportsNegativeThrust
(
void
)
final
;
bool
supportsNegativeThrust
(
Vehicle
*
)
final
;
bool
supportsSmartRTL
(
void
)
const
override
{
return
true
;
}
QString
offlineEditingParamFile
(
Vehicle
*
vehicle
)
override
{
Q_UNUSED
(
vehicle
);
return
QStringLiteral
(
":/FirmwarePlugin/APM/Rover.OfflineEditing.params"
);
}
...
...
src/FirmwarePlugin/FirmwarePlugin.cc
View file @
d2c0b167
...
...
@@ -127,7 +127,7 @@ bool FirmwarePlugin::supportsThrottleModeCenterZero(void)
return
true
;
}
bool
FirmwarePlugin
::
supportsNegativeThrust
(
void
)
bool
FirmwarePlugin
::
supportsNegativeThrust
(
Vehicle
*
/*vehicle*/
)
{
// By default, this is not supported
return
false
;
...
...
src/FirmwarePlugin/FirmwarePlugin.h
View file @
d2c0b167
...
...
@@ -162,7 +162,7 @@ public:
/// Returns true if the vehicle and firmware supports the use of negative thrust
/// Typically supported rover.
virtual
bool
supportsNegativeThrust
(
void
);
virtual
bool
supportsNegativeThrust
(
Vehicle
*
);
/// Returns true if the firmware supports the use of the RC radio and requires the RC radio
/// setup page. Returns true by default.
...
...
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc
View file @
d2c0b167
...
...
@@ -35,7 +35,7 @@ PX4FirmwarePluginInstanceData::PX4FirmwarePluginInstanceData(QObject* parent)
}
PX4FirmwarePlugin
::
PX4FirmwarePlugin
(
void
)
PX4FirmwarePlugin
::
PX4FirmwarePlugin
()
:
_manualFlightMode
(
tr
(
"Manual"
))
,
_acroFlightMode
(
tr
(
"Acro"
))
,
_stabilizedFlightMode
(
tr
(
"Stabilized"
))
...
...
@@ -257,7 +257,7 @@ FactMetaData* PX4FirmwarePlugin::getMetaDataForFact(QObject* parameterMetaData,
qWarning
()
<<
"Internal error: pointer passed to PX4FirmwarePlugin::getMetaDataForFact not PX4ParameterMetaData"
;
}
return
NULL
;
return
nullptr
;
}
void
PX4FirmwarePlugin
::
addMetaDataToFact
(
QObject
*
parameterMetaData
,
Fact
*
fact
,
MAV_TYPE
vehicleType
)
...
...
@@ -306,22 +306,16 @@ QString PX4FirmwarePlugin::missionCommandOverrides(MAV_TYPE vehicleType) const
switch
(
vehicleType
)
{
case
MAV_TYPE_GENERIC
:
return
QStringLiteral
(
":/json/PX4/MavCmdInfoCommon.json"
);
break
;
case
MAV_TYPE_FIXED_WING
:
return
QStringLiteral
(
":/json/PX4/MavCmdInfoFixedWing.json"
);
break
;
case
MAV_TYPE_QUADROTOR
:
return
QStringLiteral
(
":/json/PX4/MavCmdInfoMultiRotor.json"
);
break
;
case
MAV_TYPE_VTOL_QUADROTOR
:
return
QStringLiteral
(
":/json/PX4/MavCmdInfoVTOL.json"
);
break
;
case
MAV_TYPE_SUBMARINE
:
return
QStringLiteral
(
":/json/PX4/MavCmdInfoSub.json"
);
break
;
case
MAV_TYPE_GROUND_ROVER
:
return
QStringLiteral
(
":/json/PX4/MavCmdInfoRover.json"
);
break
;
default:
qWarning
()
<<
"PX4FirmwarePlugin::missionCommandOverrides called with bad MAV_TYPE:"
<<
vehicleType
;
return
QString
();
...
...
@@ -410,13 +404,14 @@ void PX4FirmwarePlugin::guidedModeTakeoff(Vehicle* vehicle, double takeoffAltRel
qDebug
()
<<
takeoffAltRel
<<
takeoffAltRelFromVehicle
<<
takeoffAltAMSL
<<
vehicleAltitudeAMSL
;
connect
(
vehicle
,
&
Vehicle
::
mavCommandResult
,
this
,
&
PX4FirmwarePlugin
::
_mavCommandResult
);
vehicle
->
sendMavCommand
(
vehicle
->
defaultComponentId
(),
MAV_CMD_NAV_TAKEOFF
,
true
,
// show error is fails
-
1
,
// No pitch requested
0
,
0
,
// param 2-4 unused
NAN
,
NAN
,
NAN
,
// No yaw, lat, lon
takeoffAltAMSL
);
// AMSL altitude
vehicle
->
sendMavCommand
(
vehicle
->
defaultComponentId
(),
MAV_CMD_NAV_TAKEOFF
,
true
,
// show error is fails
-
1
,
// No pitch requested
0
,
0
,
// param 2-4 unused
NAN
,
NAN
,
NAN
,
// No yaw, lat, lon
static_cast
<
float
>
(
takeoffAltAMSL
));
// AMSL altitude
}
void
PX4FirmwarePlugin
::
guidedModeGotoLocation
(
Vehicle
*
vehicle
,
const
QGeoCoordinate
&
gotoCoord
)
...
...
@@ -446,8 +441,8 @@ void PX4FirmwarePlugin::guidedModeGotoLocation(Vehicle* vehicle, const QGeoCoord
MAV_DO_REPOSITION_FLAGS_CHANGE_MODE
,
0.0
f
,
NAN
,
gotoCoord
.
latitude
(
),
gotoCoord
.
longitude
(
),
static_cast
<
float
>
(
gotoCoord
.
latitude
()
),
static_cast
<
float
>
(
gotoCoord
.
longitude
()
),
vehicle
->
altitudeAMSL
()
->
rawValue
().
toFloat
());
}
}
...
...
@@ -475,7 +470,7 @@ void PX4FirmwarePlugin::guidedModeChangeAltitude(Vehicle* vehicle, double altitu
NAN
,
NAN
,
NAN
,
vehicle
->
homePosition
().
altitude
()
+
newAltRel
);
static_cast
<
float
>
(
vehicle
->
homePosition
().
altitude
()
+
newAltRel
)
);
}
void
PX4FirmwarePlugin
::
startMission
(
Vehicle
*
vehicle
)
...
...
@@ -594,3 +589,8 @@ QString PX4FirmwarePlugin::_getLatestVersionFileUrl(Vehicle* vehicle){
QString
PX4FirmwarePlugin
::
_versionRegex
()
{
return
QStringLiteral
(
"v([0-9,
\\
.]*) Stable"
);
}
bool
PX4FirmwarePlugin
::
supportsNegativeThrust
(
Vehicle
*
vehicle
)
{
return
vehicle
->
vehicleType
()
==
MAV_TYPE_GROUND_ROVER
;
}
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.h
View file @
d2c0b167
...
...
@@ -23,8 +23,8 @@ class PX4FirmwarePlugin : public FirmwarePlugin
Q_OBJECT
public:
PX4FirmwarePlugin
(
void
);
~
PX4FirmwarePlugin
()
;
PX4FirmwarePlugin
(
);
~
PX4FirmwarePlugin
()
override
;
// Overrides from FirmwarePlugin
...
...
@@ -69,6 +69,7 @@ public:
QString
autoDisarmParameter
(
Vehicle
*
vehicle
)
override
{
Q_UNUSED
(
vehicle
);
return
QStringLiteral
(
"COM_DISARM_LAND"
);
}
uint32_t
highLatencyCustomModeTo32Bits
(
uint16_t
hlCustomMode
)
override
;
bool
supportsTerrainFrame
(
void
)
const
override
{
return
false
;
}
bool
supportsNegativeThrust
(
Vehicle
*
vehicle
)
override
;
protected:
typedef
struct
{
...
...
@@ -122,7 +123,7 @@ class PX4FirmwarePluginInstanceData : public QObject
Q_OBJECT
public:
PX4FirmwarePluginInstanceData
(
QObject
*
parent
=
NULL
);
PX4FirmwarePluginInstanceData
(
QObject
*
parent
=
nullptr
);
bool
versionNotified
;
///< true: user notified over version issue
};
...
...
src/FirmwarePlugin/PX4/PX4FirmwarePluginFactory.cc
View file @
d2c0b167
...
...
@@ -13,6 +13,7 @@
#include "PX4FirmwarePluginFactory.h"
#include "PX4/PX4FirmwarePlugin.h"
PX4FirmwarePluginFactory
PX4FirmwarePluginFactory
;
PX4FirmwarePluginFactory
::
PX4FirmwarePluginFactory
(
void
)
...
...
@@ -24,21 +25,17 @@ PX4FirmwarePluginFactory::PX4FirmwarePluginFactory(void)
QList
<
MAV_AUTOPILOT
>
PX4FirmwarePluginFactory
::
supportedFirmwareTypes
(
void
)
const
{
QList
<
MAV_AUTOPILOT
>
list
;
list
.
append
(
MAV_AUTOPILOT_PX4
);
return
list
;
}
FirmwarePlugin
*
PX4FirmwarePluginFactory
::
firmwarePluginForAutopilot
(
MAV_AUTOPILOT
autopilotType
,
MAV_TYPE
vehicleType
)
FirmwarePlugin
*
PX4FirmwarePluginFactory
::
firmwarePluginForAutopilot
(
MAV_AUTOPILOT
autopilotType
,
MAV_TYPE
/*vehicleType*/
)
{
Q_UNUSED
(
vehicleType
);
if
(
autopilotType
==
MAV_AUTOPILOT_PX4
)
{
if
(
!
_pluginInstance
)
{
_pluginInstance
=
new
PX4FirmwarePlugin
;
_pluginInstance
=
new
PX4FirmwarePlugin
()
;
}
return
_pluginInstance
;
}
return
nullptr
;
}
src/Vehicle/Vehicle.cc
View file @
d2c0b167
...
...
@@ -2871,9 +2871,9 @@ bool Vehicle::supportsThrottleModeCenterZero(void) const
return
_firmwarePlugin
->
supportsThrottleModeCenterZero
();
}
bool
Vehicle
::
supportsNegativeThrust
(
void
)
const
bool
Vehicle
::
supportsNegativeThrust
(
void
)
{
return
_firmwarePlugin
->
supportsNegativeThrust
();
return
_firmwarePlugin
->
supportsNegativeThrust
(
this
);
}
bool
Vehicle
::
supportsRadio
(
void
)
const
...
...
src/Vehicle/Vehicle.h
View file @
d2c0b167
...
...
@@ -854,7 +854,7 @@ public:
bool
sub
(
void
)
const
;
bool
supportsThrottleModeCenterZero
(
void
)
const
;
bool
supportsNegativeThrust
(
void
)
const
;
bool
supportsNegativeThrust
(
void
);
bool
supportsRadio
(
void
)
const
;
bool
supportsJSButton
(
void
)
const
;
bool
supportsMotorInterference
(
void
)
const
;
...
...
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