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
a93fec8d
Commit
a93fec8d
authored
May 05, 2017
by
Don Gagne
Committed by
GitHub
May 05, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5093 from DonLakeFlyer/LandAbort
Land abort sliders pop up based on new mavlink landing state
parents
e98e7dde
f56819fb
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
12 deletions
+43
-12
APMFirmwarePlugin.cc
src/FirmwarePlugin/APM/APMFirmwarePlugin.cc
+1
-1
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+6
-0
GuidedActionsController.qml
src/FlightDisplay/GuidedActionsController.qml
+2
-1
SimpleItemEditor.qml
src/PlanView/SimpleItemEditor.qml
+1
-1
Vehicle.cc
src/Vehicle/Vehicle.cc
+23
-6
Vehicle.h
src/Vehicle/Vehicle.h
+10
-3
No files found.
src/FirmwarePlugin/APM/APMFirmwarePlugin.cc
View file @
a93fec8d
...
...
@@ -444,7 +444,7 @@ void APMFirmwarePlugin::_handleIncomingHeartbeat(Vehicle* vehicle, mavlink_messa
}
}
vehicle
->
setFlying
(
flying
);
vehicle
->
_
setFlying
(
flying
);
}
bool
APMFirmwarePlugin
::
adjustIncomingMavlinkMessage
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
)
...
...
src/FlightDisplay/FlightDisplayView.qml
View file @
a93fec8d
...
...
@@ -525,6 +525,12 @@ QGCView {
confirmAction
(
actionResumeMission
)
}
}
onShowLandAbortChanged
:
{
if
(
showLandAbort
)
{
confirmAction
(
actionLandAbort
)
}
}
}
GuidedActionConfirm
{
...
...
src/FlightDisplay/GuidedActionsController.qml
View file @
a93fec8d
...
...
@@ -92,7 +92,7 @@ Item {
property
bool
showPause
:
_activeVehicle
&&
_vehicleArmed
&&
_activeVehicle
.
pauseVehicleSupported
&&
_vehicleFlying
&&
!
_vehiclePaused
property
bool
showChangeAlt
:
(
_activeVehicle
&&
_vehicleFlying
)
&&
_activeVehicle
.
guidedModeSupported
&&
_vehicleArmed
&&
!
_missionActive
property
bool
showOrbit
:
!
_hideOrbit
&&
_activeVehicle
&&
_vehicleFlying
&&
_activeVehicle
.
orbitModeSupported
&&
_vehicleArmed
&&
!
_missionActive
property
bool
showLandAbort
:
_activeVehicle
&&
_vehicleFlying
&&
_activeVehicle
.
fixedWing
property
bool
showLandAbort
:
_activeVehicle
&&
_vehicleFlying
&&
_activeVehicle
.
fixedWing
&&
_vehicleLanding
property
bool
showGotoLocation
:
_activeVehicle
&&
_activeVehicle
.
guidedMode
&&
_vehicleFlying
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
...
...
@@ -101,6 +101,7 @@ Item {
property
bool
_missionActive
:
_activeVehicle
?
_vehicleArmed
&&
(
_vehicleInLandMode
||
_vehicleInRTLMode
||
_vehicleInMissionMode
)
:
false
property
bool
_vehicleArmed
:
_activeVehicle
?
_activeVehicle
.
armed
:
false
property
bool
_vehicleFlying
:
_activeVehicle
?
_activeVehicle
.
flying
:
false
property
bool
_vehicleLanding
:
_activeVehicle
?
_activeVehicle
.
landing
:
false
property
bool
_vehiclePaused
:
false
property
bool
_vehicleInMissionMode
:
false
property
bool
_vehicleInRTLMode
:
false
...
...
src/PlanView/SimpleItemEditor.qml
View file @
a93fec8d
...
...
@@ -13,7 +13,7 @@ import QGroundControl.Palette 1.0
// Editor for Simple mission items
Rectangle
{
width
:
availableWidth
height
:
valuesColumn
.
height
+
_margin
height
:
valuesColumn
.
height
+
(
_margin
*
2
)
color
:
qgcPal
.
windowShadeDark
radius
:
_radius
...
...
src/Vehicle/Vehicle.cc
View file @
a93fec8d
...
...
@@ -94,6 +94,7 @@ Vehicle::Vehicle(LinkInterface* link,
,
_rcRSSIstore
(
255
)
,
_autoDisconnect
(
false
)
,
_flying
(
false
)
,
_landing
(
false
)
,
_onboardControlSensorsPresent
(
0
)
,
_onboardControlSensorsEnabled
(
0
)
,
_onboardControlSensorsHealth
(
0
)
...
...
@@ -254,6 +255,7 @@ Vehicle::Vehicle(MAV_AUTOPILOT firmwareType,
,
_rcRSSIstore
(
255
)
,
_autoDisconnect
(
false
)
,
_flying
(
false
)
,
_landing
(
false
)
,
_onboardControlSensorsPresent
(
0
)
,
_onboardControlSensorsEnabled
(
0
)
,
_onboardControlSensorsHealth
(
0
)
...
...
@@ -831,14 +833,21 @@ void Vehicle::_handleExtendedSysState(mavlink_message_t& message)
mavlink_msg_extended_sys_state_decode
(
&
message
,
&
extendedState
);
switch
(
extendedState
.
landed_state
)
{
case
MAV_LANDED_STATE_UNDEFINED
:
break
;
case
MAV_LANDED_STATE_ON_GROUND
:
setFlying
(
false
);
_setFlying
(
false
);
_setLanding
(
false
);
break
;
case
MAV_LANDED_STATE_TAKEOFF
:
case
MAV_LANDED_STATE_IN_AIR
:
setFlying
(
true
);
return
;
_setFlying
(
true
);
_setLanding
(
false
);
break
;
case
MAV_LANDED_STATE_LANDING
:
_setFlying
(
true
);
_setLanding
(
true
);
break
;
default:
break
;
}
}
...
...
@@ -1962,7 +1971,7 @@ void Vehicle::_announceArmedChanged(bool armed)
_say
(
QString
(
"%1 %2"
).
arg
(
_vehicleIdSpeech
()).
arg
(
armed
?
QStringLiteral
(
"armed"
)
:
QStringLiteral
(
"disarmed"
)));
}
void
Vehicle
::
setFlying
(
bool
flying
)
void
Vehicle
::
_
setFlying
(
bool
flying
)
{
if
(
armed
()
&&
_flying
!=
flying
)
{
_flying
=
flying
;
...
...
@@ -1970,6 +1979,14 @@ void Vehicle::setFlying(bool flying)
}
}
void
Vehicle
::
_setLanding
(
bool
landing
)
{
if
(
armed
()
&&
_landing
!=
landing
)
{
_landing
=
landing
;
emit
landingChanged
(
landing
);
}
}
bool
Vehicle
::
guidedModeSupported
(
void
)
const
{
return
_firmwarePlugin
->
isCapable
(
this
,
FirmwarePlugin
::
GuidedModeCapability
);
...
...
src/Vehicle/Vehicle.h
View file @
a93fec8d
...
...
@@ -314,10 +314,13 @@ public:
Q_PROPERTY
(
QVariantList
cameraList
READ
cameraList
CONSTANT
)
/// true: Vehicle is flying, false: Vehicle is on ground
Q_PROPERTY
(
bool
flying
READ
flying
WRITE
setFlying
NOTIFY
flyingChanged
)
Q_PROPERTY
(
bool
flying
READ
flying
NOTIFY
flyingChanged
)
/// true: Vehicle is flying, false: Vehicle is on ground
Q_PROPERTY
(
bool
landing
READ
landing
NOTIFY
landingChanged
)
/// true: Vehicle is in Guided mode and can respond to guided commands, false: vehicle cannot respond to direct control commands
Q_PROPERTY
(
bool
guidedMode
READ
guidedMode
WRITE
setGuidedMode
NOTIFY
guidedModeChanged
)
Q_PROPERTY
(
bool
guidedMode
READ
guidedMode
WRITE
setGuidedMode
NOTIFY
guidedModeChanged
)
/// true: Guided mode commands are supported by this vehicle
Q_PROPERTY
(
bool
guidedModeSupported
READ
guidedModeSupported
CONSTANT
)
...
...
@@ -516,7 +519,6 @@ public:
bool
supportsCalibratePressure
(
void
)
const
;
bool
supportsMotorInterference
(
void
)
const
;
void
setFlying
(
bool
flying
);
void
setGuidedMode
(
bool
guidedMode
);
QString
prearmError
(
void
)
const
{
return
_prearmError
;
}
...
...
@@ -566,6 +568,7 @@ public:
uint
messagesSent
()
{
return
_messagesSent
;
}
uint
messagesLost
()
{
return
_messagesLost
;
}
bool
flying
()
const
{
return
_flying
;
}
bool
landing
()
const
{
return
_landing
;
}
bool
guidedMode
()
const
;
uint8_t
baseMode
()
const
{
return
_base_mode
;
}
uint32_t
customMode
()
const
{
return
_custom_mode
;
}
...
...
@@ -674,6 +677,8 @@ public:
/// @return: true: initial request is complete, false: initial request is still in progress;
bool
initialPlanRequestComplete
(
void
)
const
{
return
_initialPlanRequestComplete
;
}
void
_setFlying
(
bool
flying
);
void
_setLanding
(
bool
landing
);
void
_setHomePosition
(
QGeoCoordinate
&
homeCoord
);
signals:
...
...
@@ -693,6 +698,7 @@ signals:
void
connectionLostEnabledChanged
(
bool
connectionLostEnabled
);
void
autoDisconnectChanged
(
bool
autoDisconnectChanged
);
void
flyingChanged
(
bool
flying
);
void
landingChanged
(
bool
landing
);
void
guidedModeChanged
(
bool
guidedMode
);
void
prearmErrorChanged
(
const
QString
&
prearmError
);
void
soloFirmwareChanged
(
bool
soloFirmware
);
...
...
@@ -880,6 +886,7 @@ private:
double
_rcRSSIstore
;
bool
_autoDisconnect
;
///< true: Automatically disconnect vehicle when last connection goes away or lost heartbeat
bool
_flying
;
bool
_landing
;
uint32_t
_onboardControlSensorsPresent
;
uint32_t
_onboardControlSensorsEnabled
;
uint32_t
_onboardControlSensorsHealth
;
...
...
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