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
dffd1ce9
Commit
dffd1ce9
authored
Jul 03, 2010
by
lm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added option to add local waypoints, added waypoint visualization
parent
0d2be655
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
134 additions
and
66 deletions
+134
-66
PxQuadMAV.cc
src/uas/PxQuadMAV.cc
+0
-2
HSIDisplay.cc
src/ui/HSIDisplay.cc
+59
-56
WaypointList.cc
src/ui/WaypointList.cc
+45
-1
WaypointList.h
src/ui/WaypointList.h
+9
-0
WaypointList.ui
src/ui/WaypointList.ui
+20
-6
UASInfoWidget.cc
src/ui/uas/UASInfoWidget.cc
+1
-1
No files found.
src/uas/PxQuadMAV.cc
View file @
dffd1ce9
...
@@ -136,8 +136,6 @@ void PxQuadMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
...
@@ -136,8 +136,6 @@ void PxQuadMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
emit
localizationChanged
(
this
,
status
.
position_fix
);
emit
localizationChanged
(
this
,
status
.
position_fix
);
emit
visionLocalizationChanged
(
this
,
status
.
vision_fix
);
emit
visionLocalizationChanged
(
this
,
status
.
vision_fix
);
emit
gpsLocalizationChanged
(
this
,
status
.
gps_fix
);
emit
gpsLocalizationChanged
(
this
,
status
.
gps_fix
);
qDebug
()
<<
"ATT CONTROL IS"
<<
status
.
control_att
;
}
}
break
;
break
;
default:
default:
...
...
src/ui/HSIDisplay.cc
View file @
dffd1ce9
...
@@ -234,11 +234,11 @@ void HSIDisplay::paintDisplay()
...
@@ -234,11 +234,11 @@ void HSIDisplay::paintDisplay()
paintText
(
tr
(
"E"
),
ringColor
,
3.5
f
,
+
baseRadius
+
2.0
f
,
-
1.75
f
,
&
painter
);
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
);
paintText
(
tr
(
"W"
),
ringColor
,
3.5
f
,
-
baseRadius
-
5.5
f
,
-
1.75
f
,
&
painter
);
// // Just for testing
// // Just for testing
// bodyXSetCoordinate = 0.95 * bodyXSetCoordinate + 0.05 * uiXSetCoordinate;
// bodyXSetCoordinate = 0.95 * bodyXSetCoordinate + 0.05 * uiXSetCoordinate;
// bodyYSetCoordinate = 0.95 * bodyYSetCoordinate + 0.05 * uiYSetCoordinate;
// bodyYSetCoordinate = 0.95 * bodyYSetCoordinate + 0.05 * uiYSetCoordinate;
// bodyZSetCoordinate = 0.95 * bodyZSetCoordinate + 0.05 * uiZSetCoordinate;
// bodyZSetCoordinate = 0.95 * bodyZSetCoordinate + 0.05 * uiZSetCoordinate;
// bodyYawSet = 0.95 * bodyYawSet + 0.05 * uiYawSet;
// bodyYawSet = 0.95 * bodyYawSet + 0.05 * uiYawSet;
}
}
void
HSIDisplay
::
drawStatusFlag
(
float
x
,
float
y
,
QString
label
,
bool
status
,
QPainter
&
painter
)
void
HSIDisplay
::
drawStatusFlag
(
float
x
,
float
y
,
QString
label
,
bool
status
,
QPainter
&
painter
)
...
@@ -507,11 +507,11 @@ void HSIDisplay::updatePositionSetpoints(int uasid, float xDesired, float yDesir
...
@@ -507,11 +507,11 @@ void HSIDisplay::updatePositionSetpoints(int uasid, float xDesired, float yDesir
bodyYawSet
=
yawDesired
;
bodyYawSet
=
yawDesired
;
mavInitialized
=
true
;
mavInitialized
=
true
;
// qDebug() << "Received setpoint at x: " << x << "metric y:" << y;
// qDebug() << "Received setpoint at x: " << x << "metric y:" << y;
// posXSet = xDesired;
// posXSet = xDesired;
// posYSet = yDesired;
// posYSet = yDesired;
// posZSet = zDesired;
// posZSet = zDesired;
// posYawSet = yawDesired;
// posYawSet = yawDesired;
}
}
void
HSIDisplay
::
updateLocalPosition
(
UASInterface
*
,
double
x
,
double
y
,
double
z
,
quint64
usec
)
void
HSIDisplay
::
updateLocalPosition
(
UASInterface
*
,
double
x
,
double
y
,
double
z
,
quint64
usec
)
...
@@ -632,6 +632,8 @@ void HSIDisplay::drawSetpointXY(float x, float y, float yaw, const QColor &color
...
@@ -632,6 +632,8 @@ void HSIDisplay::drawSetpointXY(float x, float y, float yaw, const QColor &color
void
HSIDisplay
::
drawWaypoints
(
QPainter
&
painter
)
void
HSIDisplay
::
drawWaypoints
(
QPainter
&
painter
)
{
{
if
(
uas
)
{
QVector
<
Waypoint
*>
list
=
QVector
<
Waypoint
*>
();
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
,
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
));
list
.
append
(
new
Waypoint
(
0
,
x
+
0.1
,
y
+
0.1
,
z
,
yaw
,
true
,
true
,
0.5
f
,
2000
));
...
@@ -686,6 +688,7 @@ void HSIDisplay::drawWaypoints(QPainter& painter)
...
@@ -686,6 +688,7 @@ void HSIDisplay::drawWaypoints(QPainter& painter)
drawLine
(
p
.
x
(),
p
.
y
(),
p
.
x
()
+
sin
(
yaw
)
*
radius
,
p
.
y
()
-
cos
(
yaw
)
*
radius
,
refLineWidthToPen
(
0.4
f
),
color
,
&
painter
);
drawLine
(
p
.
x
(),
p
.
y
(),
p
.
x
()
+
sin
(
yaw
)
*
radius
,
p
.
y
()
-
cos
(
yaw
)
*
radius
,
refLineWidthToPen
(
0.4
f
),
color
,
&
painter
);
painter
.
setBrush
(
color
);
painter
.
setBrush
(
color
);
}
}
}
}
}
void
HSIDisplay
::
drawSafetyArea
(
const
QPointF
&
topLeft
,
const
QPointF
&
bottomRight
,
const
QColor
&
color
,
QPainter
&
painter
)
void
HSIDisplay
::
drawSafetyArea
(
const
QPointF
&
topLeft
,
const
QPointF
&
bottomRight
,
const
QColor
&
color
,
QPainter
&
painter
)
...
...
src/ui/WaypointList.cc
View file @
dffd1ce9
...
@@ -41,6 +41,10 @@ This file is part of the PIXHAWK project
...
@@ -41,6 +41,10 @@ This file is part of the PIXHAWK project
WaypointList
::
WaypointList
(
QWidget
*
parent
,
UASInterface
*
uas
)
:
WaypointList
::
WaypointList
(
QWidget
*
parent
,
UASInterface
*
uas
)
:
QWidget
(
parent
),
QWidget
(
parent
),
uas
(
NULL
),
uas
(
NULL
),
mavX
(
0.0
),
mavY
(
0.0
),
mavZ
(
0.0
),
mavYaw
(
0.0
),
m_ui
(
new
Ui
::
WaypointList
)
m_ui
(
new
Ui
::
WaypointList
)
{
{
m_ui
->
setupUi
(
this
);
m_ui
->
setupUi
(
this
);
...
@@ -60,6 +64,9 @@ WaypointList::WaypointList(QWidget *parent, UASInterface* uas) :
...
@@ -60,6 +64,9 @@ WaypointList::WaypointList(QWidget *parent, UASInterface* uas) :
connect
(
m_ui
->
addButton
,
SIGNAL
(
clicked
()),
m_ui
->
actionAddWaypoint
,
SIGNAL
(
triggered
()));
connect
(
m_ui
->
addButton
,
SIGNAL
(
clicked
()),
m_ui
->
actionAddWaypoint
,
SIGNAL
(
triggered
()));
connect
(
m_ui
->
actionAddWaypoint
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
add
()));
connect
(
m_ui
->
actionAddWaypoint
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
add
()));
// ADD WAYPOINT AT CURRENT POSITION
connect
(
m_ui
->
positionAddButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
addCurrentPositonWaypoint
()));
// SEND WAYPOINTS
// SEND WAYPOINTS
connect
(
m_ui
->
transmitButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
transmit
()));
connect
(
m_ui
->
transmitButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
transmit
()));
...
@@ -89,6 +96,24 @@ void WaypointList::updateStatusLabel(const QString &string)
...
@@ -89,6 +96,24 @@ void WaypointList::updateStatusLabel(const QString &string)
m_ui
->
statusLabel
->
setText
(
string
);
m_ui
->
statusLabel
->
setText
(
string
);
}
}
void
WaypointList
::
updateLocalPosition
(
UASInterface
*
uas
,
double
x
,
double
y
,
double
z
,
quint64
usec
)
{
Q_UNUSED
(
uas
);
Q_UNUSED
(
usec
);
mavX
=
x
;
mavY
=
y
;
mavZ
=
z
;
}
void
WaypointList
::
updateAttitude
(
UASInterface
*
uas
,
double
roll
,
double
pitch
,
double
yaw
,
quint64
usec
)
{
Q_UNUSED
(
uas
);
Q_UNUSED
(
usec
);
Q_UNUSED
(
roll
);
Q_UNUSED
(
pitch
);
mavYaw
=
yaw
;
}
void
WaypointList
::
setUAS
(
UASInterface
*
uas
)
void
WaypointList
::
setUAS
(
UASInterface
*
uas
)
{
{
if
(
this
->
uas
==
NULL
&&
uas
!=
NULL
)
if
(
this
->
uas
==
NULL
&&
uas
!=
NULL
)
...
@@ -98,6 +123,8 @@ void WaypointList::setUAS(UASInterface* uas)
...
@@ -98,6 +123,8 @@ void WaypointList::setUAS(UASInterface* uas)
connect
(
&
uas
->
getWaypointManager
(),
SIGNAL
(
updateStatusString
(
const
QString
&
)),
this
,
SLOT
(
updateStatusLabel
(
const
QString
&
)));
connect
(
&
uas
->
getWaypointManager
(),
SIGNAL
(
updateStatusString
(
const
QString
&
)),
this
,
SLOT
(
updateStatusLabel
(
const
QString
&
)));
connect
(
&
uas
->
getWaypointManager
(),
SIGNAL
(
waypointUpdated
(
int
,
quint16
,
double
,
double
,
double
,
double
,
bool
,
bool
,
double
,
int
)),
this
,
SLOT
(
setWaypoint
(
int
,
quint16
,
double
,
double
,
double
,
double
,
bool
,
bool
,
double
,
int
)));
connect
(
&
uas
->
getWaypointManager
(),
SIGNAL
(
waypointUpdated
(
int
,
quint16
,
double
,
double
,
double
,
double
,
bool
,
bool
,
double
,
int
)),
this
,
SLOT
(
setWaypoint
(
int
,
quint16
,
double
,
double
,
double
,
double
,
bool
,
bool
,
double
,
int
)));
connect
(
&
uas
->
getWaypointManager
(),
SIGNAL
(
currentWaypointChanged
(
quint16
)),
this
,
SLOT
(
currentWaypointChanged
(
quint16
)));
connect
(
&
uas
->
getWaypointManager
(),
SIGNAL
(
currentWaypointChanged
(
quint16
)),
this
,
SLOT
(
currentWaypointChanged
(
quint16
)));
connect
(
uas
,
SIGNAL
(
localPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
updateLocalPosition
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
connect
(
uas
,
SIGNAL
(
attitudeChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
updateAttitude
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
connect
(
this
,
SIGNAL
(
sendWaypoints
(
const
QVector
<
Waypoint
*>
&
)),
&
uas
->
getWaypointManager
(),
SLOT
(
sendWaypoints
(
const
QVector
<
Waypoint
*>
&
)));
connect
(
this
,
SIGNAL
(
sendWaypoints
(
const
QVector
<
Waypoint
*>
&
)),
&
uas
->
getWaypointManager
(),
SLOT
(
sendWaypoints
(
const
QVector
<
Waypoint
*>
&
)));
connect
(
this
,
SIGNAL
(
requestWaypoints
()),
&
uas
->
getWaypointManager
(),
SLOT
(
requestWaypoints
()));
connect
(
this
,
SIGNAL
(
requestWaypoints
()),
&
uas
->
getWaypointManager
(),
SLOT
(
requestWaypoints
()));
...
@@ -173,11 +200,28 @@ void WaypointList::add()
...
@@ -173,11 +200,28 @@ void WaypointList::add()
}
}
else
else
{
{
addWaypoint
(
new
Waypoint
(
waypoints
.
size
(),
1.1
,
1.1
,
-
0.8
,
0.0
,
true
,
true
,
0.1
,
1
000
));
addWaypoint
(
new
Waypoint
(
waypoints
.
size
(),
1.1
,
1.1
,
-
0.8
,
0.0
,
true
,
true
,
0.1
5
,
2
000
));
}
}
}
}
}
}
void
WaypointList
::
addCurrentPositonWaypoint
()
{
if
(
uas
)
{
if
(
waypoints
.
size
()
>
0
)
{
Waypoint
*
last
=
waypoints
.
at
(
waypoints
.
size
()
-
1
);
addWaypoint
(
new
Waypoint
(
waypoints
.
size
(),
mavX
,
mavY
,
mavZ
,
mavYaw
,
last
->
getAutoContinue
(),
false
,
last
->
getOrbit
(),
last
->
getHoldTime
()));
}
else
{
addWaypoint
(
new
Waypoint
(
waypoints
.
size
(),
mavX
,
mavY
,
mavZ
,
mavYaw
,
true
,
true
,
0.15
,
2000
));
}
}
}
void
WaypointList
::
addWaypoint
(
Waypoint
*
wp
)
void
WaypointList
::
addWaypoint
(
Waypoint
*
wp
)
{
{
waypoints
.
push_back
(
wp
);
waypoints
.
push_back
(
wp
);
...
...
src/ui/WaypointList.h
View file @
dffd1ce9
...
@@ -62,7 +62,10 @@ public slots:
...
@@ -62,7 +62,10 @@ public slots:
void
loadWaypoints
();
void
loadWaypoints
();
void
transmit
();
void
transmit
();
void
read
();
void
read
();
/** @brief Add a waypoint */
void
add
();
void
add
();
/** @brief Add a waypoint at the current MAV position */
void
addCurrentPositonWaypoint
();
void
moveUp
(
Waypoint
*
wp
);
void
moveUp
(
Waypoint
*
wp
);
void
moveDown
(
Waypoint
*
wp
);
void
moveDown
(
Waypoint
*
wp
);
...
@@ -76,6 +79,8 @@ public slots:
...
@@ -76,6 +79,8 @@ public slots:
void
addWaypoint
(
Waypoint
*
wp
);
void
addWaypoint
(
Waypoint
*
wp
);
void
removeWaypoint
(
Waypoint
*
wp
);
void
removeWaypoint
(
Waypoint
*
wp
);
void
waypointReached
(
UASInterface
*
uas
,
quint16
waypointId
);
void
waypointReached
(
UASInterface
*
uas
,
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:
signals:
void
sendWaypoints
(
const
QVector
<
Waypoint
*>
&
);
void
sendWaypoints
(
const
QVector
<
Waypoint
*>
&
);
...
@@ -89,6 +94,10 @@ protected:
...
@@ -89,6 +94,10 @@ protected:
QMap
<
Waypoint
*
,
WaypointView
*>
wpViews
;
QMap
<
Waypoint
*
,
WaypointView
*>
wpViews
;
QVBoxLayout
*
listLayout
;
QVBoxLayout
*
listLayout
;
UASInterface
*
uas
;
UASInterface
*
uas
;
double
mavX
;
double
mavY
;
double
mavZ
;
double
mavYaw
;
private:
private:
Ui
::
WaypointList
*
m_ui
;
Ui
::
WaypointList
*
m_ui
;
...
...
src/ui/WaypointList.ui
View file @
dffd1ce9
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
<property
name=
"spacing"
>
<property
name=
"spacing"
>
<number>
4
</number>
<number>
4
</number>
</property>
</property>
<item
row=
"0"
column=
"0"
colspan=
"
8
"
>
<item
row=
"0"
column=
"0"
colspan=
"
9
"
>
<widget
class=
"QScrollArea"
name=
"scrollArea"
>
<widget
class=
"QScrollArea"
name=
"scrollArea"
>
<property
name=
"widgetResizable"
>
<property
name=
"widgetResizable"
>
<bool>
true
</bool>
<bool>
true
</bool>
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
<x>
0
</x>
<x>
0
</x>
<y>
0
</y>
<y>
0
</y>
<width>
466
</width>
<width>
466
</width>
<height>
14
8
</height>
<height>
14
9
</height>
</rect>
</rect>
</property>
</property>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
</widget>
</widget>
</widget>
</widget>
</item>
</item>
<item
row=
"2"
column=
"
6
"
>
<item
row=
"2"
column=
"
7
"
>
<widget
class=
"QPushButton"
name=
"readButton"
>
<widget
class=
"QPushButton"
name=
"readButton"
>
<property
name=
"text"
>
<property
name=
"text"
>
<string>
Read
</string>
<string>
Read
</string>
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
</property>
</property>
</widget>
</widget>
</item>
</item>
<item
row=
"2"
column=
"
7
"
>
<item
row=
"2"
column=
"
8
"
>
<widget
class=
"QPushButton"
name=
"transmitButton"
>
<widget
class=
"QPushButton"
name=
"transmitButton"
>
<property
name=
"text"
>
<property
name=
"text"
>
<string>
Write
</string>
<string>
Write
</string>
...
@@ -76,14 +76,14 @@
...
@@ -76,14 +76,14 @@
</property>
</property>
</widget>
</widget>
</item>
</item>
<item
row=
"3"
column=
"0"
colspan=
"
8
"
>
<item
row=
"3"
column=
"0"
colspan=
"
9
"
>
<widget
class=
"QLabel"
name=
"statusLabel"
>
<widget
class=
"QLabel"
name=
"statusLabel"
>
<property
name=
"text"
>
<property
name=
"text"
>
<string>
TextLabel
</string>
<string>
TextLabel
</string>
</property>
</property>
</widget>
</widget>
</item>
</item>
<item
row=
"2"
column=
"
5
"
>
<item
row=
"2"
column=
"
6
"
>
<widget
class=
"QToolButton"
name=
"addButton"
>
<widget
class=
"QToolButton"
name=
"addButton"
>
<property
name=
"text"
>
<property
name=
"text"
>
<string>
...
</string>
<string>
...
</string>
...
@@ -121,6 +121,20 @@
...
@@ -121,6 +121,20 @@
</property>
</property>
</spacer>
</spacer>
</item>
</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>
</layout>
<action
name=
"actionAddWaypoint"
>
<action
name=
"actionAddWaypoint"
>
<property
name=
"icon"
>
<property
name=
"icon"
>
...
...
src/ui/uas/UASInfoWidget.cc
View file @
dffd1ce9
...
@@ -125,7 +125,7 @@ void UASInfoWidget::updateCPULoad(UASInterface* uas, double load)
...
@@ -125,7 +125,7 @@ void UASInfoWidget::updateCPULoad(UASInterface* uas, double load)
{
{
if
(
activeUAS
==
uas
)
if
(
activeUAS
==
uas
)
{
{
this
->
load
=
load
;
this
->
load
=
this
->
load
*
0.8
f
+
load
*
0.2
f
;
}
}
}
}
...
...
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