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
ad7fa354
Commit
ad7fa354
authored
Dec 29, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed missing port width offset in RC channel messages
parent
559aa2dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
16 deletions
+22
-16
UAS.cc
src/uas/UAS.cc
+22
-16
No files found.
src/uas/UAS.cc
View file @
ad7fa354
...
...
@@ -1001,30 +1001,36 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
{
mavlink_rc_channels_raw_t
channels
;
mavlink_msg_rc_channels_raw_decode
(
&
message
,
&
channels
);
const
unsigned
int
portWidth
=
8
;
// XXX magic number
emit
remoteControlRSSIChanged
(
channels
.
rssi
/
255.0
f
);
emit
remoteControlChannelRawChanged
(
channels
.
port
+
0
,
channels
.
chan1_raw
);
emit
remoteControlChannelRawChanged
(
channels
.
port
+
1
,
channels
.
chan2_raw
);
emit
remoteControlChannelRawChanged
(
channels
.
port
+
2
,
channels
.
chan3_raw
);
emit
remoteControlChannelRawChanged
(
channels
.
port
+
3
,
channels
.
chan4_raw
);
emit
remoteControlChannelRawChanged
(
channels
.
port
+
4
,
channels
.
chan5_raw
);
emit
remoteControlChannelRawChanged
(
channels
.
port
+
5
,
channels
.
chan6_raw
);
emit
remoteControlChannelRawChanged
(
channels
.
port
+
6
,
channels
.
chan7_raw
);
emit
remoteControlChannelRawChanged
(
channels
.
port
+
7
,
channels
.
chan8_raw
);
emit
remoteControlChannelRawChanged
(
channels
.
port
*
portWidth
+
0
,
channels
.
chan1_raw
);
emit
remoteControlChannelRawChanged
(
channels
.
port
*
portWidth
+
1
,
channels
.
chan2_raw
);
emit
remoteControlChannelRawChanged
(
channels
.
port
*
portWidth
+
2
,
channels
.
chan3_raw
);
emit
remoteControlChannelRawChanged
(
channels
.
port
*
portWidth
+
3
,
channels
.
chan4_raw
);
emit
remoteControlChannelRawChanged
(
channels
.
port
*
portWidth
+
4
,
channels
.
chan5_raw
);
emit
remoteControlChannelRawChanged
(
channels
.
port
*
portWidth
+
5
,
channels
.
chan6_raw
);
emit
remoteControlChannelRawChanged
(
channels
.
port
*
portWidth
+
6
,
channels
.
chan7_raw
);
emit
remoteControlChannelRawChanged
(
channels
.
port
*
portWidth
+
7
,
channels
.
chan8_raw
);
}
break
;
case
MAVLINK_MSG_ID_RC_CHANNELS_SCALED
:
{
mavlink_rc_channels_scaled_t
channels
;
mavlink_msg_rc_channels_scaled_decode
(
&
message
,
&
channels
);
const
unsigned
int
portWidth
=
8
;
// XXX magic number
emit
remoteControlRSSIChanged
(
channels
.
rssi
/
255.0
f
);
emit
remoteControlChannelScaledChanged
(
channels
.
port
+
0
,
channels
.
chan1_scaled
/
10000.0
f
);
emit
remoteControlChannelScaledChanged
(
channels
.
port
+
1
,
channels
.
chan2_scaled
/
10000.0
f
);
emit
remoteControlChannelScaledChanged
(
channels
.
port
+
2
,
channels
.
chan3_scaled
/
10000.0
f
);
emit
remoteControlChannelScaledChanged
(
channels
.
port
+
3
,
channels
.
chan4_scaled
/
10000.0
f
);
emit
remoteControlChannelScaledChanged
(
channels
.
port
+
4
,
channels
.
chan5_scaled
/
10000.0
f
);
emit
remoteControlChannelScaledChanged
(
channels
.
port
+
5
,
channels
.
chan6_scaled
/
10000.0
f
);
emit
remoteControlChannelScaledChanged
(
channels
.
port
+
6
,
channels
.
chan7_scaled
/
10000.0
f
);
emit
remoteControlChannelScaledChanged
(
channels
.
port
+
7
,
channels
.
chan8_scaled
/
10000.0
f
);
emit
remoteControlChannelScaledChanged
(
channels
.
port
*
portWidth
+
0
,
channels
.
chan1_scaled
/
10000.0
f
);
emit
remoteControlChannelScaledChanged
(
channels
.
port
*
portWidth
+
1
,
channels
.
chan2_scaled
/
10000.0
f
);
emit
remoteControlChannelScaledChanged
(
channels
.
port
*
portWidth
+
2
,
channels
.
chan3_scaled
/
10000.0
f
);
emit
remoteControlChannelScaledChanged
(
channels
.
port
*
portWidth
+
3
,
channels
.
chan4_scaled
/
10000.0
f
);
emit
remoteControlChannelScaledChanged
(
channels
.
port
*
portWidth
+
4
,
channels
.
chan5_scaled
/
10000.0
f
);
emit
remoteControlChannelScaledChanged
(
channels
.
port
*
portWidth
+
5
,
channels
.
chan6_scaled
/
10000.0
f
);
emit
remoteControlChannelScaledChanged
(
channels
.
port
*
portWidth
+
6
,
channels
.
chan7_scaled
/
10000.0
f
);
emit
remoteControlChannelScaledChanged
(
channels
.
port
*
portWidth
+
7
,
channels
.
chan8_scaled
/
10000.0
f
);
}
break
;
case
MAVLINK_MSG_ID_PARAM_VALUE
:
...
...
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