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
671c1cec
Commit
671c1cec
authored
Nov 26, 2010
by
lm
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of github.com:pixhawk/qgroundcontrol into dev
parents
2335b522
b32a518e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
133 additions
and
86 deletions
+133
-86
UAS.cc
src/uas/UAS.cc
+31
-29
UAS.h
src/uas/UAS.h
+10
-10
UASInterface.h
src/uas/UASInterface.h
+6
-6
QGCSensorSettingsWidget.cc
src/ui/QGCSensorSettingsWidget.cc
+9
-8
QGCSensorSettingsWidget.ui
src/ui/QGCSensorSettingsWidget.ui
+77
-33
No files found.
src/uas/UAS.cc
View file @
671c1cec
...
...
@@ -883,7 +883,7 @@ void UAS::readParametersFromStorage()
sendMessage
(
msg
);
}
void
UAS
::
enableAllDataTransmission
(
bool
enabled
)
void
UAS
::
enableAllDataTransmission
(
int
rate
)
{
// Buffers to write data to
mavlink_message_t
msg
;
...
...
@@ -893,9 +893,11 @@ void UAS::enableAllDataTransmission(bool enabled)
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
// TODO: use 0 to turn off and get rid of enable/disable? will require
// a different magic flag for turning on defaults, possibly something really high like 1111 ?
stream
.
req_message_rate
=
0
;
// Start / stop the message
stream
.
start_stop
=
(
enabled
)
?
1
:
0
;
stream
.
start_stop
=
(
rate
)
?
1
:
0
;
// The system which should take this command
stream
.
target_system
=
uasId
;
// The component / subsystem which should take this command
...
...
@@ -907,7 +909,7 @@ void UAS::enableAllDataTransmission(bool enabled)
sendMessage
(
msg
);
}
void
UAS
::
enableRawSensorDataTransmission
(
bool
enabled
)
void
UAS
::
enableRawSensorDataTransmission
(
int
rate
)
{
// Buffers to write data to
mavlink_message_t
msg
;
...
...
@@ -915,9 +917,9 @@ void UAS::enableRawSensorDataTransmission(bool enabled)
// Select the message to request from now on
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
;
stream
.
req_message_rate
=
rate
;
// Start / stop the message
stream
.
start_stop
=
(
enabled
)
?
1
:
0
;
stream
.
start_stop
=
(
rate
)
?
1
:
0
;
// The system which should take this command
stream
.
target_system
=
uasId
;
// The component / subsystem which should take this command
...
...
@@ -929,7 +931,7 @@ void UAS::enableRawSensorDataTransmission(bool enabled)
sendMessage
(
msg
);
}
void
UAS
::
enableExtendedSystemStatusTransmission
(
bool
enabled
)
void
UAS
::
enableExtendedSystemStatusTransmission
(
int
rate
)
{
// Buffers to write data to
mavlink_message_t
msg
;
...
...
@@ -937,9 +939,9 @@ void UAS::enableExtendedSystemStatusTransmission(bool enabled)
// Select the message to request from now on
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
;
stream
.
req_message_rate
=
rate
;
// Start / stop the message
stream
.
start_stop
=
(
enabled
)
?
1
:
0
;
stream
.
start_stop
=
(
rate
)
?
1
:
0
;
// The system which should take this command
stream
.
target_system
=
uasId
;
// The component / subsystem which should take this command
...
...
@@ -951,7 +953,7 @@ void UAS::enableExtendedSystemStatusTransmission(bool enabled)
sendMessage
(
msg
);
}
void
UAS
::
enableRCChannelDataTransmission
(
bool
enabled
)
void
UAS
::
enableRCChannelDataTransmission
(
int
rate
)
{
#if defined(MAVLINK_ENABLED_UALBERTA_MESSAGES)
mavlink_message_t
msg
;
...
...
@@ -963,9 +965,9 @@ void UAS::enableRCChannelDataTransmission(bool enabled)
// Select the message to request from now on
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
;
stream
.
req_message_rate
=
rate
;
// Start / stop the message
stream
.
start_stop
=
(
enabled
)
?
1
:
0
;
stream
.
start_stop
=
(
rate
)
?
1
:
0
;
// The system which should take this command
stream
.
target_system
=
uasId
;
// The component / subsystem which should take this command
...
...
@@ -978,7 +980,7 @@ void UAS::enableRCChannelDataTransmission(bool enabled)
#endif
}
void
UAS
::
enableRawControllerDataTransmission
(
bool
enabled
)
void
UAS
::
enableRawControllerDataTransmission
(
int
rate
)
{
// Buffers to write data to
mavlink_message_t
msg
;
...
...
@@ -986,9 +988,9 @@ void UAS::enableRawControllerDataTransmission(bool enabled)
// Select the message to request from now on
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
;
stream
.
req_message_rate
=
rate
;
// Start / stop the message
stream
.
start_stop
=
(
enabled
)
?
1
:
0
;
stream
.
start_stop
=
(
rate
)
?
1
:
0
;
// The system which should take this command
stream
.
target_system
=
uasId
;
// The component / subsystem which should take this command
...
...
@@ -1000,7 +1002,7 @@ void UAS::enableRawControllerDataTransmission(bool enabled)
sendMessage
(
msg
);
}
void
UAS
::
enableRawSensorFusionTransmission
(
bool
enabled
)
void
UAS
::
enableRawSensorFusionTransmission
(
int
rate
)
{
// Buffers to write data to
mavlink_message_t
msg
;
...
...
@@ -1008,9 +1010,9 @@ void UAS::enableRawSensorFusionTransmission(bool enabled)
// Select the message to request from now on
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
;
stream
.
req_message_rate
=
rate
;
// Start / stop the message
stream
.
start_stop
=
(
enabled
)
?
1
:
0
;
stream
.
start_stop
=
(
rate
)
?
1
:
0
;
// The system which should take this command
stream
.
target_system
=
uasId
;
// The component / subsystem which should take this command
...
...
@@ -1022,7 +1024,7 @@ void UAS::enableRawSensorFusionTransmission(bool enabled)
sendMessage
(
msg
);
}
void
UAS
::
enablePositionTransmission
(
bool
enabled
)
void
UAS
::
enablePositionTransmission
(
int
rate
)
{
// Buffers to write data to
mavlink_message_t
msg
;
...
...
@@ -1030,9 +1032,9 @@ void UAS::enablePositionTransmission(bool enabled)
// Select the message to request from now on
stream
.
req_stream_id
=
MAV_DATA_STREAM_POSITION
;
// Select the update rate in Hz the message should be send
stream
.
req_message_rate
=
200
;
stream
.
req_message_rate
=
rate
;
// Start / stop the message
stream
.
start_stop
=
(
enabled
)
?
1
:
0
;
stream
.
start_stop
=
(
rate
)
?
1
:
0
;
// The system which should take this command
stream
.
target_system
=
uasId
;
// The component / subsystem which should take this command
...
...
@@ -1044,7 +1046,7 @@ void UAS::enablePositionTransmission(bool enabled)
sendMessage
(
msg
);
}
void
UAS
::
enableExtra1Transmission
(
bool
enabled
)
void
UAS
::
enableExtra1Transmission
(
int
rate
)
{
// Buffers to write data to
mavlink_message_t
msg
;
...
...
@@ -1052,9 +1054,9 @@ void UAS::enableExtra1Transmission(bool enabled)
// Select the message to request from now on
stream
.
req_stream_id
=
MAV_DATA_STREAM_EXTRA1
;
// Select the update rate in Hz the message should be send
stream
.
req_message_rate
=
200
;
stream
.
req_message_rate
=
rate
;
// Start / stop the message
stream
.
start_stop
=
(
enabled
)
?
1
:
0
;
stream
.
start_stop
=
(
rate
)
?
1
:
0
;
// The system which should take this command
stream
.
target_system
=
uasId
;
// The component / subsystem which should take this command
...
...
@@ -1066,7 +1068,7 @@ void UAS::enableExtra1Transmission(bool enabled)
sendMessage
(
msg
);
}
void
UAS
::
enableExtra2Transmission
(
bool
enabled
)
void
UAS
::
enableExtra2Transmission
(
int
rate
)
{
// Buffers to write data to
mavlink_message_t
msg
;
...
...
@@ -1074,9 +1076,9 @@ void UAS::enableExtra2Transmission(bool enabled)
// Select the message to request from now on
stream
.
req_stream_id
=
MAV_DATA_STREAM_EXTRA2
;
// Select the update rate in Hz the message should be send
stream
.
req_message_rate
=
200
;
stream
.
req_message_rate
=
rate
;
// Start / stop the message
stream
.
start_stop
=
(
enabled
)
?
1
:
0
;
stream
.
start_stop
=
(
rate
)
?
1
:
0
;
// The system which should take this command
stream
.
target_system
=
uasId
;
// The component / subsystem which should take this command
...
...
@@ -1088,7 +1090,7 @@ void UAS::enableExtra2Transmission(bool enabled)
sendMessage
(
msg
);
}
void
UAS
::
enableExtra3Transmission
(
bool
enabled
)
void
UAS
::
enableExtra3Transmission
(
int
rate
)
{
// Buffers to write data to
mavlink_message_t
msg
;
...
...
@@ -1096,9 +1098,9 @@ void UAS::enableExtra3Transmission(bool enabled)
// Select the message to request from now on
stream
.
req_stream_id
=
MAV_DATA_STREAM_EXTRA3
;
// Select the update rate in Hz the message should be send
stream
.
req_message_rate
=
200
;
stream
.
req_message_rate
=
rate
;
// Start / stop the message
stream
.
start_stop
=
(
enabled
)
?
1
:
0
;
stream
.
start_stop
=
(
rate
)
?
1
:
0
;
// The system which should take this command
stream
.
target_system
=
uasId
;
// The component / subsystem which should take this command
...
...
src/uas/UAS.h
View file @
671c1cec
...
...
@@ -223,16 +223,16 @@ public slots:
/** @brief Read parameters from permanent storage */
void
readParametersFromStorage
();
void
enableAllDataTransmission
(
bool
enabled
);
void
enableRawSensorDataTransmission
(
bool
enabled
);
void
enableExtendedSystemStatusTransmission
(
bool
enabled
);
void
enableRCChannelDataTransmission
(
bool
enabled
);
void
enableRawControllerDataTransmission
(
bool
enabled
);
void
enableRawSensorFusionTransmission
(
bool
enabled
);
void
enablePositionTransmission
(
bool
enabled
);
void
enableExtra1Transmission
(
bool
enabled
);
void
enableExtra2Transmission
(
bool
enabled
);
void
enableExtra3Transmission
(
bool
enabled
);
void
enableAllDataTransmission
(
int
rate
);
void
enableRawSensorDataTransmission
(
int
rate
);
void
enableExtendedSystemStatusTransmission
(
int
rate
);
void
enableRCChannelDataTransmission
(
int
rate
);
void
enableRawControllerDataTransmission
(
int
rate
);
void
enableRawSensorFusionTransmission
(
int
rate
);
void
enablePositionTransmission
(
int
rate
);
void
enableExtra1Transmission
(
int
rate
);
void
enableExtra2Transmission
(
int
rate
);
void
enableExtra3Transmission
(
int
rate
);
/** @brief Update the system state */
void
updateState
();
...
...
src/uas/UASInterface.h
View file @
671c1cec
...
...
@@ -220,12 +220,12 @@ public slots:
*/
virtual
void
setSelected
()
=
0
;
virtual
void
enableAllDataTransmission
(
bool
enabled
)
=
0
;
virtual
void
enableRawSensorDataTransmission
(
bool
enabled
)
=
0
;
virtual
void
enableExtendedSystemStatusTransmission
(
bool
enabled
)
=
0
;
virtual
void
enableRCChannelDataTransmission
(
bool
enabled
)
=
0
;
virtual
void
enableRawControllerDataTransmission
(
bool
enabled
)
=
0
;
virtual
void
enableRawSensorFusionTransmission
(
bool
enabled
)
=
0
;
virtual
void
enableAllDataTransmission
(
int
rate
)
=
0
;
virtual
void
enableRawSensorDataTransmission
(
int
rate
)
=
0
;
virtual
void
enableExtendedSystemStatusTransmission
(
int
rate
)
=
0
;
virtual
void
enableRCChannelDataTransmission
(
int
rate
)
=
0
;
virtual
void
enableRawControllerDataTransmission
(
int
rate
)
=
0
;
virtual
void
enableRawSensorFusionTransmission
(
int
rate
)
=
0
;
virtual
void
setLocalPositionSetpoint
(
float
x
,
float
y
,
float
z
,
float
yaw
)
=
0
;
virtual
void
setLocalPositionOffset
(
float
x
,
float
y
,
float
z
,
float
yaw
)
=
0
;
...
...
src/ui/QGCSensorSettingsWidget.cc
View file @
671c1cec
...
...
@@ -37,14 +37,15 @@ 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
)));
connect
(
ui
->
sendRCCheckBox
,
SIGNAL
(
toggled
(
bool
)),
mav
,
SLOT
(
enableRCChannelDataTransmission
(
bool
)));
connect
(
ui
->
sendPositionCheckBox
,
SIGNAL
(
toggled
(
bool
)),
mav
,
SLOT
(
enablePositionTransmission
(
bool
)));
connect
(
ui
->
sendExtra1CheckBox
,
SIGNAL
(
toggled
(
bool
)),
mav
,
SLOT
(
enableExtra1Transmission
(
bool
)));
connect
(
ui
->
sendExtra2CheckBox
,
SIGNAL
(
toggled
(
bool
)),
mav
,
SLOT
(
enableExtra2Transmission
(
bool
)));
connect
(
ui
->
sendExtra3CheckBox
,
SIGNAL
(
toggled
(
bool
)),
mav
,
SLOT
(
enableExtra3Transmission
(
bool
)));
// XXX: This might be a bad idea sending a message every time the value changes
connect
(
ui
->
spinBox_rawSensor
,
SIGNAL
(
valueChanged
(
int
)),
mav
,
SLOT
(
enableRawSensorDataTransmission
(
int
)));
connect
(
ui
->
spinBox_controller
,
SIGNAL
(
valueChanged
(
int
)),
mav
,
SLOT
(
enableRawControllerDataTransmission
(
int
)));
connect
(
ui
->
spinBox_extended
,
SIGNAL
(
valueChanged
(
int
)),
mav
,
SLOT
(
enableExtendedSystemStatusTransmission
(
int
)));
connect
(
ui
->
spinBox_rc
,
SIGNAL
(
valueChanged
(
int
)),
mav
,
SLOT
(
enableRCChannelDataTransmission
(
int
)));
connect
(
ui
->
spinBox_position
,
SIGNAL
(
valueChanged
(
int
)),
mav
,
SLOT
(
enablePositionTransmission
(
int
)));
connect
(
ui
->
spinBox_extra1
,
SIGNAL
(
valueChanged
(
int
)),
mav
,
SLOT
(
enableExtra1Transmission
(
int
)));
connect
(
ui
->
spinBox_extra2
,
SIGNAL
(
valueChanged
(
int
)),
mav
,
SLOT
(
enableExtra2Transmission
(
int
)));
connect
(
ui
->
spinBox_extra3
,
SIGNAL
(
valueChanged
(
int
)),
mav
,
SLOT
(
enableExtra3Transmission
(
int
)));
// Calibration
connect
(
ui
->
rcCalButton
,
SIGNAL
(
clicked
()),
mav
,
SLOT
(
startRadioControlCalibration
()));
...
...
src/ui/QGCSensorSettingsWidget.ui
View file @
671c1cec
...
...
@@ -6,7 +6,7 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
23
1
</width>
<width>
23
7
</width>
<height>
221
</height>
</rect>
</property>
...
...
@@ -75,7 +75,7 @@
<item
row=
"0"
column=
"0"
>
<widget
class=
"QGroupBox"
name=
"groupBox"
>
<property
name=
"title"
>
<string>
Activate Extended Output
</string>
<string>
Data Stream Rates (Hz)
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout_2"
>
<property
name=
"leftMargin"
>
...
...
@@ -97,70 +97,114 @@
<number>
2
</number>
</property>
<item
row=
"0"
column=
"0"
>
<widget
class=
"Q
CheckBox"
name=
"sendRawCheckBox
"
>
<property
name=
"
enabled
"
>
<
bool>
true
</bool
>
<widget
class=
"Q
SpinBox"
name=
"spinBox_rawSensor
"
>
<property
name=
"
maximum
"
>
<
number>
10000
</number
>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
R
AW Sensors
</string>
<string>
R
aw Sensor
</string>
</property>
<property
name=
"checked"
>
<bool>
false
</bool>
</widget>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QSpinBox"
name=
"spinBox_extended"
>
<property
name=
"maximum"
>
<number>
10000
</number>
</property>
<property
name=
"tristate"
>
<bool>
false
</bool>
</widget>
</item>
<item
row=
"4"
column=
"0"
>
<widget
class=
"QSpinBox"
name=
"spinBox_position"
>
<property
name=
"maximum"
>
<number>
10000
</number>
</property>
</widget>
</item>
<item
row=
"
0"
column=
"1
"
>
<widget
class=
"Q
CheckBox"
name=
"sendRCCheckBox
"
>
<property
name=
"
enabled
"
>
<
bool>
true
</bool
>
<item
row=
"
5"
column=
"0
"
>
<widget
class=
"Q
SpinBox"
name=
"spinBox_controller
"
>
<property
name=
"
maximum
"
>
<
number>
10000
</number
>
</property>
</widget>
</item>
<item
row=
"1"
column=
"1"
>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
<string>
RC Values
</string>
<string>
Extended
</string>
</property>
</widget>
</item>
<item
row=
"4"
column=
"
0
"
>
<widget
class=
"Q
CheckBox"
name=
"sendPositionCheckBox
"
>
<item
row=
"4"
column=
"
1
"
>
<widget
class=
"Q
Label"
name=
"label_3
"
>
<property
name=
"text"
>
<string>
Position
CTRL
</string>
<string>
Position
</string>
</property>
</widget>
</item>
<item
row=
"5"
column=
"
0
"
>
<widget
class=
"Q
CheckBox"
name=
"sendControllerCheckBox
"
>
<item
row=
"5"
column=
"
1
"
>
<widget
class=
"Q
Label"
name=
"label_4
"
>
<property
name=
"text"
>
<string>
Attitude CTRL
</string>
<string>
Controller
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"1"
>
<widget
class=
"QCheckBox"
name=
"sendExtra1CheckBox"
>
<item
row=
"0"
column=
"2"
>
<widget
class=
"QSpinBox"
name=
"spinBox_rc"
>
<property
name=
"maximum"
>
<number>
10000
</number>
</property>
</widget>
</item>
<item
row=
"1"
column=
"2"
>
<widget
class=
"QSpinBox"
name=
"spinBox_extra1"
>
<property
name=
"maximum"
>
<number>
10000
</number>
</property>
</widget>
</item>
<item
row=
"4"
column=
"2"
>
<widget
class=
"QSpinBox"
name=
"spinBox_extra2"
>
<property
name=
"maximum"
>
<number>
10000
</number>
</property>
</widget>
</item>
<item
row=
"5"
column=
"2"
>
<widget
class=
"QSpinBox"
name=
"spinBox_extra3"
>
<property
name=
"maximum"
>
<number>
10000
</number>
</property>
</widget>
</item>
<item
row=
"0"
column=
"3"
>
<widget
class=
"QLabel"
name=
"label_5"
>
<property
name=
"text"
>
<string>
Send Extra1
</string>
<string>
RC Values
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"
0
"
>
<widget
class=
"Q
CheckBox"
name=
"sendExtendedCheckBox
"
>
<item
row=
"1"
column=
"
3
"
>
<widget
class=
"Q
Label"
name=
"label_6
"
>
<property
name=
"text"
>
<string>
Attitude
</string>
<string>
Extra 1
</string>
</property>
</widget>
</item>
<item
row=
"4"
column=
"
1
"
>
<widget
class=
"Q
CheckBox"
name=
"sendExtra2CheckBox
"
>
<item
row=
"4"
column=
"
3
"
>
<widget
class=
"Q
Label"
name=
"label_7
"
>
<property
name=
"text"
>
<string>
Send Extra
2
</string>
<string>
Extra
2
</string>
</property>
</widget>
</item>
<item
row=
"5"
column=
"
1
"
>
<widget
class=
"Q
CheckBox"
name=
"sendExtra3CheckBox
"
>
<item
row=
"5"
column=
"
3
"
>
<widget
class=
"Q
Label"
name=
"label_8
"
>
<property
name=
"text"
>
<string>
Send Extra
3
</string>
<string>
Extra
3
</string>
</property>
</widget>
</item>
...
...
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