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
1da21bda
Commit
1da21bda
authored
Dec 03, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add concept of standalone coordinate
Standalone coordinate don’t connect to waypoint lines
parent
039d61c0
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
32 deletions
+48
-32
MavCmdInfo.json
src/MissionManager/MavCmdInfo.json
+6
-4
MissionCommands.cc
src/MissionManager/MissionCommands.cc
+5
-2
MissionCommands.h
src/MissionManager/MissionCommands.h
+11
-7
MissionController.cc
src/MissionManager/MissionController.cc
+2
-2
MissionItem.cc
src/MissionManager/MissionItem.cc
+5
-0
MissionItem.h
src/MissionManager/MissionItem.h
+19
-17
No files found.
src/MissionManager/MavCmdInfo.json
View file @
1da21bda
...
...
@@ -150,6 +150,7 @@
"friendlyName"
:
"Region of interest (nav)"
,
"description"
:
"Sets the region of interest for cameras."
,
"specifiesCoordinate"
:
true
,
"standaloneCoordinate"
:
true
,
"friendlyEdit"
:
true
,
"category"
:
"Camera"
,
"param1"
:
{
...
...
@@ -398,6 +399,7 @@
"friendlyName"
:
"Region of interest (cmd)"
,
"description"
:
"Sets the region of interest for cameras."
,
"specifiesCoordinate"
:
true
,
"standaloneCoordinate"
:
true
,
"friendlyEdit"
:
true
,
"category"
:
"Camera"
,
"param1"
:
{
...
...
src/MissionManager/MissionCommands.cc
View file @
1da21bda
...
...
@@ -49,6 +49,7 @@ const QString MissionCommands::_param3JsonKey (QStringLiteral("par
const
QString
MissionCommands
::
_param4JsonKey
(
QStringLiteral
(
"param4"
));
const
QString
MissionCommands
::
_paramJsonKeyFormat
(
QStringLiteral
(
"param%1"
));
const
QString
MissionCommands
::
_rawNameJsonKey
(
QStringLiteral
(
"rawName"
));
const
QString
MissionCommands
::
_standaloneCoordinateJsonKey
(
QStringLiteral
(
"standaloneCoordinate"
));
const
QString
MissionCommands
::
_specifiesCoordinateJsonKey
(
QStringLiteral
(
"specifiesCoordinate"
));
const
QString
MissionCommands
::
_unitsJsonKey
(
QStringLiteral
(
"units"
));
const
QString
MissionCommands
::
_versionJsonKey
(
QStringLiteral
(
"version"
));
...
...
@@ -129,9 +130,9 @@ void MissionCommands::_loadMavCmdInfoJson(void)
QStringList
keys
;
QList
<
QJsonValue
::
Type
>
types
;
keys
<<
_idJsonKey
<<
_rawNameJsonKey
<<
_friendlyNameJsonKey
<<
_descriptionJsonKey
<<
_s
pecifiesCoordinateJsonKey
<<
_friendlyEditJsonKey
keys
<<
_idJsonKey
<<
_rawNameJsonKey
<<
_friendlyNameJsonKey
<<
_descriptionJsonKey
<<
_s
tandaloneCoordinateJsonKey
<<
_specifiesCoordinateJsonKey
<<
_friendlyEditJsonKey
<<
_param1JsonKey
<<
_param2JsonKey
<<
_param3JsonKey
<<
_param4JsonKey
<<
_categoryJsonKey
;
types
<<
QJsonValue
::
Double
<<
QJsonValue
::
String
<<
QJsonValue
::
String
<<
QJsonValue
::
String
<<
QJsonValue
::
Bool
<<
QJsonValue
::
Bool
types
<<
QJsonValue
::
Double
<<
QJsonValue
::
String
<<
QJsonValue
::
String
<<
QJsonValue
::
String
<<
QJsonValue
::
Bool
<<
QJsonValue
::
Bool
<<
QJsonValue
::
Bool
<<
QJsonValue
::
Object
<<
QJsonValue
::
Object
<<
QJsonValue
::
Object
<<
QJsonValue
::
Object
<<
QJsonValue
::
String
;
if
(
!
_validateKeyTypes
(
jsonObject
,
keys
,
types
))
{
return
;
...
...
@@ -144,6 +145,7 @@ void MissionCommands::_loadMavCmdInfoJson(void)
mavCmdInfo
->
_rawName
=
jsonObject
.
value
(
_rawNameJsonKey
).
toString
();
mavCmdInfo
->
_friendlyName
=
jsonObject
.
value
(
_friendlyNameJsonKey
).
toString
(
QString
());
mavCmdInfo
->
_description
=
jsonObject
.
value
(
_descriptionJsonKey
).
toString
(
QString
());
mavCmdInfo
->
_standaloneCoordinate
=
jsonObject
.
value
(
_standaloneCoordinateJsonKey
).
toBool
(
false
);
mavCmdInfo
->
_specifiesCoordinate
=
jsonObject
.
value
(
_specifiesCoordinateJsonKey
).
toBool
(
false
);
mavCmdInfo
->
_friendlyEdit
=
jsonObject
.
value
(
_friendlyEditJsonKey
).
toBool
(
false
);
...
...
@@ -153,6 +155,7 @@ void MissionCommands::_loadMavCmdInfoJson(void)
<<
mavCmdInfo
->
_rawName
<<
mavCmdInfo
->
_friendlyName
<<
mavCmdInfo
->
_description
<<
mavCmdInfo
->
_standaloneCoordinate
<<
mavCmdInfo
->
_specifiesCoordinate
<<
mavCmdInfo
->
_friendlyEdit
;
...
...
src/MissionManager/MissionCommands.h
View file @
1da21bda
...
...
@@ -94,6 +94,7 @@ public:
Q_PROPERTY
(
bool
friendlyEdit
READ
friendlyEdit
CONSTANT
)
Q_PROPERTY
(
QString
friendlyName
READ
friendlyName
CONSTANT
)
Q_PROPERTY
(
QString
rawName
READ
rawName
CONSTANT
)
Q_PROPERTY
(
bool
standaloneCoordinate
READ
standaloneCoordinate
CONSTANT
)
Q_PROPERTY
(
bool
specifiesCoordinate
READ
specifiesCoordinate
CONSTANT
)
QString
category
(
void
)
const
{
return
_category
;
}
...
...
@@ -102,6 +103,7 @@ public:
bool
friendlyEdit
(
void
)
const
{
return
_friendlyEdit
;
}
QString
friendlyName
(
void
)
const
{
return
_friendlyName
;
}
QString
rawName
(
void
)
const
{
return
_rawName
;
}
bool
standaloneCoordinate
(
void
)
const
{
return
_standaloneCoordinate
;
}
bool
specifiesCoordinate
(
void
)
const
{
return
_specifiesCoordinate
;
}
const
QMap
<
int
,
MavCmdParamInfo
*>&
paramInfoMap
(
void
)
const
{
return
_paramInfoMap
;
}
...
...
@@ -114,6 +116,7 @@ private:
QString
_friendlyName
;
QMap
<
int
,
MavCmdParamInfo
*>
_paramInfoMap
;
QString
_rawName
;
bool
_standaloneCoordinate
;
bool
_specifiesCoordinate
;
friend
class
MissionCommands
;
...
...
@@ -170,6 +173,7 @@ private:
static
const
QString
_param4JsonKey
;
static
const
QString
_paramJsonKeyFormat
;
static
const
QString
_rawNameJsonKey
;
static
const
QString
_standaloneCoordinateJsonKey
;
static
const
QString
_specifiesCoordinateJsonKey
;
static
const
QString
_unitsJsonKey
;
static
const
QString
_versionJsonKey
;
...
...
src/MissionManager/MissionController.cc
View file @
1da21bda
...
...
@@ -346,7 +346,7 @@ void MissionController::_recalcWaypointLines(void)
item
->
setAzimuth
(
0.0
);
item
->
setDistance
(
-
1.0
);
if
(
item
->
specifiesCoordinate
())
{
if
(
item
->
specifiesCoordinate
()
&&
!
item
->
standaloneCoordinate
()
)
{
if
(
firstCoordinateItem
)
{
if
(
item
->
command
()
==
MavlinkQmlSingleton
::
MAV_CMD_NAV_TAKEOFF
)
{
// The first coordinate we hit is a takeoff command so link back to home position if valid
...
...
@@ -628,7 +628,7 @@ bool MissionController::_findLastAltitude(double* lastAltitude)
for
(
int
i
=
0
;
i
<
_missionItems
->
count
();
i
++
)
{
MissionItem
*
item
=
qobject_cast
<
MissionItem
*>
(
_missionItems
->
get
(
i
));
if
(
item
->
specifiesCoordinate
())
{
if
(
item
->
specifiesCoordinate
()
&&
!
item
->
standaloneCoordinate
()
)
{
foundAltitude
=
item
->
param7
();
found
=
true
;
}
...
...
src/MissionManager/MissionItem.cc
View file @
1da21bda
...
...
@@ -504,6 +504,11 @@ void MissionItem::setParam7(double param)
}
}
bool
MissionItem
::
standaloneCoordinate
(
void
)
const
{
return
_mavCmdInfoMap
[(
MAV_CMD
)
command
()]
->
standaloneCoordinate
();
}
bool
MissionItem
::
specifiesCoordinate
(
void
)
const
{
return
_mavCmdInfoMap
[(
MAV_CMD
)
command
()]
->
specifiesCoordinate
();
...
...
src/MissionManager/MissionItem.h
View file @
1da21bda
...
...
@@ -83,6 +83,7 @@ public:
Q_PROPERTY
(
bool
isCurrentItem
READ
isCurrentItem
WRITE
setIsCurrentItem
NOTIFY
isCurrentItemChanged
)
Q_PROPERTY
(
bool
rawEdit
READ
rawEdit
WRITE
setRawEdit
NOTIFY
rawEditChanged
)
///< true: raw item editing with all params
Q_PROPERTY
(
int
sequenceNumber
READ
sequenceNumber
WRITE
setSequenceNumber
NOTIFY
sequenceNumberChanged
)
Q_PROPERTY
(
bool
standaloneCoordinate
READ
standaloneCoordinate
NOTIFY
commandChanged
)
Q_PROPERTY
(
bool
specifiesCoordinate
READ
specifiesCoordinate
NOTIFY
commandChanged
)
Q_PROPERTY
(
Fact
*
supportedCommand
READ
supportedCommand
NOTIFY
commandChanged
)
...
...
@@ -112,6 +113,7 @@ public:
bool
isCurrentItem
(
void
)
const
{
return
_isCurrentItem
;
}
bool
rawEdit
(
void
)
const
;
int
sequenceNumber
(
void
)
const
{
return
_sequenceNumber
;
}
bool
standaloneCoordinate
(
void
)
const
;
bool
specifiesCoordinate
(
void
)
const
;
Fact
*
supportedCommand
(
void
)
{
return
&
_supportedCommandFact
;
}
...
...
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