QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
PX4FirmwarePlugin Class Reference

#include <PX4FirmwarePlugin.h>

Inheritance diagram for PX4FirmwarePlugin:
Collaboration diagram for PX4FirmwarePlugin:

Public Member Functions

 PX4FirmwarePlugin ()
virtual ~PX4FirmwarePlugin ()
void _changeAltAfterPause (void *resultHandlerData, bool pauseSucceeded)
QList< MAV_CMD > supportedMissionCommands (QGCMAVLink::VehicleClass_t vehicleClass) const override
 List of supported mission commands. Empty list for all commands supported.
AutoPilotPlugin * autopilotPlugin (Vehicle *vehicle) const override
bool isCapable (const Vehicle *vehicle, FirmwareCapabilities capabilities) const override
QStringList flightModes (Vehicle *vehicle) const override
QString flightMode (uint8_t base_mode, uint32_t custom_mode) const override
bool setFlightMode (const QString &flightMode, uint8_t *base_mode, uint32_t *custom_mode) const override
void setGuidedMode (Vehicle *vehicle, bool guidedMode) const override
 Set guided flight mode.
QString pauseFlightMode (void) const override
 Returns The flight mode which indicates the vehicle is paused.
QString missionFlightMode (void) const override
 Returns the flight mode for running missions.
QString rtlFlightMode (void) const override
 Returns the flight mode for RTL.
QString landFlightMode (void) const override
 Returns the flight mode for Land.
QString takeControlFlightMode (void) const override
 Returns the flight mode to use when the operator wants to take back control from autonomouse flight.
QString gotoFlightMode (void) const override
 Returns the flight mode which the vehicle will be in if it is performing a goto location.
QString followFlightMode (void) const override
 Returns the flight mode which the vehicle will be for follow me.
QString takeOffFlightMode (void) const override
 Returns the flight mode for TakeOff.
QString stabilizedFlightMode (void) const override
 Returns the flight mode for Stabilized.
VehicleReadiness * createVehicleReadiness (Vehicle *vehicle) const override
void pauseVehicle (Vehicle *vehicle) const override
void guidedModeRTL (Vehicle *vehicle, bool smartRTL) const override
 Command vehicle to return to launch.
void guidedModeLand (Vehicle *vehicle) const override
 Command vehicle to land at current location.
void guidedModeTakeoff (Vehicle *vehicle, double takeoffAltRel) const override
 Command vehicle to takeoff from current location to the specified height.
double maximumHorizontalSpeedMultirotorMetersSecond (Vehicle *vehicle) const override
double maximumEquivalentAirspeed (Vehicle *vehicle) const override
double minimumEquivalentAirspeed (Vehicle *vehicle) const override
bool mulirotorSpeedLimitsAvailable (Vehicle *vehicle) const override
bool fixedWingAirSpeedLimitsAvailable (Vehicle *vehicle) const override
bool guidedModeGotoLocation (Vehicle *vehicle, const QGeoCoordinate &gotoCoord, double forwardFlightLoiterRadius) const override
void guidedModeChangeAltitude (Vehicle *vehicle, double altitudeRel, bool pauseVehicle) override
void guidedModeChangeGroundSpeedMetersSecond (Vehicle *vehicle, double groundspeed) const override
void guidedModeChangeEquivalentAirspeedMetersSecond (Vehicle *vehicle, double airspeed_equiv) const override
void guidedModeChangeHeading (Vehicle *vehicle, const QGeoCoordinate &headingCoord) const override
 Command vehicle to rotate towards specified location.
bool guidedModeROI (Vehicle *vehicle, const QGeoCoordinate &roiCenterCoord, double relativeAltitudeMeters) const override
void startTakeoff (Vehicle *vehicle) const override
 Command the vehicle to start a takeoff.
void startMission (Vehicle *vehicle) const override
 Command the vehicle to start the mission.
bool isGuidedMode (const Vehicle *vehicle) const override
 Returns whether the vehicle is in guided mode or not.
void initializeVehicle (Vehicle *vehicle) override
 Called when Vehicle is first created to perform any firmware specific setup.
bool sendHomePositionToVehicle (void) const override
QString missionCommandOverrides (QGCMAVLink::VehicleClass_t vehicleClass) const override
QString _internalParameterMetaDataFile (const Vehicle *vehicle) const override
MAV_AUTOPILOT _autopilotType () const override
ParameterMetaData * _createParameterMetaData () final
bool adjustIncomingMavlinkMessage (Vehicle *vehicle, mavlink_message_t *message) override
QString offlineEditingParamFile (Vehicle *vehicle) const override
 Return the resource file which contains the set of params loaded for offline editing.
QString autoDisarmParameter (Vehicle *vehicle) const override
uint32_t highLatencyCustomModeTo32Bits (uint16_t hlCustomMode) const override
 Convert from HIGH_LATENCY2.custom_mode value to correct 32 bit value.
bool supportsNegativeThrust (Vehicle *vehicle) const override
QString getHobbsMeter (Vehicle *vehicle) const override
 gets hobbs meter from autopilot. This should be reimplmeented for each firmware
bool hasGripper (const Vehicle *vehicle) const override
QVariant expandedToolbarIndicatorSource (const Vehicle *vehicle, const QString &indicatorName) const override
void updateAvailableFlightModes (FlightModeList &modeList) override
 Update Available flight modes received from vehicle.
Public Member Functions inherited from FirmwarePlugin
 FirmwarePlugin (QObject *parent=nullptr)
virtual ~FirmwarePlugin ()
virtual bool MAV_CMD_DO_SET_MODE_is_supported () const
 returns true if this flight stack supports MAV_CMD_DO_SET_MODE
virtual QString smartRTLFlightMode () const
 Returns the flight mode for Smart RTL.
virtual bool supportsSmartRTL () const
virtual QString motorDetectionFlightMode () const
 Returns the flight mode for Motor Detection.
virtual double minimumTakeoffAltitudeMeters (Vehicle *) const
virtual int defaultJoystickTXMode () const
virtual bool supportsThrottleModeCenterZero () const
virtual bool supportsRadio () const
virtual bool supportsJSButton () const
virtual bool supportsMotorInterference () const
virtual void adjustOutgoingMavlinkMessageThreadSafe (Vehicle *, LinkInterface *, mavlink_message_t *)
virtual const remapParamNameMajorVersionMap_t & paramNameRemapMajorVersionMap () const
virtual int remapParamNameHigestMinorVersionNumber (int) const
virtual bool multiRotorCoaxialMotors (Vehicle *) const
virtual bool multiRotorXConfig (Vehicle *) const
virtual QString vehicleImageOpaque (const Vehicle *) const
 Return the resource file which contains the vehicle icon used in the flight view when the view is dark (Satellite for instance).
virtual QString vehicleImageOutline (const Vehicle *) const
 Return the resource file which contains the vehicle icon used in the flight view when the view is light (Map for instance).
virtual const QVariantList & toolIndicators (const Vehicle *vehicle)
virtual QGCCameraManager * createCameraManager (Vehicle *vehicle) const
 Creates vehicle camera manager.
virtual MavlinkCameraControlInterface * createCameraControl (const mavlink_camera_information_t *info, Vehicle *vehicle, int compID, QObject *parent=nullptr) const
 Camera control.
virtual QMap< QString, FactGroup * > * factGroups ()
 Returns a pointer to a dictionary of firmware-specific FactGroups.
virtual void batteryConsumptionData (Vehicle *vehicle, int &mAhBattery, double &hoverAmps, double &cruiseAmps) const
virtual bool hasGimbal (Vehicle *vehicle, bool &rollSupported, bool &pitchSupported, bool &yawSupported) const
virtual void checkIfIsLatestStable (Vehicle *vehicle) const
 Used to check if running firmware is latest stable version.
int versionCompare (const Vehicle *vehicle, const QString &compare) const
int versionCompare (const Vehicle *vehicle, int major, int minor, int patch) const
virtual void adjustMetaData (MAV_TYPE, FactMetaData *)
virtual void sendGCSMotionReport (Vehicle *vehicle, const FollowMe::GCSMotionReport &motionReport, uint8_t estimationCapabilities) const
 Sends the appropriate mavlink message for follow me support.
virtual Autotune * createAutotune (Vehicle *vehicle) const
 Creates Autotune object.
ParameterMetaData * loadParameterMetaData (const Vehicle *vehicle)
void cacheParameterMetaDataFile (const QString &metaDataFile)

Static Public Member Functions

static QString externalFlightModeName (const FlightModeList &modeList, int externalIndex)
 Name a vehicle's AVAILABLE_MODES list gives an External Mode (1-based), empty if no mode is registered there.
static QStringList externalFlightModeNames (const FlightModeList &modeList)
 externalFlightModeName of each of External Mode 1-8, in order
Static Public Member Functions inherited from FirmwarePlugin
static QString stableFirmwareSettingsKey (const Vehicle *vehicle)
 Settings key identifying the stable firmware stream (firmware + vehicle class) for this vehicle.
static bool isStableFirmwareVersionUnseen (const QString &latestVersion, const QString &seenVersion)

Static Public Attributes

static constexpr int kExternalFlightModeCount = 8
 Number of PX4 External Mode slots. PX4FirmwarePlugin.cc checks it against px4_custom_mode.h.

Additional Inherited Members

Public Types inherited from FirmwarePlugin
enum  FirmwareCapabilities {
  SetFlightModeCapability = 1 << 0 , PauseVehicleCapability = 1 << 1 , GuidedModeCapability = 1 << 2 , OrbitModeCapability = 1 << 3 ,
  TakeoffVehicleCapability = 1 << 4 , ROIModeCapability = 1 << 5 , ChangeHeadingCapability = 1 << 6 , GuidedTakeoffCapability = 1 << 7 ,
  VTOLMulticopterTakeoffCapability = 1 << 8
}
 Set of optional capabilites which firmware may support. More...
typedef QMap< QString, QString > remapParamNameMap_t
typedef QMap< int, remapParamNameMap_t > remapParamNameMinorVersionRemapMap_t
typedef QMap< int, remapParamNameMinorVersionRemapMap_t > remapParamNameMajorVersionMap_t
Signals inherited from FirmwarePlugin
void toolIndicatorsChanged ()
Protected Member Functions inherited from FirmwarePlugin
bool _armVehicleAndValidate (Vehicle *vehicle) const
void _sendROICommand (Vehicle *vehicle, const QGeoCoordinate &coord, MAV_FRAME frame, float altitude) const
 Build + send MAV_CMD_DO_SET_ROI_LOCATION (COMMAND_INT when the vehicle supports it).
bool _setFlightModeAndValidate (Vehicle *vehicle, const QString &flightMode) const
QString _cachedParameterMetaDataFile (const Vehicle *vehicle) const
virtual void _versionFileDownloadFinished (const QString &remoteFile, const QString &localFile, Vehicle *vehicle) const
 Callback to process file with latest release information.
void _setModeEnumToModeStringMapping (FlightModeCustomModeMap enumToString)
virtual uint32_t _convertToCustomFlightModeEnum (uint32_t val) const
void _updateFlightModeList (FlightModeList &flightModeList)
void _addNewFlightMode (FirmwareFlightMode &flightMode)
Protected Attributes inherited from FirmwarePlugin
FlightModeList _flightModeList
FlightModeCustomModeMap _modeEnumToString
QVariantList _toolIndicatorList
QVariantList _modeIndicatorList

Detailed Description

Definition at line 6 of file PX4FirmwarePlugin.h.

Constructor & Destructor Documentation

◆ PX4FirmwarePlugin()

◆ ~PX4FirmwarePlugin()

PX4FirmwarePlugin::~PX4FirmwarePlugin ( )
virtual

Definition at line 108 of file PX4FirmwarePlugin.cc.

Member Function Documentation

◆ _autopilotType()

MAV_AUTOPILOT PX4FirmwarePlugin::_autopilotType ( ) const
inlineoverridevirtual

Reimplemented from FirmwarePlugin.

Definition at line 59 of file PX4FirmwarePlugin.h.

◆ _changeAltAfterPause()

void PX4FirmwarePlugin::_changeAltAfterPause ( void * resultHandlerData,
bool pauseSucceeded )

◆ _createParameterMetaData()

ParameterMetaData * PX4FirmwarePlugin::_createParameterMetaData ( )
finalvirtual

Reimplemented from FirmwarePlugin.

Definition at line 274 of file PX4FirmwarePlugin.cc.

◆ _internalParameterMetaDataFile()

QString PX4FirmwarePlugin::_internalParameterMetaDataFile ( const Vehicle * vehicle) const
inlineoverridevirtual

Reimplemented from FirmwarePlugin.

Definition at line 58 of file PX4FirmwarePlugin.h.

◆ adjustIncomingMavlinkMessage()

bool PX4FirmwarePlugin::adjustIncomingMavlinkMessage ( Vehicle * ,
mavlink_message_t *  )
overridevirtual

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.

Parameters
vehicleVehicle message came from
message[in,out]Mavlink message to adjust if needed.
Returns
false: skip message, true: process message

Reimplemented from FirmwarePlugin.

Definition at line 691 of file PX4FirmwarePlugin.cc.

◆ autoDisarmParameter()

QString PX4FirmwarePlugin::autoDisarmParameter ( Vehicle * vehicle) const
inlineoverridevirtual

Reimplemented from FirmwarePlugin.

Definition at line 63 of file PX4FirmwarePlugin.h.

◆ autopilotPlugin()

AutoPilotPlugin * PX4FirmwarePlugin::autopilotPlugin ( Vehicle * vehicle) const
overridevirtual
Returns
The AutoPilotPlugin associated with this firmware plugin. Must be overridden.

Reimplemented from FirmwarePlugin.

Definition at line 112 of file PX4FirmwarePlugin.cc.

◆ createVehicleReadiness()

VehicleReadiness * PX4FirmwarePlugin::createVehicleReadiness ( Vehicle * vehicle) const
overridevirtual

Creates the vehicle's guided action readiness. The base readiness does not know which flight modes the guided actions use, so firmware with takeoff or mission modes returns a subclass that declares them.

Reimplemented from FirmwarePlugin.

Definition at line 680 of file PX4FirmwarePlugin.cc.

◆ expandedToolbarIndicatorSource()

QVariant PX4FirmwarePlugin::expandedToolbarIndicatorSource ( const Vehicle * vehicle,
const QString & indicatorName ) const
overridevirtual

Reimplemented from FirmwarePlugin.

Definition at line 921 of file PX4FirmwarePlugin.cc.

◆ externalFlightModeName()

QString PX4FirmwarePlugin::externalFlightModeName ( const FlightModeList & modeList,
int externalIndex )
static

Name a vehicle's AVAILABLE_MODES list gives an External Mode (1-based), empty if no mode is registered there.

Definition at line 884 of file PX4FirmwarePlugin.cc.

References kExternalFlightModeCount, px4_custom_mode::main_mode, PX4_CUSTOM_MAIN_MODE_AUTO, PX4_CUSTOM_SUB_MODE_EXTERNAL1, PX4_CUSTOM_SUB_MODE_EXTERNAL8, and px4_custom_mode::sub_mode.

Referenced by externalFlightModeNames().

◆ externalFlightModeNames()

QStringList PX4FirmwarePlugin::externalFlightModeNames ( const FlightModeList & modeList)
static

externalFlightModeName of each of External Mode 1-8, in order

Definition at line 911 of file PX4FirmwarePlugin.cc.

References externalFlightModeName(), and kExternalFlightModeCount.

◆ fixedWingAirSpeedLimitsAvailable()

bool PX4FirmwarePlugin::fixedWingAirSpeedLimitsAvailable ( Vehicle * ) const
overridevirtual
Returns
Return true if we have received the airspeed limits for fixed wing.

Reimplemented from FirmwarePlugin.

Definition at line 434 of file PX4FirmwarePlugin.cc.

References ParameterManager::defaultComponentId, ParameterManager::parameterExists(), and Vehicle::parameterManager().

◆ flightMode()

QString PX4FirmwarePlugin::flightMode ( uint8_t base_mode,
uint32_t custom_mode ) const
overridevirtual

Returns the name for this flight mode. Flight mode names must be human readable as well as audio speakable.

Parameters
base_modeBase mode from mavlink HEARTBEAT message
custom_modeCustom mode from mavlink HEARTBEAT message

Reimplemented from FirmwarePlugin.

Definition at line 137 of file PX4FirmwarePlugin.cc.

References FirmwarePlugin::_modeEnumToString, and flightMode().

Referenced by flightMode(), and setFlightMode().

◆ flightModes()

QStringList PX4FirmwarePlugin::flightModes ( Vehicle * ) const
overridevirtual

Returns the list of available flight modes for the Fly View dropdown. This may or may not be the full list available from the firmware. Call will be made again if advanced mode changes.

Reimplemented from FirmwarePlugin.

Definition at line 117 of file PX4FirmwarePlugin.cc.

References FirmwarePlugin::_flightModeList, Vehicle::fixedWing(), and Vehicle::multiRotor().

◆ followFlightMode()

QString PX4FirmwarePlugin::followFlightMode ( void ) const
overridevirtual

Returns the flight mode which the vehicle will be for follow me.

Reimplemented from FirmwarePlugin.

Definition at line 665 of file PX4FirmwarePlugin.cc.

References FirmwarePlugin::_modeEnumToString, and PX4CustomMode::AUTO_FOLLOW_TARGET.

◆ getHobbsMeter()

QString PX4FirmwarePlugin::getHobbsMeter ( Vehicle * vehicle) const
overridevirtual

gets hobbs meter from autopilot. This should be reimplmeented for each firmware

Reimplemented from FirmwarePlugin.

Definition at line 773 of file PX4FirmwarePlugin.cc.

References ParameterManager::defaultComponentId, ParameterManager::getParameter(), ParameterManager::parameterExists(), Vehicle::parameterManager(), and Fact::rawValue().

◆ gotoFlightMode()

QString PX4FirmwarePlugin::gotoFlightMode ( void ) const
overridevirtual

Returns the flight mode which the vehicle will be in if it is performing a goto location.

Reimplemented from FirmwarePlugin.

Definition at line 660 of file PX4FirmwarePlugin.cc.

References FirmwarePlugin::_modeEnumToString, and PX4CustomMode::AUTO_LOITER.

Referenced by setGuidedMode().

◆ guidedModeChangeAltitude()

void PX4FirmwarePlugin::guidedModeChangeAltitude ( Vehicle * vehicle,
double altitudeChange,
bool pauseVehicle )
overridevirtual

◆ guidedModeChangeEquivalentAirspeedMetersSecond()

void PX4FirmwarePlugin::guidedModeChangeEquivalentAirspeedMetersSecond ( Vehicle * vehicle,
double airspeed_equiv ) const
overridevirtual

Command vehicle to change equivalent airspeed

Parameters
airspeed_equivEquivalent airspeed in m/s

Reimplemented from FirmwarePlugin.

Definition at line 562 of file PX4FirmwarePlugin.cc.

References Vehicle::defaultComponentId(), and Vehicle::sendMavCommand().

◆ guidedModeChangeGroundSpeedMetersSecond()

void PX4FirmwarePlugin::guidedModeChangeGroundSpeedMetersSecond ( Vehicle * vehicle,
double groundspeed ) const
overridevirtual

Command vehicle to change groundspeed

Parameters
groundspeedGroundspeed in m/s

Reimplemented from FirmwarePlugin.

Definition at line 548 of file PX4FirmwarePlugin.cc.

References Vehicle::defaultComponentId(), and Vehicle::sendMavCommand().

◆ guidedModeChangeHeading()

void PX4FirmwarePlugin::guidedModeChangeHeading ( Vehicle * vehicle,
const QGeoCoordinate & headingCoord ) const
overridevirtual

Command vehicle to rotate towards specified location.

Reimplemented from FirmwarePlugin.

Definition at line 576 of file PX4FirmwarePlugin.cc.

References FirmwarePlugin::ChangeHeadingCapability, Vehicle::coordinate(), isCapable(), and QGC::showAppMessage().

◆ guidedModeGotoLocation()

bool PX4FirmwarePlugin::guidedModeGotoLocation ( Vehicle * vehicle,
const QGeoCoordinate & gotoCoord,
double forwardFlightLoiterRadius ) const
overridevirtual

Command vehicle to move to specified location (altitude is ignored, vehicle uses current altitude)

Returns
true: goto command accepted, false: goto failed (vehicle not moved)

Reimplemented from FirmwarePlugin.

Definition at line 440 of file PX4FirmwarePlugin.cc.

References VehicleFactGroup::altitudeAMSL(), Vehicle::capabilityBits(), Vehicle::defaultComponentId(), Fact::rawValue(), Vehicle::sendMavCommand(), Vehicle::sendMavCommandInt(), and QGC::showAppMessage().

◆ guidedModeLand()

void PX4FirmwarePlugin::guidedModeLand ( Vehicle * vehicle) const
overridevirtual

Command vehicle to land at current location.

Reimplemented from FirmwarePlugin.

Definition at line 325 of file PX4FirmwarePlugin.cc.

References FirmwarePlugin::_setFlightModeAndValidate(), and landFlightMode().

◆ guidedModeROI()

bool PX4FirmwarePlugin::guidedModeROI ( Vehicle * vehicle,
const QGeoCoordinate & roiCenterCoord,
double relativeAltitudeMeters ) const
overridevirtual

Command vehicle to set a Region Of Interest at the specified location.

Parameters
roiCenterCoordROI location (altitude within the coordinate is ignored)
relativeAltitudeMetersROI altitude in meters above home
Returns
true: ROI command sent, false: unable to send

Reimplemented from FirmwarePlugin.

Definition at line 588 of file PX4FirmwarePlugin.cc.

References FirmwarePlugin::_sendROICommand(), Vehicle::homePosition(), and QGC::showAppMessage().

◆ guidedModeRTL()

void PX4FirmwarePlugin::guidedModeRTL ( Vehicle * vehicle,
bool smartRTL ) const
overridevirtual

Command vehicle to return to launch.

Reimplemented from FirmwarePlugin.

Definition at line 319 of file PX4FirmwarePlugin.cc.

References FirmwarePlugin::_setFlightModeAndValidate(), and rtlFlightMode().

◆ guidedModeTakeoff()

void PX4FirmwarePlugin::guidedModeTakeoff ( Vehicle * vehicle,
double takeoffAltRel ) const
overridevirtual

◆ hasGripper()

bool PX4FirmwarePlugin::hasGripper ( const Vehicle * ) const
overridevirtual
Returns
Return true if the GCS has enabled Grip_enable option

Reimplemented from FirmwarePlugin.

Definition at line 795 of file PX4FirmwarePlugin.cc.

References ParameterManager::defaultComponentId, ParameterManager::getParameter(), ParameterManager::parameterExists(), Vehicle::parameterManager(), and Fact::rawValue().

◆ highLatencyCustomModeTo32Bits()

uint32_t PX4FirmwarePlugin::highLatencyCustomModeTo32Bits ( uint16_t hlCustomMode) const
overridevirtual

Convert from HIGH_LATENCY2.custom_mode value to correct 32 bit value.

Reimplemented from FirmwarePlugin.

Definition at line 748 of file PX4FirmwarePlugin.cc.

References px4_custom_mode::custom_mode_hl, and px4_custom_mode::data.

◆ initializeVehicle()

void PX4FirmwarePlugin::initializeVehicle ( Vehicle * )
overridevirtual

Called when Vehicle is first created to perform any firmware specific setup.

Reimplemented from FirmwarePlugin.

Definition at line 190 of file PX4FirmwarePlugin.cc.

References Vehicle::setFirmwarePluginInstanceData().

◆ isCapable()

◆ isGuidedMode()

bool PX4FirmwarePlugin::isGuidedMode ( const Vehicle * ) const
overridevirtual

Returns whether the vehicle is in guided mode or not.

Reimplemented from FirmwarePlugin.

Definition at line 685 of file PX4FirmwarePlugin.cc.

References Vehicle::flightMode(), landFlightMode(), pauseFlightMode(), and takeOffFlightMode().

◆ landFlightMode()

QString PX4FirmwarePlugin::landFlightMode ( void ) const
overridevirtual

Returns the flight mode for Land.

Reimplemented from FirmwarePlugin.

Definition at line 650 of file PX4FirmwarePlugin.cc.

References FirmwarePlugin::_modeEnumToString, and PX4CustomMode::AUTO_LAND.

Referenced by guidedModeLand(), and isGuidedMode().

◆ maximumEquivalentAirspeed()

double PX4FirmwarePlugin::maximumEquivalentAirspeed ( Vehicle * ) const
overridevirtual

◆ maximumHorizontalSpeedMultirotorMetersSecond()

double PX4FirmwarePlugin::maximumHorizontalSpeedMultirotorMetersSecond ( Vehicle * ) const
overridevirtual

◆ minimumEquivalentAirspeed()

double PX4FirmwarePlugin::minimumEquivalentAirspeed ( Vehicle * ) const
overridevirtual

◆ missionCommandOverrides()

QString PX4FirmwarePlugin::missionCommandOverrides ( QGCMAVLink::VehicleClass_t vehicleClass) const
overridevirtual

Returns the name of the mission command json override file for the specified vehicle type.

Parameters
vehicleClassVehicle class to return file for, VehicleClassGeneric is a request for overrides for all vehicle types

Reimplemented from FirmwarePlugin.

Definition at line 253 of file PX4FirmwarePlugin.cc.

References QGCMAVLink::VehicleClassFixedWing, QGCMAVLinkTypes::VehicleClassGeneric, QGCMAVLink::VehicleClassMultiRotor, QGCMAVLink::VehicleClassRoverBoat, QGCMAVLink::VehicleClassSub, and QGCMAVLink::VehicleClassVTOL.

◆ missionFlightMode()

QString PX4FirmwarePlugin::missionFlightMode ( void ) const
overridevirtual

Returns the flight mode for running missions.

Reimplemented from FirmwarePlugin.

Definition at line 640 of file PX4FirmwarePlugin.cc.

References FirmwarePlugin::_modeEnumToString, and PX4CustomMode::AUTO_MISSION.

Referenced by startMission().

◆ mulirotorSpeedLimitsAvailable()

bool PX4FirmwarePlugin::mulirotorSpeedLimitsAvailable ( Vehicle * ) const
overridevirtual
Returns
Return true if we have received the ground speed limits for the mulirotor.

Reimplemented from FirmwarePlugin.

Definition at line 429 of file PX4FirmwarePlugin.cc.

References ParameterManager::defaultComponentId, ParameterManager::parameterExists(), and Vehicle::parameterManager().

◆ offlineEditingParamFile()

QString PX4FirmwarePlugin::offlineEditingParamFile ( Vehicle * ) const
inlineoverridevirtual

Return the resource file which contains the set of params loaded for offline editing.

Reimplemented from FirmwarePlugin.

Definition at line 62 of file PX4FirmwarePlugin.h.

References offlineEditingParamFile().

Referenced by offlineEditingParamFile().

◆ pauseFlightMode()

QString PX4FirmwarePlugin::pauseFlightMode ( void ) const
overridevirtual

Returns The flight mode which indicates the vehicle is paused.

Reimplemented from FirmwarePlugin.

Definition at line 635 of file PX4FirmwarePlugin.cc.

References FirmwarePlugin::_modeEnumToString, and PX4CustomMode::AUTO_LOITER.

Referenced by isGuidedMode().

◆ pauseVehicle()

void PX4FirmwarePlugin::pauseVehicle ( Vehicle * vehicle) const
overridevirtual

Causes the vehicle to stop at current position. If guide mode is supported, vehicle will be let in guide mode. If not, vehicle will be left in Loiter.

Reimplemented from FirmwarePlugin.

Definition at line 314 of file PX4FirmwarePlugin.cc.

Referenced by guidedModeChangeAltitude(), and setGuidedMode().

◆ rtlFlightMode()

QString PX4FirmwarePlugin::rtlFlightMode ( void ) const
overridevirtual

Returns the flight mode for RTL.

Reimplemented from FirmwarePlugin.

Definition at line 645 of file PX4FirmwarePlugin.cc.

References FirmwarePlugin::_modeEnumToString, and PX4CustomMode::AUTO_RTL.

Referenced by guidedModeRTL().

◆ sendHomePositionToVehicle()

bool PX4FirmwarePlugin::sendHomePositionToVehicle ( void ) const
overridevirtual

Determines how to handle the first item of the mission item list. Internally to QGC the first item is always the home position. Generic stack does not want home position sent in the first position. Subsequent sequence numbers must be adjusted. This is the mavlink spec default.

Returns
true: Send first mission item as home position to vehicle. When vehicle has no mission items on it, it may or may not return a home position back in position 0. false: Do not send first item to vehicle, sequence numbers must be adjusted

Reimplemented from FirmwarePlugin.

Definition at line 195 of file PX4FirmwarePlugin.cc.

◆ setFlightMode()

bool PX4FirmwarePlugin::setFlightMode ( const QString & flightMode,
uint8_t * base_mode,
uint32_t * custom_mode ) const
overridevirtual

Sets base_mode and custom_mode to specified flight mode.

Parameters
[out]base_modeBase mode for SET_MODE mavlink message
[out]custom_modeCustom mode for SET_MODE mavlink message

Reimplemented from FirmwarePlugin.

Definition at line 148 of file PX4FirmwarePlugin.cc.

References FirmwarePlugin::_flightModeList, and flightMode().

◆ setGuidedMode()

void PX4FirmwarePlugin::setGuidedMode ( Vehicle * vehicle,
bool guidedMode ) const
overridevirtual

Set guided flight mode.

Reimplemented from FirmwarePlugin.

Definition at line 626 of file PX4FirmwarePlugin.cc.

References FirmwarePlugin::_setFlightModeAndValidate(), gotoFlightMode(), and pauseVehicle().

◆ stabilizedFlightMode()

QString PX4FirmwarePlugin::stabilizedFlightMode ( void ) const
overridevirtual

Returns the flight mode for Stabilized.

Reimplemented from FirmwarePlugin.

Definition at line 675 of file PX4FirmwarePlugin.cc.

References FirmwarePlugin::_modeEnumToString, and PX4CustomMode::STABILIZED.

◆ startMission()

void PX4FirmwarePlugin::startMission ( Vehicle * vehicle) const
overridevirtual

Command the vehicle to start the mission.

Reimplemented from FirmwarePlugin.

Definition at line 614 of file PX4FirmwarePlugin.cc.

References FirmwarePlugin::_armVehicleAndValidate(), FirmwarePlugin::_setFlightModeAndValidate(), missionFlightMode(), and QGC::showAppMessage().

◆ startTakeoff()

void PX4FirmwarePlugin::startTakeoff ( Vehicle * vehicle) const
overridevirtual

Command the vehicle to start a takeoff.

Reimplemented from FirmwarePlugin.

Definition at line 602 of file PX4FirmwarePlugin.cc.

References FirmwarePlugin::_armVehicleAndValidate(), FirmwarePlugin::_setFlightModeAndValidate(), QGC::showAppMessage(), and takeOffFlightMode().

◆ supportedMissionCommands()

QList< MAV_CMD > PX4FirmwarePlugin::supportedMissionCommands ( QGCMAVLink::VehicleClass_t ) const
overridevirtual

List of supported mission commands. Empty list for all commands supported.

Reimplemented from FirmwarePlugin.

Definition at line 202 of file PX4FirmwarePlugin.cc.

References SettingsManager::instance(), QGCMAVLink::VehicleClassFixedWing, QGCMAVLinkTypes::VehicleClassGeneric, QGCMAVLink::VehicleClassMultiRotor, and QGCMAVLink::VehicleClassVTOL.

◆ supportsNegativeThrust()

bool PX4FirmwarePlugin::supportsNegativeThrust ( Vehicle * ) const
overridevirtual

Returns true if the vehicle and firmware supports the use of negative thrust Typically supported rover.

Reimplemented from FirmwarePlugin.

Definition at line 768 of file PX4FirmwarePlugin.cc.

References Vehicle::vehicleType().

◆ takeControlFlightMode()

QString PX4FirmwarePlugin::takeControlFlightMode ( void ) const
overridevirtual

Returns the flight mode to use when the operator wants to take back control from autonomouse flight.

Reimplemented from FirmwarePlugin.

Definition at line 655 of file PX4FirmwarePlugin.cc.

References FirmwarePlugin::_modeEnumToString, and PX4CustomMode::MANUAL.

◆ takeOffFlightMode()

QString PX4FirmwarePlugin::takeOffFlightMode ( void ) const
overridevirtual

Returns the flight mode for TakeOff.

Reimplemented from FirmwarePlugin.

Definition at line 670 of file PX4FirmwarePlugin.cc.

References FirmwarePlugin::_modeEnumToString, and PX4CustomMode::AUTO_TAKEOFF.

Referenced by isGuidedMode(), and startTakeoff().

◆ updateAvailableFlightModes()

Member Data Documentation

◆ kExternalFlightModeCount

int PX4FirmwarePlugin::kExternalFlightModeCount = 8
staticconstexpr

Number of PX4 External Mode slots. PX4FirmwarePlugin.cc checks it against px4_custom_mode.h.

Definition at line 73 of file PX4FirmwarePlugin.h.

Referenced by externalFlightModeName(), externalFlightModeNames(), and PX4FlightModeConfig::externalModeIndex().


The documentation for this class was generated from the following files: