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
c62a239a
Commit
c62a239a
authored
Jul 03, 2010
by
pixhawk
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of pixhawk.ethz.ch:qgroundcontrol
parents
3e421795
8ec80e2a
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
484 additions
and
227 deletions
+484
-227
parameters_alpha.txt
parameters_alpha.txt
+11
-7
parameters_bravo.txt
parameters_bravo.txt
+17
-13
PxQuadMAV.cc
src/uas/PxQuadMAV.cc
+0
-2
UASWaypointManager.cc
src/uas/UASWaypointManager.cc
+5
-5
UASWaypointManager.h
src/uas/UASWaypointManager.h
+7
-4
HSIDisplay.cc
src/ui/HSIDisplay.cc
+74
-31
HSIDisplay.h
src/ui/HSIDisplay.h
+1
-1
UASControl.ui
src/ui/UASControl.ui
+14
-5
UASInfo.ui
src/ui/UASInfo.ui
+60
-4
WaypointList.cc
src/ui/WaypointList.cc
+221
-127
WaypointList.h
src/ui/WaypointList.h
+12
-6
WaypointList.ui
src/ui/WaypointList.ui
+20
-6
UASControlWidget.cc
src/ui/uas/UASControlWidget.cc
+2
-4
UASInfoWidget.cc
src/ui/uas/UASInfoWidget.cc
+1
-1
UASView.cc
src/ui/uas/UASView.cc
+7
-0
UASView.h
src/ui/uas/UASView.h
+2
-0
waypoints-final-pole-racing.txt
waypoints-final-pole-racing.txt
+9
-0
waypoints_A0_circle.txt
waypoints_A0_circle.txt
+11
-11
waypoints_A0_circlev2.txt
waypoints_A0_circlev2.txt
+10
-0
No files found.
parameters_alpha.txt
View file @
c62a239a
...
...
@@ -31,10 +31,12 @@
42 200 PID_ATT_AWU 0.3
42 200 PID_ATT_D 30
42 200 PID_ATT_I 60
42 200 PID_ATT_LIM 100
42 200 PID_ATT_P 90
42 200 PID_POS_AWU 5
42 200 PID_POS_D 2
42 200 PID_POS_I 0.4
42 200 PID_POS_LIM 0.2
42 200 PID_POS_P 1.8
42 200 PID_POS_Z_AWU 3
42 200 PID_POS_Z_D 0.2
...
...
@@ -44,17 +46,19 @@
42 200 PID_YAWPOS_AWU 1
42 200 PID_YAWPOS_D 1
42 200 PID_YAWPOS_I 0.1
42 200 PID_YAWPOS_LIM 2
42 200 PID_YAWPOS_P 5
42 200 PID_YAWSPEED_D 0
42 200 PID_YAWSPEED_I
10
42 200 PID_YAWSPEED_P
30
42 200 PID_YAWSPEED_I
5
42 200 PID_YAWSPEED_P
15
42 200 PID_YAWSPE_AWU 1
42 200 PID_YAWSPE_LIM 50
42 200 POS_SP_ACCEPT 1
42 200 POS_SP_X
3.7
42 200 POS_SP_Y 0.3
42 200 POS_SP_YAW
0
42 200 POS_SP_Z
0
42 200 POS_TIMEOUT
2
e+06
42 200 POS_SP_X
1.09
42 200 POS_SP_Y 0.
52740
3
42 200 POS_SP_YAW
1.57763
42 200 POS_SP_Z
-0.7
42 200 POS_TIMEOUT
1
e+06
42 200 RC_NICK_CHAN 1
42 200 RC_ROLL_CHAN 2
42 200 RC_SAFETY_CHAN 5
...
...
parameters_bravo.txt
View file @
c62a239a
...
...
@@ -20,41 +20,45 @@
42 200 DEBUG_4 0
42 200 DEBUG_5 0
42 200 DEBUG_6 0
42 200 GYRO_OFFSET_X 298
30
42 200 GYRO_OFFSET_Y 299
90
42 200 GYRO_OFFSET_Z 294
40
42 200 GYRO_OFFSET_X 298
84
42 200 GYRO_OFFSET_Y 299
43
42 200 GYRO_OFFSET_Z 294
79
42 200 MIX_OFFSET 0
42 200 MIX_POSITION 0
42 200 MIX_POS_YAW 0
42 200 MIX_REMOTE 0
42 200 MIX_Z_POSITION 0
42 200 PID_ATT_AWU 0.3
42 200 PID_ATT_D 20
42 200 PID_ATT_I 40
42 200 PID_ATT_P 60
42 200 PID_ATT_D 10
42 200 PID_ATT_I 20
42 200 PID_ATT_LIM 100
42 200 PID_ATT_P 55
42 200 PID_POS_AWU 5
42 200 PID_POS_D 2
42 200 PID_POS_I 0.25
42 200 PID_POS_LIM 0.2
42 200 PID_POS_P 1.7
42 200 PID_POS_Z_AWU 3
42 200 PID_POS_Z_D 0.2
42 200 PID_POS_Z_I 0.2
42 200 PID_POS_Z_LIM 0.3
42 200 PID_POS_Z_P 0.
5
42 200 PID_POS_Z_P 0.
3
42 200 PID_YAWPOS_AWU 1
42 200 PID_YAWPOS_D 1
42 200 PID_YAWPOS_I 0.1
42 200 PID_YAWPOS_LIM 2
42 200 PID_YAWPOS_P 5
42 200 PID_YAWSPEED_D 0
42 200 PID_YAWSPEED_I
10
42 200 PID_YAWSPEED_P
30
42 200 PID_YAWSPEED_I
5
42 200 PID_YAWSPEED_P
15
42 200 PID_YAWSPE_AWU 1
42 200 POS_SP_ACCEPT 0
42 200 POS_SP_X 3.7
42 200 POS_SP_Y 0.3
42 200 PID_YAWSPE_LIM 50
42 200 POS_SP_ACCEPT 1
42 200 POS_SP_X 1.1
42 200 POS_SP_Y 1.1
42 200 POS_SP_YAW 0
42 200 POS_SP_Z -0.8
42 200 POS_TIMEOUT
500000
42 200 POS_TIMEOUT
1e+06
42 200 RC_NICK_CHAN 1
42 200 RC_ROLL_CHAN 2
42 200 RC_SAFETY_CHAN 5
...
...
src/uas/PxQuadMAV.cc
View file @
c62a239a
...
...
@@ -138,8 +138,6 @@ void PxQuadMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
emit
localizationChanged
(
this
,
status
.
position_fix
);
emit
visionLocalizationChanged
(
this
,
status
.
vision_fix
);
emit
gpsLocalizationChanged
(
this
,
status
.
gps_fix
);
qDebug
()
<<
"ATT CONTROL IS"
<<
status
.
control_att
;
}
break
;
default:
...
...
src/uas/UASWaypointManager.cc
View file @
c62a239a
...
...
@@ -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 @
c62a239a
...
...
@@ -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/HSIDisplay.cc
View file @
c62a239a
...
...
@@ -36,6 +36,7 @@ This file is part of the PIXHAWK project
#include "HSIDisplay.h"
#include "MG.h"
#include "QGC.h"
#include "Waypoint.h"
#include <QDebug>
...
...
@@ -79,7 +80,7 @@ HSIDisplay::HSIDisplay(QWidget *parent) :
uiYSetCoordinate
(
0.0
f
),
uiZSetCoordinate
(
0.0
f
),
uiYawSet
(
0.0
f
),
metricWidth
(
2
.0
f
),
metricWidth
(
4
.0
f
),
positionLock
(
false
),
attControlEnabled
(
false
),
xyControlEnabled
(
false
),
...
...
@@ -207,9 +208,12 @@ void HSIDisplay::paintDisplay()
drawLine
(
s
.
x
(),
s
.
y
(),
xCenterPos
,
yCenterPos
,
1.5
f
,
QGC
::
colorCyan
,
&
painter
);
}
// Draw waypoints
drawWaypoints
(
painter
);
// Labels on outer part and bottom
//
if (localAvailable > 0)
if
(
localAvailable
>
0
)
{
// Position
QString
str
;
...
...
@@ -230,11 +234,11 @@ void HSIDisplay::paintDisplay()
paintText
(
tr
(
"E"
),
ringColor
,
3.5
f
,
+
baseRadius
+
2.0
f
,
-
1.75
f
,
&
painter
);
paintText
(
tr
(
"W"
),
ringColor
,
3.5
f
,
-
baseRadius
-
5.5
f
,
-
1.75
f
,
&
painter
);
// // Just for testing
// bodyXSetCoordinate = 0.95 * bodyXSetCoordinate + 0.05 * uiXSetCoordinate;
// bodyYSetCoordinate = 0.95 * bodyYSetCoordinate + 0.05 * uiYSetCoordinate;
// bodyZSetCoordinate = 0.95 * bodyZSetCoordinate + 0.05 * uiZSetCoordinate;
// bodyYawSet = 0.95 * bodyYawSet + 0.05 * uiYawSet;
// // Just for testing
// bodyXSetCoordinate = 0.95 * bodyXSetCoordinate + 0.05 * uiXSetCoordinate;
// bodyYSetCoordinate = 0.95 * bodyYSetCoordinate + 0.05 * uiYSetCoordinate;
// bodyZSetCoordinate = 0.95 * bodyZSetCoordinate + 0.05 * uiZSetCoordinate;
// bodyYawSet = 0.95 * bodyYawSet + 0.05 * uiYawSet;
}
void
HSIDisplay
::
drawStatusFlag
(
float
x
,
float
y
,
QString
label
,
bool
status
,
QPainter
&
painter
)
...
...
@@ -503,11 +507,11 @@ void HSIDisplay::updatePositionSetpoints(int uasid, float xDesired, float yDesir
bodyYawSet
=
yawDesired
;
mavInitialized
=
true
;
// qDebug() << "Received setpoint at x: " << x << "metric y:" << y;
// posXSet = xDesired;
// posYSet = yDesired;
// posZSet = zDesired;
// posYawSet = yawDesired;
// qDebug() << "Received setpoint at x: " << x << "metric y:" << y;
// posXSet = xDesired;
// posYSet = yDesired;
// posZSet = zDesired;
// posYawSet = yawDesired;
}
void
HSIDisplay
::
updateLocalPosition
(
UASInterface
*
,
double
x
,
double
y
,
double
z
,
quint64
usec
)
...
...
@@ -628,25 +632,64 @@ void HSIDisplay::drawSetpointXY(float x, float y, float yaw, const QColor &color
void
HSIDisplay
::
drawWaypoints
(
QPainter
&
painter
)
{
QColor
color
=
uas
->
getColor
();
float
x
=
1.1
;
float
y
=
1.1
;
float
radius
=
vwidth
/
20.0
f
;
QPen
pen
(
color
);
pen
.
setWidthF
(
refLineWidthToPen
(
0.4
f
));
pen
.
setColor
(
color
);
painter
.
setPen
(
pen
);
painter
.
setBrush
(
Qt
::
NoBrush
);
QPointF
in
(
x
,
y
);
// Transform from body to world coordinates
in
=
metricWorldToBody
(
in
);
// Scale from metric to screen reference coordinates
QPointF
p
=
metricBodyToRef
(
in
);
drawCircle
(
p
.
x
(),
p
.
y
(),
radius
,
0.4
f
,
color
,
&
painter
);
radius
*=
0.8
;
drawLine
(
p
.
x
(),
p
.
y
(),
p
.
x
()
+
sin
(
yaw
)
*
radius
,
p
.
y
()
-
cos
(
yaw
)
*
radius
,
refLineWidthToPen
(
0.4
f
),
color
,
&
painter
);
painter
.
setBrush
(
color
);
drawCircle
(
p
.
x
(),
p
.
y
(),
radius
*
0.1
f
,
0.1
f
,
color
,
&
painter
);
if
(
uas
)
{
QVector
<
Waypoint
*>
list
=
QVector
<
Waypoint
*>
();
list
.
append
(
new
Waypoint
(
0
,
x
,
y
,
z
,
yaw
,
false
,
false
,
0.5
f
,
2000
));
list
.
append
(
new
Waypoint
(
0
,
x
+
0.1
,
y
+
0.1
,
z
,
yaw
,
true
,
true
,
0.5
f
,
2000
));
QColor
color
;
painter
.
setBrush
(
Qt
::
NoBrush
);
QPointF
lastWaypoint
;
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++
)
{
QPointF
in
(
list
.
at
(
i
)
->
getX
(),
list
.
at
(
i
)
->
getY
());
// Transform from world to body coordinates
in
=
metricWorldToBody
(
in
);
// Scale from metric to screen reference coordinates
QPointF
p
=
metricBodyToRef
(
in
);
// Select color based on if this is the current waypoint
if
(
list
.
at
(
i
)
->
getCurrent
())
{
color
=
uas
->
getColor
().
lighter
().
lighter
();
}
else
{
color
=
uas
->
getColor
();
}
// Setup pen
QPen
pen
(
color
);
pen
.
setWidthF
(
refLineWidthToPen
(
0.4
f
));
painter
.
setPen
(
pen
);
painter
.
setBrush
(
Qt
::
NoBrush
);
// Draw line from last waypoint to this one
if
(
!
lastWaypoint
.
isNull
())
{
drawLine
(
lastWaypoint
.
x
(),
lastWaypoint
.
y
(),
p
.
x
(),
p
.
y
(),
refLineWidthToPen
(
0.4
f
),
color
,
&
painter
);
}
lastWaypoint
=
p
;
//drawCircle(p.x(), p.y(), radius, 0.4f, color, &painter);
float
waypointSize
=
vwidth
/
20.0
f
*
2.0
f
;
QPolygonF
poly
(
4
);
// Top point
poly
.
replace
(
0
,
QPointF
(
p
.
x
(),
p
.
y
()
-
waypointSize
/
2.0
f
));
// Right point
poly
.
replace
(
1
,
QPointF
(
p
.
x
()
+
waypointSize
/
2.0
f
,
p
.
y
()));
// Bottom point
poly
.
replace
(
2
,
QPointF
(
p
.
x
(),
p
.
y
()
+
waypointSize
/
2.0
f
));
poly
.
replace
(
3
,
QPointF
(
p
.
x
()
-
waypointSize
/
2.0
f
,
p
.
y
()));
drawPolygon
(
poly
,
&
painter
);
float
radius
=
(
waypointSize
/
2.0
f
)
*
0.8
*
(
1
/
sqrt
(
2.0
f
));
drawLine
(
p
.
x
(),
p
.
y
(),
p
.
x
()
+
sin
(
yaw
)
*
radius
,
p
.
y
()
-
cos
(
yaw
)
*
radius
,
refLineWidthToPen
(
0.4
f
),
color
,
&
painter
);
painter
.
setBrush
(
color
);
}
}
}
void
HSIDisplay
::
drawSafetyArea
(
const
QPointF
&
topLeft
,
const
QPointF
&
bottomRight
,
const
QColor
&
color
,
QPainter
&
painter
)
...
...
src/ui/HSIDisplay.h
View file @
c62a239a
...
...
@@ -99,7 +99,7 @@ protected slots:
void
drawWaypoints
(
QPainter
&
painter
);
/** @brief Draw the limiting safety area */
void
drawSafetyArea
(
const
QPointF
&
topLeft
,
const
QPointF
&
bottomRight
,
const
QColor
&
color
,
QPainter
&
painter
);
/** @brief Receive mouse clicks */
void
mouseDoubleClickEvent
(
QMouseEvent
*
event
);
protected:
...
...
src/ui/UASControl.ui
View file @
c62a239a
...
...
@@ -6,14 +6,20 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
3
80
</width>
<height>
1
90
</height>
<width>
2
80
</width>
<height>
1
64
</height>
</rect>
</property>
<property
name=
"minimumSize"
>
<size>
<width>
280
</width>
<height>
130
</height>
</size>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
rowminimumheight=
"
0,0,0,0,0,0,10
0"
>
<layout
class=
"QGridLayout"
name=
"gridLayout"
rowminimumheight=
"
5,10,10,0,10,5,
0"
>
<property
name=
"leftMargin"
>
<number>
6
</number>
</property>
...
...
@@ -147,10 +153,13 @@
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeType"
>
<enum>
QSizePolicy::Expanding
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
2
0
</width>
<height>
0
</height>
<width>
0
</width>
<height>
1
</height>
</size>
</property>
</spacer>
...
...
src/ui/UASInfo.ui
View file @
c62a239a
...
...
@@ -287,7 +287,7 @@
<item
row=
"3"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_3"
>
<property
name=
"text"
>
<string>
CP
U Load
</string>
<string>
MC
U Load
</string>
</property>
</widget>
</item>
...
...
@@ -370,14 +370,14 @@
</property>
</widget>
</item>
<item
row=
"
4
"
column=
"0"
colspan=
"6"
>
<item
row=
"
5
"
column=
"0"
colspan=
"6"
>
<widget
class=
"Line"
name=
"line"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
</widget>
</item>
<item
row=
"
6
"
column=
"0"
colspan=
"7"
>
<item
row=
"
7
"
column=
"0"
colspan=
"7"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
...
...
@@ -393,13 +393,69 @@
</property>
</spacer>
</item>
<item
row=
"
5
"
column=
"0"
colspan=
"6"
>
<item
row=
"
6
"
column=
"0"
colspan=
"6"
>
<widget
class=
"QLabel"
name=
"errorLabel"
>
<property
name=
"text"
>
<string>
No error status received yet
</string>
</property>
</widget>
</item>
<item
row=
"4"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_4"
>
<property
name=
"text"
>
<string>
CPU Load
</string>
</property>
</widget>
</item>
<item
row=
"4"
column=
"2"
>
<widget
class=
"QLabel"
name=
"label_5"
>
<property
name=
"text"
>
<string>
0
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
</set>
</property>
</widget>
</item>
<item
row=
"4"
column=
"3"
>
<widget
class=
"QLabel"
name=
"label_10"
>
<property
name=
"text"
>
<string>
%
</string>
</property>
</widget>
</item>
<item
row=
"4"
column=
"4"
colspan=
"2"
>
<widget
class=
"QProgressBar"
name=
"progressBar"
>
<property
name=
"maximumSize"
>
<size>
<width>
16777215
</width>
<height>
20
</height>
</size>
</property>
<property
name=
"baseSize"
>
<size>
<width>
0
</width>
<height>
18
</height>
</size>
</property>
<property
name=
"value"
>
<number>
24
</number>
</property>
</widget>
</item>
<item
row=
"4"
column=
"1"
>
<spacer
name=
"horizontalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
13
</width>
<height>
15
</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
...
...
src/ui/WaypointList.cc
View file @
c62a239a
This diff is collapsed.
Click to expand it.
src/ui/WaypointList.h
View file @
c62a239a
...
...
@@ -62,7 +62,10 @@ public slots:
void
loadWaypoints
();
void
transmit
();
void
read
();
/** @brief Add a waypoint */
void
add
();
/** @brief Add a waypoint at the current MAV position */
void
addCurrentPositonWaypoint
();
void
moveUp
(
Waypoint
*
wp
);
void
moveDown
(
Waypoint
*
wp
);
...
...
@@ -70,25 +73,28 @@ 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
;
double
mavX
;
double
mavY
;
double
mavZ
;
double
mavYaw
;
private:
Ui
::
WaypointList
*
m_ui
;
...
...
src/ui/WaypointList.ui
View file @
c62a239a
...
...
@@ -26,7 +26,7 @@
<property
name=
"spacing"
>
<number>
4
</number>
</property>
<item
row=
"0"
column=
"0"
colspan=
"
8
"
>
<item
row=
"0"
column=
"0"
colspan=
"
9
"
>
<widget
class=
"QScrollArea"
name=
"scrollArea"
>
<property
name=
"widgetResizable"
>
<bool>
true
</bool>
...
...
@@ -37,7 +37,7 @@
<x>
0
</x>
<y>
0
</y>
<width>
466
</width>
<height>
14
8
</height>
<height>
14
9
</height>
</rect>
</property>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
...
...
@@ -54,7 +54,7 @@
</widget>
</widget>
</item>
<item
row=
"2"
column=
"
6
"
>
<item
row=
"2"
column=
"
7
"
>
<widget
class=
"QPushButton"
name=
"readButton"
>
<property
name=
"text"
>
<string>
Read
</string>
...
...
@@ -65,7 +65,7 @@
</property>
</widget>
</item>
<item
row=
"2"
column=
"
7
"
>
<item
row=
"2"
column=
"
8
"
>
<widget
class=
"QPushButton"
name=
"transmitButton"
>
<property
name=
"text"
>
<string>
Write
</string>
...
...
@@ -76,14 +76,14 @@
</property>
</widget>
</item>
<item
row=
"3"
column=
"0"
colspan=
"
8
"
>
<item
row=
"3"
column=
"0"
colspan=
"
9
"
>
<widget
class=
"QLabel"
name=
"statusLabel"
>
<property
name=
"text"
>
<string>
TextLabel
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"
5
"
>
<item
row=
"2"
column=
"
6
"
>
<widget
class=
"QToolButton"
name=
"addButton"
>
<property
name=
"text"
>
<string>
...
</string>
...
...
@@ -121,6 +121,20 @@
</property>
</spacer>
</item>
<item
row=
"2"
column=
"5"
>
<widget
class=
"QToolButton"
name=
"positionAddButton"
>
<property
name=
"toolTip"
>
<string>
Set the current vehicle position as new waypoint
</string>
</property>
<property
name=
"text"
>
<string>
...
</string>
</property>
<property
name=
"icon"
>
<iconset
resource=
"../../mavground.qrc"
>
<normaloff>
:/images/actions/go-bottom.svg
</normaloff>
:/images/actions/go-bottom.svg
</iconset>
</property>
</widget>
</item>
</layout>
<action
name=
"actionAddWaypoint"
>
<property
name=
"icon"
>
...
...
src/ui/uas/UASControlWidget.cc
View file @
c62a239a
...
...
@@ -201,16 +201,14 @@ void UASControlWidget::cycleContextButton()
if
(
!
engineOn
)
{
ui
.
controlButton
->
setText
(
tr
(
"Stop Engine"
));
mav
->
setMode
(
MAV_MODE_MANUAL
);
mav
->
enable_motors
();
ui
.
lastActionLabel
->
setText
(
QString
(
"
Enabled
motors on %1"
).
arg
(
uas
->
getUASName
()));
ui
.
lastActionLabel
->
setText
(
QString
(
"
Attempted to enable
motors on %1"
).
arg
(
uas
->
getUASName
()));
}
else
{
ui
.
controlButton
->
setText
(
tr
(
"Activate Engine"
));
mav
->
setMode
(
MAV_MODE_LOCKED
);
mav
->
disable_motors
();
ui
.
lastActionLabel
->
setText
(
QString
(
"
Disabled
motors on %1"
).
arg
(
uas
->
getUASName
()));
ui
.
lastActionLabel
->
setText
(
QString
(
"
Attempted to disable
motors on %1"
).
arg
(
uas
->
getUASName
()));
}
//ui.controlButton->setText(tr("Force Landing"));
//ui.controlButton->setText(tr("KILL VEHICLE"));
...
...
src/ui/uas/UASInfoWidget.cc
View file @
c62a239a
...
...
@@ -125,7 +125,7 @@ void UASInfoWidget::updateCPULoad(UASInterface* uas, double load)
{
if
(
activeUAS
==
uas
)
{
this
->
load
=
load
;
this
->
load
=
this
->
load
*
0.8
f
+
load
*
0.2
f
;
}
}
...
...
src/ui/uas/UASView.cc
View file @
c62a239a
...
...
@@ -36,6 +36,7 @@ This file is part of the PIXHAWK project
#include "MG.h"
#include "UASManager.h"
#include "UASView.h"
#include "UASWaypointManager.h"
#include "ui_UASView.h"
UASView
::
UASView
(
UASInterface
*
uas
,
QWidget
*
parent
)
:
...
...
@@ -75,6 +76,7 @@ UASView::UASView(UASInterface* uas, QWidget *parent) :
connect
(
uas
,
SIGNAL
(
loadChanged
(
UASInterface
*
,
double
)),
this
,
SLOT
(
updateLoad
(
UASInterface
*
,
double
)));
//connect(uas, SIGNAL(waypointUpdated(int,int,double,double,double,double,bool,bool)), this, SLOT(setWaypoint(int,int,double,double,double,double,bool,bool)));
connect
(
uas
,
SIGNAL
(
waypointSelected
(
int
,
int
)),
this
,
SLOT
(
selectWaypoint
(
int
,
int
)));
connect
(
&
(
uas
->
getWaypointManager
()),
SIGNAL
(
currentWaypointChanged
(
quint16
)),
this
,
SLOT
(
currentWaypointUpdated
(
quint16
)));
connect
(
uas
,
SIGNAL
(
systemTypeSet
(
UASInterface
*
,
uint
)),
this
,
SLOT
(
setSystemType
(
UASInterface
*
,
uint
)));
// Setup UAS selection
...
...
@@ -251,6 +253,11 @@ void UASView::updateSpeed(UASInterface*, double x, double y, double z, quint64 u
totalSpeed
=
sqrt
((
pow
(
x
,
2
)
+
pow
(
y
,
2
)
+
pow
(
z
,
2
)));
}
void
UASView
::
currentWaypointUpdated
(
quint16
waypoint
)
{
m_ui
->
waypointLabel
->
setText
(
tr
(
"WP"
)
+
QString
::
number
(
waypoint
));
}
void
UASView
::
setWaypoint
(
int
uasId
,
int
id
,
double
x
,
double
y
,
double
z
,
double
yaw
,
bool
autocontinue
,
bool
current
)
{
Q_UNUSED
(
x
);
...
...
src/ui/uas/UASView.h
View file @
c62a239a
...
...
@@ -63,6 +63,8 @@ public slots:
void
refresh
();
/** @brief Receive new waypoint information */
void
setWaypoint
(
int
uasId
,
int
id
,
double
x
,
double
y
,
double
z
,
double
yaw
,
bool
autocontinue
,
bool
current
);
/** @brief Update the current active waypoint */
void
currentWaypointUpdated
(
quint16
waypoint
);
/** @brief Set waypoint as current target */
void
selectWaypoint
(
int
uasId
,
int
id
);
/** @brief Set the current system type */
...
...
waypoints-final-pole-racing.txt
0 → 100644
View file @
c62a239a
0 1.60066 0.497923 -0.7 -0.156858 1 1 0.15 2000
1 0.973377 0.691139 -0.7 -0.0664193 1 0 0.15 2000
2 0.646637 1.57225 -0.7 6.26573 1 0 0.15 2000
3 0.659852 2.39951 -0.7 -0.0549587 1 0 0.15 2000
4 1.41441 2.8804 -0.7 -0.0258336 1 0 0.15 2000
5 2.33563 2.90308 -0.7 -0.0621037 1 0 0.15 2000
6 2.76383 2.04368 -0.7 -0.0381553 1 0 0.15 2000
7 2.73091 1.05595 -0.7 -0.0520457 1 0 0.15 2000
8 1.73409 0.599043 0 6.26573 1 0 0.15 2000
waypoints_A0_circle.txt
View file @
c62a239a
0 1.75 0.5 -0.
8 0 0 1 0.1 2
000
1 1.75 0.5 -0.
8 0 1 0 0.1 2
000
2 0.
6 0.5 -0.8 0 0 0 0.1 2
000
3 0.5 1.5 -0.
8 0 1 0 0.1 2
000
4 0.5 2.8 -0.
8 0 1 0 0.1 2
000
5 1.75 2.8 -0.
8 0 1 0 0.1 2
000
6
2.8 2.8 -0.8 0 1 0 0.1 2
000
7 2.8 1.75 -0.
8 0 1 0 0.1 2
000
8 2.8 0.
5 -0.8 0 1 0 0.1 2
000
9 1.75 0.5 -0.
8 0 1 0 0.1 2
000
10 1.75 0.5 0 0
1 0 0.1 2
000
0 1.75 0.5 -0.
7 0 1 0 0.3 1
000
1 1.75 0.5 -0.
7 0 1 0 0.3 1
000
2 0.
95 0.5 -0.7 0 1 0 0.3 1
000
3 0.5 1.5 -0.
7 0 1 1 0.3 1
000
4 0.5 2.8 -0.
7 0 1 0 0.3 1
000
5 1.75 2.8 -0.
7 0 1 0 0.3 1
000
6
3 2.8 -0.7 0 1 0 0.3 1
000
7 2.8 1.75 -0.
7 0 1 0 0.3 1
000
8 2.8 0.
7 -0.7 0 1 0 0.3 1
000
9 1.75 0.5 -0.
7 0 1 0 0.3 1
000
10 1.75 0.5 0 0
0 0 0.3 1
000
waypoints_A0_circlev2.txt
0 → 100644
View file @
c62a239a
0 1.75 0.5 -0.7 0 1 1 0.15 10000
1 0.95 0.5 -0.7 0 1 0 0.15 2000
2 0.5 1.5 -0.7 0 1 0 0.15 2000
3 0.5 2.8 -0.7 0 1 0 0.15 2000
4 1.75 2.8 -0.7 0 1 0 0.15 2000
5 2.8 2.8 -0.7 0 1 0 0.15 2000
6 2.8 1.75 -0.7 0 1 0 0.15 2000
7 2.8 0.7 -0.7 0 1 0 0.15 2000
8 1.75 0.5 -0.7 0 1 0 0.15 2000
9 1.75 0.5 0 0 0 0 0.15 2000
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