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
19f73a78
Commit
19f73a78
authored
Jul 03, 2010
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved the local waypoint list into waypoint manager
parent
2438b8c8
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
191 additions
and
141 deletions
+191
-141
UASWaypointManager.cc
src/uas/UASWaypointManager.cc
+5
-5
UASWaypointManager.h
src/uas/UASWaypointManager.h
+7
-4
WaypointList.cc
src/ui/WaypointList.cc
+176
-126
WaypointList.h
src/ui/WaypointList.h
+3
-6
No files found.
src/uas/UASWaypointManager.cc
View file @
19f73a78
...
...
@@ -94,7 +94,7 @@ void UASWaypointManager::handleWaypoint(quint8 systemId, quint8 compId, mavlink_
if
(
wp
->
seq
==
current_wp_id
)
{
//update the UI FIXME
emit
waypointUpdated
(
uas
.
getUASID
(),
wp
->
seq
,
wp
->
x
,
wp
->
y
,
wp
->
z
,
wp
->
yaw
,
wp
->
autocontinue
,
wp
->
current
,
wp
->
orbit
,
wp
->
hold_time
);
emit
waypointUpdated
(
wp
->
seq
,
wp
->
x
,
wp
->
y
,
wp
->
z
,
wp
->
yaw
,
wp
->
autocontinue
,
wp
->
current
,
wp
->
orbit
,
wp
->
hold_time
);
//get next waypoint
current_wp_id
++
;
...
...
@@ -206,15 +206,15 @@ void UASWaypointManager::requestWaypoints()
}
}
void
UASWaypointManager
::
sendWaypoints
(
const
QVector
<
Waypoint
*>
&
list
)
void
UASWaypointManager
::
sendWaypoints
()
{
if
(
current_state
==
WP_IDLE
)
{
if
(
list
.
count
()
>
0
)
if
(
waypoints
.
count
()
>
0
)
{
protocol_timer
.
start
(
PROTOCOL_TIMEOUT_MS
);
current_count
=
list
.
count
();
current_count
=
waypoints
.
count
();
current_state
=
WP_SENDLIST
;
current_wp_id
=
0
;
current_partner_systemid
=
uas
.
getUASID
();
...
...
@@ -233,7 +233,7 @@ void UASWaypointManager::sendWaypoints(const QVector<Waypoint*> &list)
waypoint_buffer
.
push_back
(
new
mavlink_waypoint_t
);
mavlink_waypoint_t
*
cur_d
=
waypoint_buffer
.
back
();
memset
(
cur_d
,
0
,
sizeof
(
mavlink_waypoint_t
));
//initialize with zeros
const
Waypoint
*
cur_s
=
list
.
at
(
i
);
const
Waypoint
*
cur_s
=
waypoints
.
at
(
i
);
cur_d
->
autocontinue
=
cur_s
->
getAutoContinue
();
cur_d
->
current
=
cur_s
->
getCurrent
();
...
...
src/uas/UASWaypointManager.h
View file @
19f73a78
...
...
@@ -60,6 +60,8 @@ public:
void
handleWaypointReached
(
quint8
systemId
,
quint8
compId
,
mavlink_waypoint_reached_t
*
wpr
);
void
handleWaypointSetCurrent
(
quint8
systemId
,
quint8
compId
,
mavlink_waypoint_set_current_t
*
wpr
);
QVector
<
Waypoint
*>
&
getWaypointList
(
void
)
{
return
waypoints
;
}
private:
void
sendWaypointRequest
(
quint16
seq
);
void
sendWaypoint
(
quint16
seq
);
...
...
@@ -68,12 +70,12 @@ public slots:
void
timeout
();
void
clearWaypointList
();
void
requestWaypoints
();
void
sendWaypoints
(
const
QVector
<
Waypoint
*>
&
list
);
void
sendWaypoints
();
signals:
void
waypointUpdated
(
int
,
quint16
,
double
,
double
,
double
,
double
,
bool
,
bool
,
double
,
int
);
///< Adds a waypoint to the waypoint list widget
void
currentWaypointChanged
(
quint16
);
///< emits the new current waypoint sequence number
void
updateStatusString
(
const
QString
&
);
///< emits the current status string
void
waypointUpdated
(
quint16
,
double
,
double
,
double
,
double
,
bool
,
bool
,
double
,
int
);
///< Adds a waypoint to the waypoint list widget
void
currentWaypointChanged
(
quint16
);
///< emits the new current waypoint sequence number
void
updateStatusString
(
const
QString
&
);
///< emits the current status string
private:
UAS
&
uas
;
///< Reference to the corresponding UAS
...
...
@@ -83,6 +85,7 @@ private:
quint8
current_partner_systemid
;
///< The current protocol communication target system
quint8
current_partner_compid
;
///< The current protocol communication target component
QVector
<
Waypoint
*>
waypoints
;
///< local waypoint list
QVector
<
mavlink_waypoint_t
*>
waypoint_buffer
;
///< communication buffer for waypoints
QTimer
protocol_timer
;
///< Timer to catch timeouts
};
...
...
src/ui/WaypointList.cc
View file @
19f73a78
This diff is collapsed.
Click to expand it.
src/ui/WaypointList.h
View file @
19f73a78
...
...
@@ -73,24 +73,21 @@ public slots:
void
updateStatusLabel
(
const
QString
&
string
);
void
currentWaypointChanged
(
quint16
seq
);
//To be moved to UASWaypointManager (?)
void
setWaypoint
(
int
uasId
,
quint16
id
,
double
x
,
double
y
,
double
z
,
double
yaw
,
bool
autocontinue
,
bool
current
,
double
orbit
,
int
holdTime
);
void
setWaypoint
(
quint16
id
,
double
x
,
double
y
,
double
z
,
double
yaw
,
bool
autocontinue
,
bool
current
,
double
orbit
,
int
holdTime
);
void
addWaypoint
(
Waypoint
*
wp
);
void
removeWaypoint
(
Waypoint
*
wp
);
void
waypointReached
(
UASInterface
*
uas
,
quint16
waypointId
);
void
waypointReached
(
quint16
waypointId
);
void
updateLocalPosition
(
UASInterface
*
,
double
x
,
double
y
,
double
z
,
quint64
usec
);
void
updateAttitude
(
UASInterface
*
,
double
roll
,
double
pitch
,
double
yaw
,
quint64
usec
);
signals:
void
sendWaypoints
(
const
QVector
<
Waypoint
*>
&
);
void
sendWaypoints
();
void
requestWaypoints
();
void
clearWaypointList
();
protected:
virtual
void
changeEvent
(
QEvent
*
e
);
QVector
<
Waypoint
*>
waypoints
;
QMap
<
Waypoint
*
,
WaypointView
*>
wpViews
;
QVBoxLayout
*
listLayout
;
UASInterface
*
uas
;
...
...
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