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
7a0b738b
Commit
7a0b738b
authored
Jan 26, 2021
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
version checking added to nemo inteface, testing needed..
parent
b098b99a
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
596 additions
and
111 deletions
+596
-111
qgroundcontrol.pro
qgroundcontrol.pro
+2
-0
NemoInterface.cpp
src/MeasurementComplexItem/NemoInterface.cpp
+510
-93
NemoInterface.h
src/MeasurementComplexItem/NemoInterface.h
+1
-0
MeasurementTile.cpp
...MeasurementComplexItem/nemo_interface/MeasurementTile.cpp
+10
-1
NemoEditor.qml
src/MeasurementComplexItem/qml/NemoEditor.qml
+9
-2
rosbridge.cpp
src/MeasurementComplexItem/rosbridge/rosbridge.cpp
+1
-11
rosbridge.h
src/MeasurementComplexItem/rosbridge/rosbridge.h
+0
-2
rosbridgeimpl.cpp
src/MeasurementComplexItem/rosbridge/rosbridgeimpl.cpp
+5
-1
rosbridgeimpl.h
src/MeasurementComplexItem/rosbridge/rosbridgeimpl.h
+1
-0
tile.h
src/comm/ros_bridge/include/messages/nemo_msgs/tile.h
+1
-1
tile_array.cpp
...comm/ros_bridge/include/messages/nemo_msgs/tile_array.cpp
+1
-0
tile_array.h
src/comm/ros_bridge/include/messages/nemo_msgs/tile_array.h
+55
-0
No files found.
qgroundcontrol.pro
View file @
7a0b738b
...
...
@@ -517,6 +517,7 @@ HEADERS += \
src
/
comm
/
ros_bridge
/
include
/
messages
/
nemo_msgs
/
heartbeat
.
h
\
src
/
comm
/
ros_bridge
/
include
/
messages
/
nemo_msgs
/
progress_array
.
h
\
src
/
comm
/
ros_bridge
/
include
/
messages
/
nemo_msgs
/
tile
.
h
\
src
/
comm
/
ros_bridge
/
include
/
messages
/
nemo_msgs
/
tile_array
.
h
\
src
/
comm
/
utilities
.
h
contains
(
DEFINES
,
QGC_ENABLE_PAIRING
)
{
...
...
@@ -559,6 +560,7 @@ SOURCES += \
src
/
comm
/
ros_bridge
/
include
/
messages
/
nemo_msgs
/
progress_array
.
cpp
\
src
/
comm
/
ros_bridge
/
include
/
messages
/
nemo_msgs
/
tile
.
cpp
\
src
/
Settings
/
WimaSettings
.
cc
\
src
/
comm
/
ros_bridge
/
include
/
messages
/
nemo_msgs
/
tile_array
.
cpp
contains
(
DEFINES
,
QGC_ENABLE_PAIRING
)
{
SOURCES
+=
\
...
...
src/MeasurementComplexItem/NemoInterface.cpp
View file @
7a0b738b
This diff is collapsed.
Click to expand it.
src/MeasurementComplexItem/NemoInterface.h
View file @
7a0b738b
...
...
@@ -30,6 +30,7 @@ public:
enum
class
STATUS
{
NOT_CONNECTED
,
ERROR
,
SYNC
,
READY
,
WEBSOCKET_DETECTED
,
...
...
src/MeasurementComplexItem/nemo_interface/MeasurementTile.cpp
View file @
7a0b738b
...
...
@@ -52,13 +52,22 @@ QList<QGeoCoordinate> MeasurementTile::tile() const { return coordinateList(); }
QString
MeasurementTile
::
randomId
(
int
length
)
{
static
const
QString
values
(
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
);
static
std
::
uint64_t
counter
=
0
;
static
auto
firstCall
=
std
::
chrono
::
high_resolution_clock
::
now
();
auto
delta
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
nanoseconds
>
(
std
::
chrono
::
high_resolution_clock
::
now
()
-
firstCall
)
.
count
();
std
::
srand
((
unsigned
int
)
delta
^
counter
);
QString
str
;
std
::
srand
(
std
::
time
(
nullptr
));
for
(
int
i
=
0
;
i
<
length
;
++
i
)
{
int
index
=
std
::
rand
()
%
values
.
length
();
QChar
c
=
values
.
at
(
index
);
str
.
append
(
c
);
}
++
counter
;
return
str
;
}
...
...
src/MeasurementComplexItem/qml/NemoEditor.qml
View file @
7a0b738b
...
...
@@ -22,7 +22,8 @@ Rectangle {
property
int
availableWidth
:
300
property
bool
error
:
errorString
.
lenght
>=
0
readonly
property
bool
running
:
_nemoInterface
.
running
property
string
errorString
:
""
property
string
warningString
:
_nemoInterface
.
warningString
property
string
infoString
:
_nemoInterface
.
infoString
signal
abort
...
...
@@ -50,7 +51,13 @@ Rectangle {
color
:
"
orange
"
Layout.columnSpan
:
parent
.
columns
Layout.fillWidth
:
true
visible
:
!
_root
.
areasCorrect
}
QGCLabel
{
text
:
_root
.
infoString
wrapMode
:
Text
.
WordWrap
horizontalAlignment
:
Text
.
AlignLeft
Layout.columnSpan
:
parent
.
columns
Layout.fillWidth
:
true
}
QGCButton
{
...
...
src/MeasurementComplexItem/rosbridge/rosbridge.cpp
View file @
7a0b738b
...
...
@@ -37,7 +37,7 @@ void Rosbridge::start() {
_impl
->
moveToThread
(
_t
);
connect
(
_impl
,
&
RosbridgeImpl
::
stateChanged
,
this
,
&
Rosbridge
::
_onImplS
tateChanged
);
&
Rosbridge
::
s
tateChanged
);
connect
(
this
,
&
Rosbridge
::
_start
,
_impl
,
&
RosbridgeImpl
::
start
);
connect
(
this
,
&
Rosbridge
::
_stop
,
_impl
,
&
RosbridgeImpl
::
stop
);
...
...
@@ -244,16 +244,6 @@ void Rosbridge::waitForService(const QString &service) {
}
}
void
Rosbridge
::
_onImplStateChanged
()
{
static
STATE
oldState
=
STATE
::
STOPPED
;
auto
newState
=
translate
(
_impl
->
state
());
if
(
oldState
!=
newState
)
{
emit
stateChanged
();
}
oldState
=
newState
;
}
Rosbridge
::
STATE
translate
(
RosbridgeImpl
::
STATE
s
)
{
switch
(
s
)
{
case
RosbridgeImpl
:
:
STATE
::
STOPPED
:
...
...
src/MeasurementComplexItem/rosbridge/rosbridge.h
View file @
7a0b738b
...
...
@@ -101,8 +101,6 @@ signals:
void
_unadvertiseAllServices
();
private:
void
_onImplStateChanged
();
std
::
atomic
<
STATE
>
_state
;
RosbridgeImpl
*
_impl
;
QThread
*
_t
;
...
...
src/MeasurementComplexItem/rosbridge/rosbridgeimpl.cpp
View file @
7a0b738b
...
...
@@ -337,6 +337,11 @@ void RosbridgeImpl::_onDisconnected() {
}
}
void
RosbridgeImpl
::
_onError
(
QAbstractSocket
::
SocketError
e
)
{
qDebug
()
<<
"_onError: socket error: "
<<
e
<<
", "
<<
_webSocket
.
errorString
();
}
void
RosbridgeImpl
::
_setState
(
RosbridgeImpl
::
STATE
newState
)
{
if
(
_state
!=
newState
)
{
_state
=
newState
;
...
...
@@ -372,7 +377,6 @@ void RosbridgeImpl::_doAction() {
}
void
RosbridgeImpl
::
_onTextMessageReceived
(
const
QString
&
message
)
{
qDebug
()
<<
"_onTextMessageReceived: "
<<
message
;
QJsonParseError
e
;
auto
d
=
QJsonDocument
::
fromJson
(
message
.
toUtf8
(),
&
e
);
if
(
!
d
.
isNull
())
{
...
...
src/MeasurementComplexItem/rosbridge/rosbridgeimpl.h
View file @
7a0b738b
...
...
@@ -58,6 +58,7 @@ signals:
private
slots
:
void
_onConnected
();
void
_onDisconnected
();
void
_onError
(
QAbstractSocket
::
SocketError
e
);
void
_doAction
();
void
_onTextMessageReceived
(
const
QString
&
message
);
...
...
src/comm/ros_bridge/include/messages/nemo_msgs/tile.h
View file @
7a0b738b
...
...
@@ -100,7 +100,7 @@ template <class TileType> bool fromJson(const QJsonObject &value, TileType &p) {
PointType
;
for
(
long
i
=
0
;
i
<
jsonArray
.
size
();
++
i
)
{
PointType
pt
;
if
(
!
geo_point
::
fromJson
(
jsonArray
[
i
],
pt
))
{
if
(
!
geo_point
::
fromJson
(
jsonArray
[
i
]
.
toObject
()
,
pt
))
{
return
false
;
}
p
.
tile
().
push_back
(
std
::
move
(
pt
));
...
...
src/comm/ros_bridge/include/messages/nemo_msgs/tile_array.cpp
0 → 100644
View file @
7a0b738b
#include "tile_array.h"
src/comm/ros_bridge/include/messages/nemo_msgs/tile_array.h
0 → 100644
View file @
7a0b738b
#pragma once
#include "ros_bridge/include/messages/nemo_msgs/tile.h"
#include <QJsonArray>
#include <QString>
namespace
ros_bridge
{
//! @brief Namespace containing classes and methodes ros message generation.
namespace
messages
{
//! @brief Namespace containing classes and methodes for nemo_msgs
//! generation.
namespace
nemo_msgs
{
//! @brief Namespace containing methodes for nemo_msgs/tile_array message
//! generation.
namespace
tile_array
{
template
<
class
TileArray
>
bool
toJson
(
const
TileArray
&
array
,
QJsonArray
&
jsonArray
)
{
for
(
unsigned
long
i
=
0
;
i
<
std
::
uint64_t
(
array
.
size
());
++
i
)
{
QJsonObject
jsonTile
;
if
(
!
tile
::
toJson
(
array
[
i
],
jsonTile
))
{
return
false
;
}
jsonArray
.
push_back
(
std
::
move
(
jsonTile
));
}
return
true
;
}
template
<
class
TileArray
>
bool
fromJson
(
const
QJsonArray
&
jsonArray
,
TileArray
&
array
)
{
using
namespace
geographic_msgs
;
array
.
clear
();
array
.
reserve
(
jsonArray
.
size
());
typedef
decltype
(
array
[
0
])
TileCVR
;
typedef
typename
std
::
remove_cv_t
<
typename
std
::
remove_reference_t
<
TileCVR
>>
Tile
;
for
(
long
i
=
0
;
i
<
jsonArray
.
size
();
++
i
)
{
Tile
t
;
if
(
!
tile
::
fromJson
(
jsonArray
[
i
],
t
))
{
return
false
;
}
array
.
push_back
(
std
::
move
(
t
));
}
return
true
;
}
}
// namespace tile_array
}
// namespace nemo_msgs
}
// namespace messages
}
// namespace ros_bridge
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