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
1fe0ede4
Commit
1fe0ede4
authored
Mar 20, 2017
by
Donald Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MissionCmdUIInfo: New support for specifiesAltitudeOnly
parent
b97caf30
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
63 additions
and
59 deletions
+63
-59
MavCmdInfoFixedWing.json
src/FirmwarePlugin/APM/MavCmdInfoFixedWing.json
+4
-4
MavCmdInfoMultiRotor.json
src/FirmwarePlugin/APM/MavCmdInfoMultiRotor.json
+5
-4
MavCmdInfoFixedWing.json
src/FirmwarePlugin/PX4/MavCmdInfoFixedWing.json
+5
-14
FixedWingLandingComplexItem.h
src/MissionManager/FixedWingLandingComplexItem.h
+1
-0
MavCmdInfoCommon.json
src/MissionManager/MavCmdInfoCommon.json
+15
-24
MissionSettingsComplexItem.h
src/MissionManager/MissionSettingsComplexItem.h
+1
-0
SimpleMissionItem.cc
src/MissionManager/SimpleMissionItem.cc
+25
-11
SimpleMissionItem.h
src/MissionManager/SimpleMissionItem.h
+1
-0
SurveyMissionItem.h
src/MissionManager/SurveyMissionItem.h
+1
-0
VisualMissionItem.h
src/MissionManager/VisualMissionItem.h
+5
-2
No files found.
src/FirmwarePlugin/APM/MavCmdInfoFixedWing.json
View file @
1fe0ede4
...
...
@@ -15,10 +15,10 @@
"paramRemove"
:
"4"
},
{
"id"
:
22
,
"comment"
:
"MAV_CMD_NAV_TAKEOFF"
,
"specifiesCoordinate"
:
false
,
"
paramRemove"
:
"2,3,4,5,6"
"id"
:
22
,
"comment"
:
"MAV_CMD_NAV_TAKEOFF"
,
"specifiesCoordinate"
:
false
,
"
specifiesAltitudeOnly"
:
true
},
{
"id"
:
82
,
...
...
src/FirmwarePlugin/APM/MavCmdInfoMultiRotor.json
View file @
1fe0ede4
...
...
@@ -30,10 +30,11 @@
"paramRemove"
:
"1,4"
},
{
"id"
:
22
,
"comment"
:
"MAV_CMD_NAV_TAKEOFF"
,
"specifiesCoordinate"
:
false
,
"paramRemove"
:
"1,2,3,4,5,6"
"id"
:
22
,
"comment"
:
"MAV_CMD_NAV_TAKEOFF"
,
"specifiesCoordinate"
:
false
,
"specifiesAltitudeOnly"
:
true
,
"paramRemove"
:
"1,2,3,4"
},
{
"id"
:
31
,
...
...
src/FirmwarePlugin/PX4/MavCmdInfoFixedWing.json
View file @
1fe0ede4
...
...
@@ -5,20 +5,11 @@
"mavCmdInfo"
:
[
{
"id"
:
21
,
"comment"
:
"MAV_CMD_NAV_LAND"
,
"paramRemove"
:
"1,4"
,
"param7"
:
{
"label"
:
"Altitude"
,
"units"
:
"m"
,
"default"
:
0
,
"decimalPlaces"
:
1
}
},
{
"id"
:
22
,
"comment"
:
"MAV_CMD_NAV_TAKEOFF"
,
"paramRemove"
:
"4"
"id"
:
21
,
"comment"
:
"MAV_CMD_NAV_LAND"
,
"paramRemove"
:
"1,4"
,
"specifiesCoordinate"
:
false
,
"specifiesAltitudeOnly"
:
true
}
]
}
src/MissionManager/FixedWingLandingComplexItem.h
View file @
1fe0ede4
...
...
@@ -64,6 +64,7 @@ public:
bool
isSimpleItem
(
void
)
const
final
{
return
false
;
}
bool
isStandaloneCoordinate
(
void
)
const
final
{
return
false
;
}
bool
specifiesCoordinate
(
void
)
const
final
;
bool
specifiesAltitudeOnly
(
void
)
const
final
{
return
false
;
}
QString
commandDescription
(
void
)
const
final
{
return
"Landing Pattern"
;
}
QString
commandName
(
void
)
const
final
{
return
"Landing Pattern"
;
}
QString
abbreviation
(
void
)
const
final
{
return
"L"
;
}
...
...
src/MissionManager/MavCmdInfoCommon.json
View file @
1fe0ede4
...
...
@@ -182,25 +182,20 @@
{
"id"
:
24
,
"rawName"
:
"MAV_CMD_NAV_TAKEOFF_LOCAL", "friendlyName"
:
"Takeoff local"
},
{
"id"
:
25
,
"rawName"
:
"MAV_CMD_NAV_FOLLOW", "friendlyName"
:
"Nav follow"
},
{
"id"
:
30
,
"rawName"
:
"MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT"
,
"friendlyName"
:
"Change Altitude"
,
"description"
:
"Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command."
,
"specifiesCoordinate"
:
false
,
"friendlyEdit"
:
true
,
"category"
:
"Flight control"
,
"id"
:
30
,
"rawName"
:
"MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT"
,
"friendlyName"
:
"Change Altitude"
,
"description"
:
"Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command."
,
"specifiesCoordinate"
:
false
,
"specifiesAltitudeOnly"
:
true
,
"friendlyEdit"
:
true
,
"category"
:
"Flight control"
,
"param1"
:
{
"label"
:
"Mode"
,
"enumStrings"
:
"Climb,Neutral,Descend"
,
"enumValues"
:
"1,0,2"
,
"default"
:
1
,
"decimalPlaces"
:
0
},
"param7"
:
{
"label"
:
"Altitude"
,
"units"
:
"m"
,
"default"
:
55
,
"decimalPlaces"
:
2
}
},
{
...
...
@@ -391,22 +386,18 @@
}
},
{
"id"
:
113
,
"rawName"
:
"MAV_CMD_CONDITION_CHANGE_ALT"
,
"description"
:
"Delay the mission until the specified altitide is reached."
,
"friendlyName"
:
"Wait for altitude"
,
"category"
:
"Conditionals"
,
"id"
:
113
,
"rawName"
:
"MAV_CMD_CONDITION_CHANGE_ALT"
,
"description"
:
"Delay the mission until the specified altitide is reached."
,
"friendlyName"
:
"Wait for altitude"
,
"category"
:
"Conditionals"
,
"specifiesCoordinate"
:
false
,
"specifiesAltitudeOnly"
:
true
,
"param1"
:
{
"label"
:
"Rate"
,
"units"
:
"m/s"
,
"default"
:
5
,
"decimalPlaces"
:
2
},
"param7"
:
{
"label"
:
"Altitude"
,
"units"
:
"m"
,
"default"
:
55
,
"decimalPlaces"
:
2
}
},
{
...
...
src/MissionManager/MissionSettingsComplexItem.h
View file @
1fe0ede4
...
...
@@ -69,6 +69,7 @@ public:
bool
isSimpleItem
(
void
)
const
final
{
return
false
;
}
bool
isStandaloneCoordinate
(
void
)
const
final
{
return
false
;
}
bool
specifiesCoordinate
(
void
)
const
final
;
bool
specifiesAltitudeOnly
(
void
)
const
final
{
return
false
;
}
QString
commandDescription
(
void
)
const
final
{
return
"Mission Settings"
;
}
QString
commandName
(
void
)
const
final
{
return
"Mission Settings"
;
}
QString
abbreviation
(
void
)
const
final
{
return
"H"
;
}
...
...
src/MissionManager/SimpleMissionItem.cc
View file @
1fe0ede4
...
...
@@ -185,6 +185,7 @@ void SimpleMissionItem::_connectSignals(void)
connect
(
&
_missionItem
.
_commandFact
,
&
Fact
::
valueChanged
,
this
,
&
SimpleMissionItem
::
commandDescriptionChanged
);
connect
(
&
_missionItem
.
_commandFact
,
&
Fact
::
valueChanged
,
this
,
&
SimpleMissionItem
::
abbreviationChanged
);
connect
(
&
_missionItem
.
_commandFact
,
&
Fact
::
valueChanged
,
this
,
&
SimpleMissionItem
::
specifiesCoordinateChanged
);
connect
(
&
_missionItem
.
_commandFact
,
&
Fact
::
valueChanged
,
this
,
&
SimpleMissionItem
::
specifiesAltitudeOnlyChanged
);
connect
(
&
_missionItem
.
_commandFact
,
&
Fact
::
valueChanged
,
this
,
&
SimpleMissionItem
::
isStandaloneCoordinateChanged
);
// Whenever these properties change the ui model changes as well
...
...
@@ -296,6 +297,16 @@ bool SimpleMissionItem::specifiesCoordinate(void) const
}
}
bool
SimpleMissionItem
::
specifiesAltitudeOnly
(
void
)
const
{
const
MissionCommandUIInfo
*
uiInfo
=
_commandTree
->
getUIInfo
(
_vehicle
,
(
MAV_CMD
)
command
());
if
(
uiInfo
)
{
return
uiInfo
->
specifiesAltitudeOnly
();
}
else
{
return
false
;
}
}
QString
SimpleMissionItem
::
commandDescription
(
void
)
const
{
const
MissionCommandUIInfo
*
uiInfo
=
_commandTree
->
getUIInfo
(
_vehicle
,
(
MAV_CMD
)
command
());
...
...
@@ -392,9 +403,10 @@ QmlObjectListModel* SimpleMissionItem::textFieldFacts(void)
Fact
*
rgParamFacts
[
7
]
=
{
&
_missionItem
.
_param1Fact
,
&
_missionItem
.
_param2Fact
,
&
_missionItem
.
_param3Fact
,
&
_missionItem
.
_param4Fact
,
&
_missionItem
.
_param5Fact
,
&
_missionItem
.
_param6Fact
,
&
_missionItem
.
_param7Fact
};
FactMetaData
*
rgParamMetaData
[
7
]
=
{
&
_param1MetaData
,
&
_param2MetaData
,
&
_param3MetaData
,
&
_param4MetaData
,
&
_param5MetaData
,
&
_param6MetaData
,
&
_param7MetaData
};
bool
altitudeAdded
=
false
;
const
MissionCommandUIInfo
*
uiInfo
=
_commandTree
->
getUIInfo
(
_vehicle
,
command
);
for
(
int
i
=
1
;
i
<=
7
;
i
++
)
{
const
MissionCmdParamInfo
*
paramInfo
=
_commandTree
->
getUIInfo
(
_vehicle
,
command
)
->
getParamInfo
(
i
);
const
MissionCmdParamInfo
*
paramInfo
=
uiInfo
->
getParamInfo
(
i
);
if
(
paramInfo
&&
paramInfo
->
enumStrings
().
count
()
==
0
)
{
Fact
*
paramFact
=
rgParamFacts
[
i
-
1
];
...
...
@@ -406,14 +418,10 @@ QmlObjectListModel* SimpleMissionItem::textFieldFacts(void)
paramMetaData
->
setRawUnits
(
paramInfo
->
units
());
paramFact
->
setMetaData
(
paramMetaData
);
model
->
append
(
paramFact
);
if
(
i
==
7
)
{
altitudeAdded
=
true
;
}
}
}
if
(
specifiesCoordinate
()
&&
!
altitudeAdded
)
{
if
(
uiInfo
->
specifiesCoordinate
()
||
uiInfo
->
specifiesAltitudeOnly
()
)
{
_missionItem
.
_param7Fact
.
_setName
(
"Altitude"
);
_missionItem
.
_param7Fact
.
setMetaData
(
_altitudeMetaData
);
model
->
append
(
&
_missionItem
.
_param7Fact
);
...
...
@@ -430,7 +438,7 @@ QmlObjectListModel* SimpleMissionItem::checkboxFacts(void)
if
(
rawEdit
())
{
model
->
append
(
&
_missionItem
.
_autoContinueFact
);
}
else
if
(
specifiesCoordinate
(
)
&&
!
_homePositionSpecialCase
)
{
}
else
if
(
(
specifiesCoordinate
()
||
specifiesAltitudeOnly
()
)
&&
!
_homePositionSpecialCase
)
{
model
->
append
(
&
_altitudeRelativeToHomeFact
);
}
...
...
@@ -483,7 +491,7 @@ bool SimpleMissionItem::friendlyEditAllowed(void) const
return
false
;
}
if
(
specifiesCoordinate
())
{
if
(
specifiesCoordinate
()
||
specifiesAltitudeOnly
()
)
{
return
_missionItem
.
frame
()
==
MAV_FRAME_GLOBAL
||
_missionItem
.
frame
()
==
MAV_FRAME_GLOBAL_RELATIVE_ALT
;
}
...
...
@@ -560,14 +568,20 @@ void SimpleMissionItem::setDefaultsForCommand(void)
}
}
if
(
command
==
MAV_CMD_NAV_WAYPOINT
)
{
switch
(
command
)
{
case
MAV_CMD_NAV_WAYPOINT
:
// We default all acceptance radius to 0. This allows flight controller to be in control of
// accept radius.
_missionItem
.
setParam2
(
0
);
break
;
case
MAV_CMD_NAV_LAND
:
_missionItem
.
setParam7
(
0
);
break
;
}
_missionItem
.
setAutoContinue
(
true
);
_missionItem
.
setFrame
(
specifiesCoordinate
(
)
?
MAV_FRAME_GLOBAL_RELATIVE_ALT
:
MAV_FRAME_MISSION
);
_missionItem
.
setFrame
(
(
specifiesCoordinate
()
||
specifiesAltitudeOnly
()
)
?
MAV_FRAME_GLOBAL_RELATIVE_ALT
:
MAV_FRAME_MISSION
);
setRawEdit
(
false
);
}
...
...
src/MissionManager/SimpleMissionItem.h
View file @
1fe0ede4
...
...
@@ -87,6 +87,7 @@ public:
bool
isSimpleItem
(
void
)
const
final
{
return
true
;
}
bool
isStandaloneCoordinate
(
void
)
const
final
;
bool
specifiesCoordinate
(
void
)
const
final
;
bool
specifiesAltitudeOnly
(
void
)
const
final
;
QString
commandDescription
(
void
)
const
final
;
QString
commandName
(
void
)
const
final
;
QString
abbreviation
(
void
)
const
final
;
...
...
src/MissionManager/SurveyMissionItem.h
View file @
1fe0ede4
...
...
@@ -110,6 +110,7 @@ public:
bool
isSimpleItem
(
void
)
const
final
{
return
false
;
}
bool
isStandaloneCoordinate
(
void
)
const
final
{
return
false
;
}
bool
specifiesCoordinate
(
void
)
const
final
;
bool
specifiesAltitudeOnly
(
void
)
const
final
{
return
false
;
}
QString
commandDescription
(
void
)
const
final
{
return
"Survey"
;
}
QString
commandName
(
void
)
const
final
{
return
"Survey"
;
}
QString
abbreviation
(
void
)
const
final
{
return
"S"
;
}
...
...
src/MissionManager/VisualMissionItem.h
View file @
1fe0ede4
...
...
@@ -80,8 +80,9 @@ public:
Q_PROPERTY
(
bool
dirty
READ
dirty
WRITE
setDirty
NOTIFY
dirtyChanged
)
///< Item is dirty and requires save/send
Q_PROPERTY
(
bool
isCurrentItem
READ
isCurrentItem
WRITE
setIsCurrentItem
NOTIFY
isCurrentItemChanged
)
Q_PROPERTY
(
int
sequenceNumber
READ
sequenceNumber
WRITE
setSequenceNumber
NOTIFY
sequenceNumberChanged
)
Q_PROPERTY
(
bool
specifiesCoordinate
READ
specifiesCoordinate
NOTIFY
specifiesCoordinateChanged
)
///< Item is associated with a coordinate position
Q_PROPERTY
(
bool
isStandaloneCoordinate
READ
isStandaloneCoordinate
NOTIFY
isStandaloneCoordinateChanged
)
///< Waypoint line does not go through item
Q_PROPERTY
(
bool
specifiesCoordinate
READ
specifiesCoordinate
NOTIFY
specifiesCoordinateChanged
)
///< true: Item is associated with a coordinate position
Q_PROPERTY
(
bool
isStandaloneCoordinate
READ
isStandaloneCoordinate
NOTIFY
isStandaloneCoordinateChanged
)
///< true: Waypoint line does not go through item
Q_PROPERTY
(
bool
specifiesAltitudeOnly
READ
specifiesAltitudeOnly
NOTIFY
specifiesAltitudeOnlyChanged
)
///< true: Item has altitude only, no full coordinate
Q_PROPERTY
(
bool
isSimpleItem
READ
isSimpleItem
NOTIFY
isSimpleItemChanged
)
///< Simple or Complex MissionItem
Q_PROPERTY
(
QString
editorQml
MEMBER
_editorQml
CONSTANT
)
///< Qml code for editing this item
Q_PROPERTY
(
QString
mapVisualQML
READ
mapVisualQML
CONSTANT
)
///< QMl code for map visuals
...
...
@@ -119,6 +120,7 @@ public:
virtual
bool
isSimpleItem
(
void
)
const
=
0
;
virtual
bool
isStandaloneCoordinate
(
void
)
const
=
0
;
virtual
bool
specifiesCoordinate
(
void
)
const
=
0
;
virtual
bool
specifiesAltitudeOnly
(
void
)
const
=
0
;;
virtual
QString
commandDescription
(
void
)
const
=
0
;
virtual
QString
commandName
(
void
)
const
=
0
;
virtual
QString
abbreviation
(
void
)
const
=
0
;
...
...
@@ -169,6 +171,7 @@ signals:
void
isSimpleItemChanged
(
bool
isSimpleItem
);
void
specifiesCoordinateChanged
(
void
);
void
isStandaloneCoordinateChanged
(
void
);
void
specifiesAltitudeOnlyChanged
(
void
);
void
flightSpeedChanged
(
double
flightSpeed
);
void
lastSequenceNumberChanged
(
int
sequenceNumber
);
...
...
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