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
f3a5cb44
Commit
f3a5cb44
authored
Aug 28, 2020
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
snake mod
parent
fbf79828
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
473 additions
and
524 deletions
+473
-524
snake.cpp
src/Snake/snake.cpp
+276
-353
snake.h
src/Snake/snake.h
+24
-57
snake_typedefs.h
src/Snake/snake_typedefs.h
+10
-2
SnakeDataManager.cc
src/Wima/Snake/SnakeDataManager.cc
+147
-109
SnakeDataManager.h
src/Wima/Snake/SnakeDataManager.h
+2
-1
WimaController.cc
src/Wima/WimaController.cc
+12
-0
WimaController.h
src/Wima/WimaController.h
+2
-2
No files found.
src/Snake/snake.cpp
View file @
f3a5cb44
This diff is collapsed.
Click to expand it.
src/Snake/snake.h
View file @
f3a5cb44
...
...
@@ -158,10 +158,6 @@ class Scenario{
void
setServiceArea
(
const
BoostPolygon
&
area
);
void
setCorridor
(
const
BoostPolygon
&
area
);
BoostPolygon
&
measurementArea
();
BoostPolygon
&
serviceArea
();
BoostPolygon
&
corridor
();
const
BoundingBox
&
mAreaBoundingBox
()
const
;
const
BoostPolygon
&
measurementArea
()
const
;
...
...
@@ -242,60 +238,31 @@ bool joinAreas(const std::vector<BoostPolygon> &areas,
BoostPolygon
&
joinedArea
);
//========================================================================================
//
Flight
plan
//
flight_
plan
//========================================================================================
class
Flightplan
{
public:
using
ScenarioPtr
=
shared_ptr
<
Scenario
>
;
using
ProgressPtr
=
shared_ptr
<
vector
<
int
>>
;
Flightplan
(
ScenarioPtr
s
,
ScenarioPtr
p
);
const
vector
<
BoostPoint
>
&
waypoints
(
void
)
const
{
return
_waypoints
;}
const
vector
<
BoostPoint
>
&
arrivalPath
(
void
)
const
{
return
_arrivalPath
;}
const
vector
<
BoostPoint
>
&
returnPath
(
void
)
const
{
return
_returnPath
;}
double
lineDistance
()
const
;
void
setLineDistance
(
double
lineDistance
);
double
minTransectLengthconst
;
void
setMinTransectLength
(
double
minTransectLength
);
ScenarioPtr
scenario
()
const
;
void
setScenario
(
ScenarioPtr
&
scenario
);
ProgressPtr
progress
()
const
;
void
setProgress
(
ProgressPtr
&
progress
);
bool
update
();
string
errorString
;
private:
// Search Filter to speed up routing.SolveWithParameters(...);
// Found here: http://www.lia.disi.unibo.it/Staff/MicheleLombardi/or-tools-doc/user_manual/manual/ls/ls_filtering.html
class
SearchFilter
;
struct
RoutingDataModel
;
bool
_generateTransects
();
void
_generateRoutingModel
(
const
BoostLineString
&
vertices
,
const
BoostPolygon
&
polygonOffset
,
size_t
n0
,
RoutingDataModel
&
dataModel
,
Matrix
<
double
>
&
graph
);
double
_lineDistance
;
double
_minTransectLength
;
shared_ptr
<
const
Scenario
>
_pScenario
;
shared_ptr
<
const
vector
<
int
>>
_pProgress
;
vector
<
BoostPoint
>
_waypoints
;
vector
<
BoostPoint
>
_arrivalPath
;
vector
<
BoostPoint
>
_returnPath
;
vector
<
BoostLineString
>
_transects
;
};
namespace
detail
{
const
double
offsetConstant
=
0
.
1
;
// meter, polygon offset to compenstate for numerical inaccurracies.
}
namespace
flight_plan
{
using
Transects
=
vector
<
BoostLineString
>
;
using
Progress
=
vector
<
int
>
;
using
Route
=
vector
<
BoostPoint
>
;
bool
transectsFromScenario
(
Length
distance
,
Length
minLength
,
Angle
angle
,
const
Scenario
&
scenario
,
const
Progress
&
p
,
Transects
&
t
,
string
&
errorString
);
bool
route
(
const
BoostPolygon
&
area
,
const
Transects
&
transects
,
Transects
&
transectsRouted
,
Route
&
route
,
string
&
errorString
);
}
// namespace flight_plan
namespace
detail
{
const
double
offsetConstant
=
0
.
1
;
// meter, polygon offset to compenstate for numerical inaccurracies.
}
// namespace detail
}
src/Snake/snake_typedefs.h
View file @
f3a5cb44
...
...
@@ -3,7 +3,13 @@
#include <vector>
#include <array>
#include <boost/geometry.hpp>
#include <boost/units/systems/si.hpp>
#include <boost/units/systems/si/io.hpp>
#include <boost/units/systems/si/plane_angle.hpp>
#include <boost/units/systems/si/prefixes.hpp>
#include <boost/units/systems/angle/degrees.hpp>
namespace
bg
=
boost
::
geometry
;
namespace
bu
=
boost
::
units
;
...
...
@@ -14,8 +20,10 @@ typedef bg::model::point<double, 2, bg::cs::cartesian> BoostPoint;
typedef
bg
::
model
::
polygon
<
BoostPoint
>
BoostPolygon
;
typedef
bg
::
model
::
linestring
<
BoostPoint
>
BoostLineString
;
typedef
std
::
vector
<
std
::
vector
<
int64_t
>>
Int64Matrix
;
typedef
bg
::
model
::
box
<
BoostPoint
>
BoostBox
;
typedef
bu
::
quantity
<
bu
::
si
::
length
>
Length
;
typedef
bu
::
quantity
<
bu
::
si
::
area
>
Area
;
typedef
bu
::
quantity
<
bu
::
si
::
length
,
double
>
Length
;
typedef
bu
::
quantity
<
bu
::
si
::
area
,
double
>
Area
;
typedef
bu
::
quantity
<
bu
::
si
::
plane_angle
,
double
>
Angle
;
}
src/Wima/Snake/SnakeDataManager.cc
View file @
f3a5cb44
This diff is collapsed.
Click to expand it.
src/Wima/Snake/SnakeDataManager.h
View file @
f3a5cb44
...
...
@@ -57,7 +57,8 @@ protected:
private:
bool
precondition
()
const
;
SnakeImplPtr
_pImpl
;
void
resetWaypointData
();
SnakeImplPtr
pImpl
;
};
...
...
src/Wima/WimaController.cc
View file @
f3a5cb44
...
...
@@ -200,6 +200,18 @@ Fact *WimaController::altitude() {
return
&
_altitude
;
}
QmlObjectListModel
*
WimaController
::
snakeTiles
()
{
qWarning
()
<<
"using snake tile dummy"
;
return
QmlObjectListModel
();
}
QVariantList
WimaController
::
snakeTileCenterPoints
()
{
qWarning
()
<<
"using snakeTileCenterPoints dummy"
;
return
QVariantList
();
}
QVector
<
int
>
WimaController
::
nemoProgress
()
{
if
(
_nemoProgress
.
progress
().
size
()
==
_snakeTileCenterPoints
.
size
()
)
return
_nemoProgress
.
progress
();
...
...
src/Wima/WimaController.h
View file @
f3a5cb44
...
...
@@ -216,8 +216,8 @@ public:
Fact
*
snakeLineDistance
(
void
)
{
return
&
_snakeLineDistance
;}
Fact
*
snakeMinTransectLength
(
void
)
{
return
&
_snakeMinTransectLength
;}
// Snake data.
QmlObjectListModel
*
snakeTiles
(
void
)
{
return
_snakeTiles
.
QmlObjectListModel
();}
QVariantList
snakeTileCenterPoints
(
void
)
{
return
_snakeTileCenterPoints
;}
QmlObjectListModel
*
snakeTiles
(
void
)
;
QVariantList
snakeTileCenterPoints
(
void
)
;
QVector
<
int
>
nemoProgress
(
void
);
int
nemoStatus
(
void
)
const
;
QString
nemoStatusString
(
void
)
const
;
...
...
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