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
40da114d
Commit
40da114d
authored
Dec 31, 2020
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
started to implement new nemo interface
parent
4948045b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
93 additions
and
37 deletions
+93
-37
qgroundcontrol.pro
qgroundcontrol.pro
+4
-0
IDArray.h
src/MeasurementComplexItem/IDArray.h
+5
-0
LogicalArray.h
src/MeasurementComplexItem/LogicalArray.h
+5
-0
NemoInterface.cpp
src/MeasurementComplexItem/NemoInterface.cpp
+53
-28
NemoInterface.h
src/MeasurementComplexItem/NemoInterface.h
+16
-9
TileArray.h
src/MeasurementComplexItem/TileArray.h
+5
-0
TilePtrArray.h
src/MeasurementComplexItem/TilePtrArray.h
+5
-0
No files found.
qgroundcontrol.pro
View file @
40da114d
...
...
@@ -445,6 +445,10 @@ contains (DEFINES, QGC_ENABLE_PAIRING) {
#
HEADERS
+=
\
src
/
MeasurementComplexItem
/
IDArray
.
h
\
src
/
MeasurementComplexItem
/
LogicalArray
.
h
\
src
/
MeasurementComplexItem
/
TileArray
.
h
\
src
/
MeasurementComplexItem
/
TilePtrArray
.
h
\
src
/
MeasurementComplexItem
/
geometry
/
ProgressArray
.
h
\
src
/
MeasurementComplexItem
/
geometry
/
TileDiff
.
h
\
src
/
MeasurementComplexItem
/
geometry
/
geometry
.
h
\
...
...
src/MeasurementComplexItem/IDArray.h
0 → 100644
View file @
40da114d
#ifndef IDARRAY_H
#define IDARRAY_H
typedef
QVector
<
long
>
IDArray
;
#endif // IDARRAY_H
src/MeasurementComplexItem/LogicalArray.h
0 → 100644
View file @
40da114d
#ifndef LOGICALARRAY_H
#define LOGICALARRAY_H
typedef
QVector
<
bool
>
LogicalArray
;
#endif // LOGICALARRAY_H
src/MeasurementComplexItem/NemoInterface.cpp
View file @
40da114d
...
...
@@ -15,9 +15,9 @@
#include "GenericSingelton.h"
#include "geometry/MeasurementArea.h"
#include "geometry/geometry.h"
#include "nemo_interface/MeasurementTile.h"
#include "nemo_interface/QNemoHeartbeat.h"
#include "nemo_interface/QNemoProgress.h"
#include "nemo_interface/MeasurementTile.h"
#include "ros_bridge/include/messages/geographic_msgs/geopoint.h"
#include "ros_bridge/include/messages/jsk_recognition_msgs/polygon_array.h"
...
...
@@ -31,7 +31,7 @@
QGC_LOGGING_CATEGORY
(
NemoInterfaceLog
,
"NemoInterfaceLog"
)
#define EVENT_TIMER_INTERVAL 100 // ms
auto
static
timeoutInterval
=
std
::
chrono
::
milliseconds
(
3000
);
auto
constexpr
static
timeoutInterval
=
std
::
chrono
::
milliseconds
(
3000
);
using
ROSBridgePtr
=
std
::
unique_ptr
<
ros_bridge
::
ROSBridge
>
;
using
JsonDocUPtr
=
ros_bridge
::
com_private
::
JsonDocUPtr
;
...
...
@@ -47,15 +47,20 @@ public:
void
start
();
void
stop
();
void
setTileData
(
const
TileData
&
tileData
);
bool
hasTileData
(
const
TileData
&
tileData
)
const
;
void
setAutoPublish
(
bool
ap
);
void
setHoldProgress
(
bool
hp
);
void
addTiles
(
const
TilePtrArray
&
tileArray
);
void
addTiles
(
const
TileArray
&
tileArray
);
void
removeTiles
(
const
IDArray
&
idArray
);
void
clearTiles
();
TileArray
getTiles
(
const
IDArray
&
idArray
);
TileArray
getAllTiles
();
LogicalArray
containsTiles
(
const
IDArray
&
idArray
);
TileArray
extractTiles
(
const
IDArray
&
idArray
);
std
::
size_t
size
();
bool
empty
();
void
publishTileData
();
NemoInterface
::
STATUS
status
();
QVector
<
int
>
progress
();
bool
running
();
private:
...
...
@@ -63,32 +68,13 @@ private:
void
loop
();
static
STATUS
heartbeatToStatus
(
const
ros_bridge
::
messages
::
nemo_msgs
::
heartbeat
::
Heartbeat
&
hb
);
//!
//! \brief Publishes tilesENU
//! \pre this->tilesENUMutex must be locked
//!
void
publishTilesENU
();
//!
//! \brief Publishes ENUOrigin
//! \pre this->ENUOriginMutex must be locked
//!
void
publishENUOrigin
();
bool
setStatus
(
NemoInterface
::
STATUS
s
);
// Data.
SnakeTilesLocal
tilesENU
;
mutable
std
::
shared_timed_mutex
tilesENUMutex
;
QGeoCoordinate
ENUOrigin
;
mutable
std
::
shared_timed_mutex
ENUOriginMutex
;
QNemoProgress
qProgress
;
mutable
std
::
shared_timed_mutex
progressMutex
;
TimePoint
nextTimeout
;
mutable
std
::
shared_timed_mutex
timeoutMutex
;
std
::
atomic
<
NemoInterface
::
STATUS
>
status_
;
// Not protected data.
TileData
tileData
;
// Internals
std
::
atomic_bool
running_
;
std
::
atomic_bool
topicServiceSetupDone
;
...
...
@@ -170,7 +156,8 @@ void NemoInterface::Impl::setTileData(const TileData &tileData) {
tile
=
qobject_cast
<
const
MeasurementTile
*>
(
obj
);
if
(
tile
!=
nullptr
)
{
SnakeTileLocal
tileENU
;
geometry
::
areaToEnu
(
origin
,
tile
->
coordinateList
(),
tileENU
.
path
());
geometry
::
areaToEnu
(
origin
,
tile
->
coordinateList
(),
tileENU
.
path
());
this
->
tilesENU
.
polygons
().
push_back
(
std
::
move
(
tileENU
));
}
else
{
qCDebug
(
NemoInterfaceLog
)
<<
"Impl::setTileData(): nullptr."
;
...
...
@@ -443,6 +430,44 @@ void NemoInterface::start() { this->pImpl->start(); }
void
NemoInterface
::
stop
()
{
this
->
pImpl
->
stop
();
}
void
NemoInterface
::
addTiles
(
const
NemoInterface
::
TilePtrArray
&
tileArray
)
{
this
->
pImpl
-
}
void
NemoInterface
::
addTiles
(
const
TileArray
&
tileArray
)
{
TilePtrArray
ptrArray
;
for
(
const
auto
&
tile
:
tileArray
)
{
ptrArray
.
append
(
&
tile
);
}
addTiles
(
ptrArray
);
}
void
NemoInterface
::
removeTiles
(
const
IDArray
&
idArray
)
{
this
->
pImpl
->
removeTiles
(
idArray
);
}
void
NemoInterface
::
clearTiles
()
{
this
->
pImpl
->
clearTiles
();
}
TileArray
NemoInterface
::
getTiles
(
const
IDArray
&
idArray
)
{
return
this
->
pImpl
->
getTiles
(
idArray
);
}
TileArray
NemoInterface
::
getAllTiles
()
{
return
this
->
pImpl
->
getTiles
(
idArray
);
}
LogicalArray
NemoInterface
::
containsTiles
(
const
IDArray
&
idArray
)
{
return
this
->
pImpl
->
containsTiles
(
idArray
);
}
TileArray
NemoInterface
::
extractTiles
(
const
IDArray
&
idArray
)
{
return
this
->
pImpl
->
extractTiles
(
idArray
);
}
std
::
size_t
NemoInterface
::
size
()
{
return
this
->
pImpl
->
size
();
}
bool
NemoInterface
::
empty
()
{
return
this
->
pImpl
->
empty
();
}
void
NemoInterface
::
publishTileData
()
{
this
->
pImpl
->
publishTileData
();
}
void
NemoInterface
::
requestProgress
()
{
...
...
src/MeasurementComplexItem/NemoInterface.h
View file @
40da114d
...
...
@@ -5,8 +5,13 @@
#include <memory>
class
TileData
;
#include "IDArray.h"
#include "LogicalArray.h"
#include "TileArray.h"
#include "TilePtrArray.h"
// Singelton class used to interface measurement devices implementing the nemo
// interface.
class
NemoInterface
:
public
QObject
{
Q_OBJECT
class
Impl
;
...
...
@@ -31,23 +36,25 @@ public:
Q_PROPERTY
(
STATUS
status
READ
status
NOTIFY
statusChanged
)
Q_PROPERTY
(
QString
statusString
READ
statusString
NOTIFY
statusChanged
)
Q_PROPERTY
(
QVector
<
int
>
progress
READ
progress
NOTIFY
progressChanged
)
Q_PROPERTY
(
QString
editorQml
READ
editorQml
CONSTANT
)
Q_PROPERTY
(
bool
running
READ
running
NOTIFY
runningChanged
)
Q_INVOKABLE
void
start
();
Q_INVOKABLE
void
stop
();
Q_INVOKABLE
void
publishTileData
();
Q_INVOKABLE
void
requestProgress
();
void
setTileData
(
const
TileData
&
tileData
);
bool
hasTileData
(
const
TileData
&
tileData
)
const
;
void
setAutoPublish
(
bool
ap
);
void
setHoldProgress
(
bool
hp
);
void
addTiles
(
const
TilePtrArray
&
tileArray
);
void
addTiles
(
const
TileArray
&
tileArray
);
void
removeTiles
(
const
IDArray
&
idArray
);
void
clearTiles
();
TileArray
getTiles
(
const
IDArray
&
idArray
);
TileArray
getAllTiles
();
LogicalArray
containsTiles
(
const
IDArray
&
idArray
);
TileArray
extractTiles
(
const
IDArray
&
idArray
);
std
::
size_t
size
();
bool
empty
();
STATUS
status
()
const
;
QString
statusString
()
const
;
QVector
<
int
>
progress
()
const
;
QString
editorQml
();
bool
running
();
...
...
src/MeasurementComplexItem/TileArray.h
0 → 100644
View file @
40da114d
#ifndef TILEARRAY_H
#define TILEARRAY_H
typedef
QVector
<
MeasurementTile
>
TileArray
;
#endif // TILEARRAY_H
src/MeasurementComplexItem/TilePtrArray.h
0 → 100644
View file @
40da114d
#ifndef TILEPTRARRAY_H
#define TILEPTRARRAY_H
typedef
QVector
<
MeasurementTile
*>
TilePtrArray
;
#endif // TILEPTRARRAY_H
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