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
6e492101
Unverified
Commit
6e492101
authored
Dec 11, 2017
by
Don Gagne
Committed by
GitHub
Dec 11, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5848 from patrickelectric/mission_tkoff
MissionController: Add takeoff only with supported vehicles
parents
852bec5c
bbff4468
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
3 deletions
+41
-3
ArduSubFirmwarePlugin.cc
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc
+32
-0
ArduSubFirmwarePlugin.h
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h
+2
-0
MissionController.cc
src/MissionManager/MissionController.cc
+7
-3
No files found.
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc
View file @
6e492101
...
...
@@ -116,6 +116,38 @@ ArduSubFirmwarePlugin::ArduSubFirmwarePlugin(void):
_nameToFactGroupMap
.
insert
(
"APMSubInfo"
,
&
_infoFactGroup
);
}
QList
<
MAV_CMD
>
ArduSubFirmwarePlugin
::
supportedMissionCommands
(
void
)
{
QList
<
MAV_CMD
>
list
;
list
<<
MAV_CMD_NAV_WAYPOINT
<<
MAV_CMD_NAV_RETURN_TO_LAUNCH
<<
MAV_CMD_NAV_LAND
<<
MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT
<<
MAV_CMD_NAV_SPLINE_WAYPOINT
<<
MAV_CMD_NAV_GUIDED_ENABLE
<<
MAV_CMD_NAV_DELAY
<<
MAV_CMD_CONDITION_DELAY
<<
MAV_CMD_CONDITION_DISTANCE
<<
MAV_CMD_CONDITION_YAW
<<
MAV_CMD_DO_SET_MODE
<<
MAV_CMD_DO_JUMP
<<
MAV_CMD_DO_CHANGE_SPEED
<<
MAV_CMD_DO_SET_HOME
<<
MAV_CMD_DO_SET_RELAY
<<
MAV_CMD_DO_REPEAT_RELAY
<<
MAV_CMD_DO_SET_SERVO
<<
MAV_CMD_DO_REPEAT_SERVO
<<
MAV_CMD_DO_LAND_START
<<
MAV_CMD_DO_SET_ROI
<<
MAV_CMD_DO_DIGICAM_CONFIGURE
<<
MAV_CMD_DO_DIGICAM_CONTROL
<<
MAV_CMD_DO_MOUNT_CONTROL
<<
MAV_CMD_DO_SET_CAM_TRIGG_DIST
<<
MAV_CMD_DO_FENCE_ENABLE
<<
MAV_CMD_DO_INVERTED_FLIGHT
<<
MAV_CMD_DO_GRIPPER
<<
MAV_CMD_DO_GUIDED_LIMITS
<<
MAV_CMD_DO_AUTOTUNE_ENABLE
;
return
list
;
}
int
ArduSubFirmwarePlugin
::
remapParamNameHigestMinorVersionNumber
(
int
majorVersionNumber
)
const
{
// Remapping supports up to 3.5
...
...
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h
View file @
6e492101
...
...
@@ -100,6 +100,8 @@ class ArduSubFirmwarePlugin : public APMFirmwarePlugin
public:
ArduSubFirmwarePlugin
(
void
);
QList
<
MAV_CMD
>
supportedMissionCommands
(
void
);
// Overrides from FirmwarePlugin
int
manualControlReservedButtonCount
(
void
)
final
;
...
...
src/MissionManager/MissionController.cc
View file @
6e492101
...
...
@@ -340,7 +340,10 @@ int MissionController::insertSimpleMissionItem(QGeoCoordinate coordinate, int i)
newItem
->
setCommand
(
MavlinkQmlSingleton
::
MAV_CMD_NAV_WAYPOINT
);
_initVisualItem
(
newItem
);
if
(
_visualItems
->
count
()
==
1
)
{
newItem
->
setCommand
(
_controllerVehicle
->
vtol
()
?
MavlinkQmlSingleton
::
MAV_CMD_NAV_VTOL_TAKEOFF
:
MavlinkQmlSingleton
::
MAV_CMD_NAV_TAKEOFF
);
MavlinkQmlSingleton
::
Qml_MAV_CMD
takeoffCmd
=
_controllerVehicle
->
vtol
()
?
MavlinkQmlSingleton
::
MAV_CMD_NAV_VTOL_TAKEOFF
:
MavlinkQmlSingleton
::
MAV_CMD_NAV_TAKEOFF
;
if
(
_controllerVehicle
->
firmwarePlugin
()
->
supportedMissionCommands
().
contains
((
MAV_CMD
)
takeoffCmd
))
{
newItem
->
setCommand
(
takeoffCmd
);
}
}
newItem
->
setDefaultsForCommand
();
if
((
MAV_CMD
)
newItem
->
command
()
==
MAV_CMD_NAV_WAYPOINT
)
{
...
...
@@ -1033,8 +1036,9 @@ void MissionController::_recalcWaypointLines(void)
// If we still haven't found the first coordinate item and we hit a takeoff command, link back to home
if
(
firstCoordinateItem
&&
item
->
isSimpleItem
()
&&
(
qobject_cast
<
SimpleMissionItem
*>
(
item
)
->
command
()
==
MavlinkQmlSingleton
::
MAV_CMD_NAV_TAKEOFF
||
qobject_cast
<
SimpleMissionItem
*>
(
item
)
->
command
()
==
MavlinkQmlSingleton
::
MAV_CMD_NAV_VTOL_TAKEOFF
))
{
(
!
_controllerVehicle
->
firmwarePlugin
()
->
supportedMissionCommands
().
contains
(
MAV_CMD_NAV_TAKEOFF
)
||
qobject_cast
<
SimpleMissionItem
*>
(
item
)
->
command
()
==
MavlinkQmlSingleton
::
MAV_CMD_NAV_TAKEOFF
||
qobject_cast
<
SimpleMissionItem
*>
(
item
)
->
command
()
==
MavlinkQmlSingleton
::
MAV_CMD_NAV_VTOL_TAKEOFF
))
{
linkStartToHome
=
true
;
}
...
...
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