Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
6bd067bf
Commit
6bd067bf
authored
Sep 14, 2010
by
Bryan Godbolt
Browse files
now sending rc values
parent
ef545d32
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/comm/OpalLink.cc
View file @
6bd067bf
...
...
@@ -246,6 +246,29 @@ void OpalLink::getSignals()
values
[
OpalRT
::
B_W_2
]
);
receiveMessage
(
bias
);
/* send radio outputs */
mavlink_message_t
rc
;
mavlink_msg_rc_channels_pack
(
systemID
,
componentID
,
&
rc
,
duty2PulseMicros
(
values
[
OpalRT
::
RAW_CHANNEL_1
]),
duty2PulseMicros
(
values
[
OpalRT
::
RAW_CHANNEL_2
]),
duty2PulseMicros
(
values
[
OpalRT
::
RAW_CHANNEL_3
]),
duty2PulseMicros
(
values
[
OpalRT
::
RAW_CHANNEL_4
]),
duty2PulseMicros
(
values
[
OpalRT
::
RAW_CHANNEL_5
]),
duty2PulseMicros
(
values
[
OpalRT
::
RAW_CHANNEL_6
]),
duty2PulseMicros
(
values
[
OpalRT
::
RAW_CHANNEL_7
]),
duty2PulseMicros
(
values
[
OpalRT
::
RAW_CHANNEL_8
]),
static_cast
<
uint8_t
>
(
values
[
OpalRT
::
NORM_CHANNEL_1
]
*
255
),
static_cast
<
uint8_t
>
(
values
[
OpalRT
::
NORM_CHANNEL_2
]
*
255
),
static_cast
<
uint8_t
>
(
values
[
OpalRT
::
NORM_CHANNEL_3
]
*
255
),
static_cast
<
uint8_t
>
(
values
[
OpalRT
::
NORM_CHANNEL_4
]
*
255
),
static_cast
<
uint8_t
>
(
values
[
OpalRT
::
NORM_CHANNEL_5
]
*
255
),
static_cast
<
uint8_t
>
(
values
[
OpalRT
::
NORM_CHANNEL_6
]
*
255
),
static_cast
<
uint8_t
>
(
values
[
OpalRT
::
NORM_CHANNEL_7
]
*
255
),
static_cast
<
uint8_t
>
(
values
[
OpalRT
::
NORM_CHANNEL_8
]
*
255
),
0
//rssi unused
);
receiveMessage
(
rc
);
}
else
if
(
returnVal
!=
EAGAIN
)
// if returnVal == EAGAIN => data just wasn't ready
{
...
...
@@ -294,6 +317,12 @@ bool OpalLink::isConnected() {
return
connectState
;
}
uint16_t
OpalLink
::
duty2PulseMicros
(
double
duty
)
{
/* duty cycle assumed to be of a signal at 70 Hz */
return
static_cast
<
uint16_t
>
(
duty
/
70
*
1000000
);
}
...
...
src/comm/OpalLink.h
View file @
6bd067bf
...
...
@@ -151,6 +151,8 @@ protected:
OpalRT
::
ParameterList
*
params
;
unsigned
short
opalInstID
;
uint16_t
duty2PulseMicros
(
double
duty
);
};
#endif // OPALLINK_H
src/comm/OpalRT.h
View file @
6bd067bf
...
...
@@ -41,7 +41,7 @@ namespace OpalRT
Configuration info for the model
*/
const
unsigned
short
NUM_OUTPUT_SIGNALS
=
39
;
const
unsigned
short
NUM_OUTPUT_SIGNALS
=
57
;
/* ------------------------------ Outputs ------------------------------
*
...
...
@@ -85,7 +85,25 @@ namespace OpalRT
B_F_2
,
B_W_0
,
B_W_1
,
B_W_2
B_W_2
,
RAW_CHANNEL_1
=
39
,
RAW_CHANNEL_2
,
RAW_CHANNEL_3
,
RAW_CHANNEL_4
,
RAW_CHANNEL_5
,
RAW_CHANNEL_6
,
RAW_CHANNEL_7
,
RAW_CHANNEL_8
,
NORM_CHANNEL_1
,
NORM_CHANNEL_2
,
NORM_CHANNEL_3
,
NORM_CHANNEL_4
,
NORM_CHANNEL_5
,
NORM_CHANNEL_6
,
NORM_CHANNEL_7
,
NORM_CHANNEL_8
,
CONTROLLER_AILERON
,
CONTROLLER_ELEVATOR
};
/** Component IDs of the parameters. Currently they are all 1 becuase there is no advantage
...
...
src/ui/QGCRemoteControlView.cc
View file @
6bd067bf
...
...
@@ -45,6 +45,7 @@ QGCRemoteControlView::QGCRemoteControlView(QWidget *parent) :
channelLayout
(
new
QVBoxLayout
()),
ui
(
new
Ui
::
QGCRemoteControlView
)
{
//ui->setupUi(this);
QGridLayout
*
layout
=
new
QGridLayout
(
this
);
layout
->
addLayout
(
channelLayout
,
1
,
0
,
1
,
2
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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