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
0d1656d8
Commit
0d1656d8
authored
May 07, 2013
by
Michael Carpenter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT for Distance to waypoint property
parent
fefba511
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
0 deletions
+35
-0
UAS.cc
src/uas/UAS.cc
+9
-0
UAS.h
src/uas/UAS.h
+14
-0
UASQuickView.cpp
src/ui/uas/UASQuickView.cpp
+12
-0
No files found.
src/uas/UAS.cc
View file @
0d1656d8
...
...
@@ -1344,6 +1344,15 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
case
MAVLINK_MSG_ID_RAW_IMU
:
case
MAVLINK_MSG_ID_SCALED_IMU
:
case
MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT
:
{
//mavlink_set_local_position_setpoint_t p;
//mavlink_msg_set_local_position_setpoint_decode(&message, &p);
//emit userPositionSetPointsChanged(uasId, p.x, p.y, p.z, p.yaw);
mavlink_nav_controller_output_t
p
;
mavlink_msg_nav_controller_output_decode
(
&
message
,
&
p
);
setDistToWaypoint
(
p
.
wp_dist
);
}
break
;
case
MAVLINK_MSG_ID_RAW_PRESSURE
:
case
MAVLINK_MSG_ID_SCALED_PRESSURE
:
case
MAVLINK_MSG_ID_OPTICAL_FLOW
:
...
...
src/uas/UAS.h
View file @
0d1656d8
...
...
@@ -112,6 +112,7 @@ public:
Q_PROPERTY
(
double
roll
READ
getRoll
WRITE
setRoll
NOTIFY
rollChanged
)
Q_PROPERTY
(
double
pitch
READ
getPitch
WRITE
setPitch
NOTIFY
pitchChanged
)
Q_PROPERTY
(
double
yaw
READ
getYaw
WRITE
setYaw
NOTIFY
yawChanged
)
Q_PROPERTY
(
double
distToWaypoint
READ
getDistToWaypoint
WRITE
setDistToWaypoint
NOTIFY
distToWaypointChanged
)
void
setLocalX
(
double
val
)
{
...
...
@@ -194,6 +195,17 @@ public:
return
isGlobalPositionKnown
;
}
void
setDistToWaypoint
(
double
val
)
{
distToWaypoint
=
val
;
emit
distToWaypointChanged
(
val
,
"distToWaypoint"
);
}
double
getDistToWaypoint
()
const
{
return
distToWaypoint
;
}
void
setRoll
(
double
val
)
{
roll
=
val
;
...
...
@@ -370,6 +382,7 @@ protected: //COMMENTS FOR TEST UNIT
double
speedX
;
///< True speed in X axis
double
speedY
;
///< True speed in Y axis
double
speedZ
;
///< True speed in Z axis
double
distToWaypoint
;
///< Distance to next waypoint
double
roll
;
double
pitch
;
double
yaw
;
...
...
@@ -792,6 +805,7 @@ signals:
void
pitchChanged
(
double
val
,
QString
name
);
void
yawChanged
(
double
val
,
QString
name
);
void
satelliteCountChanged
(
double
val
,
QString
name
);
void
distToWaypointChanged
(
double
val
,
QString
name
);
protected:
/** @brief Get the UNIX timestamp in milliseconds, enter microseconds */
...
...
src/ui/uas/UASQuickView.cpp
View file @
0d1656d8
...
...
@@ -61,6 +61,18 @@ UASQuickView::UASQuickView(QWidget *parent) : QWidget(parent)
uasPropertyToLabelMap
[
"satelliteCount"
]
=
item
;
}
{
QAction
*
action
=
new
QAction
(
"distToWaypoint"
,
this
);
action
->
setCheckable
(
true
);
action
->
setChecked
(
true
);
connect
(
action
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
actionTriggered
(
bool
)));
this
->
addAction
(
action
);
UASQuickViewItem
*
item
=
new
UASQuickViewItem
(
this
);
item
->
setTitle
(
"distToWaypoint"
);
ui
.
verticalLayout
->
addWidget
(
item
);
uasPropertyToLabelMap
[
"distToWaypoint"
]
=
item
;
}
updateTimer
=
new
QTimer
(
this
);
connect
(
updateTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
updateTimerTick
()));
updateTimer
->
start
(
1000
);
...
...
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