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
75635d2f
Commit
75635d2f
authored
Aug 03, 2020
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
919fdcb4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
16 deletions
+35
-16
WimaController.cc
src/Wima/WimaController.cc
+27
-16
WimaPlaner.cc
src/Wima/WimaPlaner.cc
+4
-0
WimaPlaner.h
src/Wima/WimaPlaner.h
+4
-0
No files found.
src/Wima/WimaController.cc
View file @
75635d2f
...
...
@@ -35,9 +35,10 @@ const char* WimaController::snakeMinTileAreaName = "SnakeMinTileArea";
const
char
*
WimaController
::
snakeLineDistanceName
=
"SnakeLineDistance"
;
const
char
*
WimaController
::
snakeMinTransectLengthName
=
"SnakeMinTransectLength"
;
WimaController
::
StatusMap
WimaController
::
_nemoStatusMap
{
std
::
make_pair
<
int
,
QString
>
(
0
,
"No Heartbeat"
),
std
::
make_pair
<
int
,
QString
>
(
1
,
"Connected"
),
std
::
make_pair
<
int
,
QString
>
(
-
1
,
"Timeout"
)};
WimaController
::
StatusMap
WimaController
::
_nemoStatusMap
{
std
::
make_pair
<
int
,
QString
>
(
0
,
"No Heartbeat"
),
std
::
make_pair
<
int
,
QString
>
(
1
,
"Connected"
),
std
::
make_pair
<
int
,
QString
>
(
-
1
,
"Timeout"
)};
using
namespace
snake
;
using
namespace
snake_geometry
;
...
...
@@ -56,7 +57,8 @@ WimaController::WimaController(QObject *parent)
,
_rtlManager
(
_managerSettings
,
_areaInterface
)
,
_currentManager
(
&
_defaultManager
)
,
_managerList
{
&
_defaultManager
,
&
_snakeManager
,
&
_rtlManager
}
,
_metaDataMap
(
FactMetaData
::
createMapFromJsonFile
(
QStringLiteral
(
":/json/WimaController.SettingsGroup.json"
),
this
))
,
_metaDataMap
(
FactMetaData
::
createMapFromJsonFile
(
QStringLiteral
(
":/json/WimaController.SettingsGroup.json"
),
this
))
,
_enableWimaController
(
settingsGroup
,
_metaDataMap
[
enableWimaControllerName
])
,
_overlapWaypoints
(
settingsGroup
,
_metaDataMap
[
overlapWaypointsName
])
,
_maxWaypointsPerPhase
(
settingsGroup
,
_metaDataMap
[
maxWaypointsPerPhaseName
])
...
...
@@ -333,7 +335,9 @@ void WimaController::removeVehicleTrajectoryHistory()
managerVehicle
->
trajectoryPoints
()
->
clear
();
}
bool
WimaController
::
_calcShortestPath
(
const
QGeoCoordinate
&
start
,
const
QGeoCoordinate
&
destination
,
QVector
<
QGeoCoordinate
>
&
path
)
bool
WimaController
::
_calcShortestPath
(
const
QGeoCoordinate
&
start
,
const
QGeoCoordinate
&
destination
,
QVector
<
QGeoCoordinate
>
&
path
)
{
using
namespace
GeoUtilities
;
using
namespace
PolygonCalculus
;
...
...
@@ -352,8 +356,6 @@ bool WimaController::_calcShortestPath(const QGeoCoordinate &start, const QGeoCo
bool
WimaController
::
setWimaPlanData
(
const
WimaPlanData
&
planData
)
{
// fetch only if valid, return true on success
// reset visual items
_areas
.
clear
();
_defaultManager
.
clear
();
...
...
@@ -864,15 +866,24 @@ void WimaController::_initStartSnakeWorker()
}
// Initialize _snakeWorker.
_snakeWorker
.
setMeasurementArea
(
_measurementArea
.
coordinateList
());
_snakeWorker
.
setServiceArea
(
_serviceArea
.
coordinateList
());
_snakeWorker
.
setCorridor
(
_corridor
.
coordinateList
());
_snakeWorker
.
setProgress
(
_nemoProgress
.
progress
());
_snakeWorker
.
setLineDistance
(
_snakeLineDistance
.
rawValue
().
toDouble
());
_snakeWorker
.
setMinTransectLength
(
_snakeMinTransectLength
.
rawValue
().
toDouble
());
_snakeWorker
.
setTileHeight
(
_snakeTileHeight
.
rawValue
().
toDouble
());
_snakeWorker
.
setTileWidth
(
_snakeTileWidth
.
rawValue
().
toDouble
());
_snakeWorker
.
setMinTileArea
(
_snakeMinTileArea
.
rawValue
().
toDouble
());
_snakeWorker
.
setMeasurementArea
(
_measurementArea
.
coordinateList
());
_snakeWorker
.
setServiceArea
(
_serviceArea
.
coordinateList
());
_snakeWorker
.
setCorridor
(
_corridor
.
coordinateList
());
_snakeWorker
.
setProgress
(
_nemoProgress
.
progress
());
_snakeWorker
.
setLineDistance
(
_snakeLineDistance
.
rawValue
().
toDouble
());
_snakeWorker
.
setMinTransectLength
(
_snakeMinTransectLength
.
rawValue
().
toDouble
());
_snakeWorker
.
setTileHeight
(
_snakeTileHeight
.
rawValue
().
toDouble
());
_snakeWorker
.
setTileWidth
(
_snakeTileWidth
.
rawValue
().
toDouble
());
_snakeWorker
.
setMinTileArea
(
_snakeMinTileArea
.
rawValue
().
toDouble
());
_setSnakeCalcInProgress
(
true
);
// Start worker thread.
...
...
src/Wima/WimaPlaner.cc
View file @
75635d2f
...
...
@@ -36,10 +36,12 @@ WimaPlaner::WimaPlaner(QObject *parent)
_updateTimer
.
setInterval
(
300
);
// 300 ms means: max update time 2*300 ms
_updateTimer
.
start
();
#ifndef NDEBUG
// for debugging and testing purpose, remove if not needed anymore
connect
(
&
_autoLoadTimer
,
&
QTimer
::
timeout
,
this
,
&
WimaPlaner
::
autoLoadMission
);
_autoLoadTimer
.
setSingleShot
(
true
);
_autoLoadTimer
.
start
(
300
);
#endif
_calcArrivalAndReturnPathTimer
.
setInterval
(
100
);
_calcArrivalAndReturnPathTimer
.
setSingleShot
(
true
);
...
...
@@ -826,11 +828,13 @@ void WimaPlaner::setSyncronizedWithControllerFalse()
setSyncronizedWithController
(
false
);
}
#ifndef NDEBUG
void
WimaPlaner
::
autoLoadMission
()
{
loadFromFile
(
"/home/valentin/Desktop/drones/qgroundcontrol/Paths/KlingenbachTest.wima"
);
pushToWimaController
();
}
#endif
void
WimaPlaner
::
startCalcArrivalAndReturnTimer
()
{
...
...
src/Wima/WimaPlaner.h
View file @
75635d2f
...
...
@@ -136,7 +136,9 @@ private slots:
// called by _updateTimer::timeout signal, updates different mission parts, if parameters (e.g. survey or areas) have changed
void
updateTimerSlot
();
void
setSyncronizedWithControllerFalse
(
void
);
#ifndef NDEBUG
void
autoLoadMission
(
void
);
#endif
void
startCalcArrivalAndReturnTimer
(
void
);
private:
signals:
...
...
@@ -180,6 +182,8 @@ private:
bool
_syncronizedWithController
;
// true if planData is syncronized with wimaController
bool
_readyForSync
;
// gets set by updateMission and calcArrivalAndReturnPath
#ifndef NDEBUG
QTimer
_autoLoadTimer
;
// timer to auto load mission after some time, prevents seg. faults
#endif
QTimer
_calcArrivalAndReturnPathTimer
;
};
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