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
5323cfa9
Commit
5323cfa9
authored
Nov 24, 2010
by
James Goppert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enabled data streams for common interface.
parent
1e004938
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
35 deletions
+28
-35
SerialLink.cc
src/comm/SerialLink.cc
+1
-0
UAS.cc
src/uas/UAS.cc
+15
-34
QGCSensorSettingsWidget.cc
src/ui/QGCSensorSettingsWidget.cc
+0
-1
QGCSensorSettingsWidget.ui
src/ui/QGCSensorSettingsWidget.ui
+12
-0
No files found.
src/comm/SerialLink.cc
View file @
5323cfa9
...
...
@@ -187,6 +187,7 @@ void SerialLink::readBytes()
const
qint64
maxLength
=
2048
;
char
data
[
maxLength
];
qint64
numBytes
=
port
->
bytesAvailable
();
if
(
numBytes
>
0
)
{
/* Read as much data in buffer as possible without overflow */
...
...
src/uas/UAS.cc
View file @
5323cfa9
...
...
@@ -881,13 +881,12 @@ void UAS::readParametersFromStorage()
void
UAS
::
enableAllDataTransmission
(
bool
enabled
)
{
#ifdef MAVLINK_ENABLED_PIXHAWK
// Buffers to write data to
mavlink_message_t
msg
;
mavlink_request_data_stream_t
stream
;
// Select the message to request from now on
// 0 is a magic ID and will enable/disable the standard message set except for heartbeat
stream
.
req_stream_id
=
0
;
stream
.
req_stream_id
=
MAV_DATA_STREAM_ALL
;
// Select the update rate in Hz the message should be send
// All messages will be send with their default rate
stream
.
req_message_rate
=
0
;
...
...
@@ -902,17 +901,15 @@ void UAS::enableAllDataTransmission(bool enabled)
// Send message twice to increase chance of reception
sendMessage
(
msg
);
sendMessage
(
msg
);
#endif
}
void
UAS
::
enableRawSensorDataTransmission
(
bool
enabled
)
{
#ifdef MAVLINK_ENABLED_PIXHAWK
// Buffers to write data to
mavlink_message_t
msg
;
mavlink_request_data_stream_t
stream
;
// Select the message to request from now on
stream
.
req_stream_id
=
1
;
stream
.
req_stream_id
=
MAV_DATA_STREAM_RAW_SENSORS
;
// Select the update rate in Hz the message should be send
stream
.
req_message_rate
=
200
;
// Start / stop the message
...
...
@@ -926,17 +923,15 @@ void UAS::enableRawSensorDataTransmission(bool enabled)
// Send message twice to increase chance of reception
sendMessage
(
msg
);
sendMessage
(
msg
);
#endif
}
void
UAS
::
enableExtendedSystemStatusTransmission
(
bool
enabled
)
{
#ifdef MAVLINK_ENABLED_PIXHAWK
// Buffers to write data to
mavlink_message_t
msg
;
mavlink_request_data_stream_t
stream
;
// Select the message to request from now on
stream
.
req_stream_id
=
2
;
stream
.
req_stream_id
=
MAV_DATA_STREAM_EXTENDED_STATUS
;
// Select the update rate in Hz the message should be send
stream
.
req_message_rate
=
10
;
// Start / stop the message
...
...
@@ -950,17 +945,19 @@ void UAS::enableExtendedSystemStatusTransmission(bool enabled)
// Send message twice to increase chance of reception
sendMessage
(
msg
);
sendMessage
(
msg
);
#endif
}
void
UAS
::
enableRCChannelDataTransmission
(
bool
enabled
)
{
#ifdef MAVLINK_ENABLED_PIXHAWK
// Buffers to write data to
#if defined(MAVLINK_ENABLED_UALBERTA_MESSAGES)
mavlink_message_t
msg
;
mavlink_msg_request_rc_channels_pack
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
msg
,
enabled
);
sendMessage
(
msg
);
#else
mavlink_message_t
msg
;
mavlink_request_data_stream_t
stream
;
// Select the message to request from now on
stream
.
req_stream_id
=
3
;
stream
.
req_stream_id
=
MAV_DATA_STREAM_RC_CHANNELS
;
// Select the update rate in Hz the message should be send
stream
.
req_message_rate
=
200
;
// Start / stop the message
...
...
@@ -974,21 +971,16 @@ void UAS::enableRCChannelDataTransmission(bool enabled)
// Send message twice to increase chance of reception
sendMessage
(
msg
);
sendMessage
(
msg
);
#elif defined(MAVLINK_ENABLED_UALBERTA_MESSAGES)
mavlink_message_t
msg
;
mavlink_msg_request_rc_channels_pack
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
msg
,
enabled
);
sendMessage
(
msg
);
#endif
}
void
UAS
::
enableRawControllerDataTransmission
(
bool
enabled
)
{
#ifdef MAVLINK_ENABLED_PIXHAWK
// Buffers to write data to
mavlink_message_t
msg
;
mavlink_request_data_stream_t
stream
;
// Select the message to request from now on
stream
.
req_stream_id
=
4
;
stream
.
req_stream_id
=
MAV_DATA_STREAM_RAW_CONTROLLER
;
// Select the update rate in Hz the message should be send
stream
.
req_message_rate
=
200
;
// Start / stop the message
...
...
@@ -1002,17 +994,15 @@ void UAS::enableRawControllerDataTransmission(bool enabled)
// Send message twice to increase chance of reception
sendMessage
(
msg
);
sendMessage
(
msg
);
#endif
}
void
UAS
::
enableRawSensorFusionTransmission
(
bool
enabled
)
{
#ifdef MAVLINK_ENABLED_PIXHAWK
// Buffers to write data to
mavlink_message_t
msg
;
mavlink_request_data_stream_t
stream
;
// Select the message to request from now on
stream
.
req_stream_id
=
5
;
stream
.
req_stream_id
=
MAV_DATA_STREAM_RAW_SENSOR_FUSION
;
// Select the update rate in Hz the message should be send
stream
.
req_message_rate
=
200
;
// Start / stop the message
...
...
@@ -1026,17 +1016,15 @@ void UAS::enableRawSensorFusionTransmission(bool enabled)
// Send message twice to increase chance of reception
sendMessage
(
msg
);
sendMessage
(
msg
);
#endif
}
void
UAS
::
enablePositionTransmission
(
bool
enabled
)
{
#ifdef MAVLINK_ENABLED_PIXHAWK
// Buffers to write data to
mavlink_message_t
msg
;
mavlink_request_data_stream_t
stream
;
// Select the message to request from now on
stream
.
req_stream_id
=
6
;
stream
.
req_stream_id
=
MAV_DATA_STREAM_POSITION
;
// Select the update rate in Hz the message should be send
stream
.
req_message_rate
=
200
;
// Start / stop the message
...
...
@@ -1050,17 +1038,15 @@ void UAS::enablePositionTransmission(bool enabled)
// Send message twice to increase chance of reception
sendMessage
(
msg
);
sendMessage
(
msg
);
#endif
}
void
UAS
::
enableExtra1Transmission
(
bool
enabled
)
{
#ifdef MAVLINK_ENABLED_PIXHAWK
// Buffers to write data to
mavlink_message_t
msg
;
mavlink_request_data_stream_t
stream
;
// Select the message to request from now on
stream
.
req_stream_id
=
7
;
stream
.
req_stream_id
=
MAV_DATA_STREAM_EXTRA1
;
// Select the update rate in Hz the message should be send
stream
.
req_message_rate
=
200
;
// Start / stop the message
...
...
@@ -1074,17 +1060,15 @@ void UAS::enableExtra1Transmission(bool enabled)
// Send message twice to increase chance of reception
sendMessage
(
msg
);
sendMessage
(
msg
);
#endif
}
void
UAS
::
enableExtra2Transmission
(
bool
enabled
)
{
#ifdef MAVLINK_ENABLED_PIXHAWK
// Buffers to write data to
mavlink_message_t
msg
;
mavlink_request_data_stream_t
stream
;
// Select the message to request from now on
stream
.
req_stream_id
=
8
;
stream
.
req_stream_id
=
MAV_DATA_STREAM_EXTRA2
;
// Select the update rate in Hz the message should be send
stream
.
req_message_rate
=
200
;
// Start / stop the message
...
...
@@ -1098,17 +1082,15 @@ void UAS::enableExtra2Transmission(bool enabled)
// Send message twice to increase chance of reception
sendMessage
(
msg
);
sendMessage
(
msg
);
#endif
}
void
UAS
::
enableExtra3Transmission
(
bool
enabled
)
{
#ifdef MAVLINK_ENABLED_PIXHAWK
// Buffers to write data to
mavlink_message_t
msg
;
mavlink_request_data_stream_t
stream
;
// Select the message to request from now on
stream
.
req_stream_id
=
9
;
stream
.
req_stream_id
=
MAV_DATA_STREAM_EXTRA3
;
// Select the update rate in Hz the message should be send
stream
.
req_message_rate
=
200
;
// Start / stop the message
...
...
@@ -1122,7 +1104,6 @@ void UAS::enableExtra3Transmission(bool enabled)
// Send message twice to increase chance of reception
sendMessage
(
msg
);
sendMessage
(
msg
);
#endif
}
/**
...
...
src/ui/QGCSensorSettingsWidget.cc
View file @
5323cfa9
...
...
@@ -37,7 +37,6 @@ QGCSensorSettingsWidget::QGCSensorSettingsWidget(UASInterface* uas, QWidget *par
ui
(
new
Ui
::
QGCSensorSettingsWidget
)
{
ui
->
setupUi
(
this
);
connect
(
ui
->
sendRawCheckBox
,
SIGNAL
(
toggled
(
bool
)),
mav
,
SLOT
(
enableRawSensorDataTransmission
(
bool
)));
connect
(
ui
->
sendControllerCheckBox
,
SIGNAL
(
toggled
(
bool
)),
mav
,
SLOT
(
enableRawControllerDataTransmission
(
bool
)));
connect
(
ui
->
sendExtendedCheckBox
,
SIGNAL
(
toggled
(
bool
)),
mav
,
SLOT
(
enableExtendedSystemStatusTransmission
(
bool
)));
...
...
src/ui/QGCSensorSettingsWidget.ui
View file @
5323cfa9
...
...
@@ -98,13 +98,25 @@
</property>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QCheckBox"
name=
"sendRawCheckBox"
>
<property
name=
"enabled"
>
<bool>
true
</bool>
</property>
<property
name=
"text"
>
<string>
RAW Sensor Data
</string>
</property>
<property
name=
"checked"
>
<bool>
false
</bool>
</property>
<property
name=
"tristate"
>
<bool>
false
</bool>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QCheckBox"
name=
"sendRCCheckBox"
>
<property
name=
"enabled"
>
<bool>
true
</bool>
</property>
<property
name=
"text"
>
<string>
RC Values
</string>
</property>
...
...
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