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
965cd4e6
Commit
965cd4e6
authored
Apr 04, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tiny typo fixes in HIL
parent
8df3fa95
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
12 deletions
+24
-12
QGCXPlaneLink.cc
src/comm/QGCXPlaneLink.cc
+4
-4
UAS.cc
src/uas/UAS.cc
+14
-2
UASControlWidget.cc
src/ui/uas/UASControlWidget.cc
+6
-6
No files found.
src/comm/QGCXPlaneLink.cc
View file @
965cd4e6
...
...
@@ -678,8 +678,8 @@ bool QGCXPlaneLink::disconnectSimulation()
disconnect
(
mav
,
SIGNAL
(
hilControlsChanged
(
uint64_t
,
float
,
float
,
float
,
float
,
uint8_t
,
uint8_t
)),
this
,
SLOT
(
updateControls
(
uint64_t
,
float
,
float
,
float
,
float
,
uint8_t
,
uint8_t
)));
disconnect
(
mav
,
SIGNAL
(
hilActuatorsChanged
(
uint64_t
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
)),
this
,
SLOT
(
updateActuators
(
uint64_t
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
)));
disconnect
(
this
,
SIGNAL
(
hilStateChanged
(
uint64_t
,
float
,
float
,
float
,
float
,
float
,
float
,
int32_t
,
int32_t
,
int32_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
)),
mav
,
SLOT
(
sendHilState
(
quint64
,
float
,
float
,
float
,
float
,
float
,
float
,
int32_t
,
int32_t
,
int32_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
)));
disconnect
(
this
,
SIGNAL
(
sensorHilGpsChanged
(
quint64
,
double
,
double
,
double
,
int
,
float
,
float
,
float
,
float
,
int
)),
mav
,
SLOT
(
sendHilGps
(
uint64_t
,
double
,
double
,
double
,
int
,
float
,
float
,
float
,
float
,
int
)));
disconnect
(
this
,
SIGNAL
(
hilStateChanged
(
uint64_t
,
float
,
float
,
float
,
float
,
float
,
float
,
int32_t
,
int32_t
,
int32_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
)),
mav
,
SLOT
(
sendHilState
(
uint64_t
,
float
,
float
,
float
,
float
,
float
,
float
,
int32_t
,
int32_t
,
int32_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
)));
disconnect
(
this
,
SIGNAL
(
sensorHilGpsChanged
(
quint64
,
double
,
double
,
double
,
int
,
float
,
float
,
float
,
float
,
int
)),
mav
,
SLOT
(
sendHilGps
(
quint64
,
double
,
double
,
double
,
int
,
float
,
float
,
float
,
float
,
int
)));
disconnect
(
this
,
SIGNAL
(
sensorHilRawImuChanged
(
quint64
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
quint16
)),
mav
,
SLOT
(
sendHilSensors
(
quint64
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
quint16
)));
UAS
*
uas
=
dynamic_cast
<
UAS
*>
(
mav
);
...
...
@@ -862,8 +862,8 @@ bool QGCXPlaneLink::connectSimulation()
connect
(
mav
,
SIGNAL
(
hilControlsChanged
(
uint64_t
,
float
,
float
,
float
,
float
,
uint8_t
,
uint8_t
)),
this
,
SLOT
(
updateControls
(
uint64_t
,
float
,
float
,
float
,
float
,
uint8_t
,
uint8_t
)));
connect
(
mav
,
SIGNAL
(
hilActuatorsChanged
(
uint64_t
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
)),
this
,
SLOT
(
updateActuators
(
uint64_t
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
)));
connect
(
this
,
SIGNAL
(
hilStateChanged
(
uint64_t
,
float
,
float
,
float
,
float
,
float
,
float
,
int32_t
,
int32_t
,
int32_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
)),
mav
,
SLOT
(
sendHilState
(
quint64
,
float
,
float
,
float
,
float
,
float
,
float
,
int32_t
,
int32_t
,
int32_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
)));
connect
(
this
,
SIGNAL
(
sensorHilGpsChanged
(
quint64
,
double
,
double
,
double
,
int
,
float
,
float
,
float
,
float
,
int
)),
mav
,
SLOT
(
sendHilGps
(
uint64_t
,
double
,
double
,
double
,
int
,
float
,
float
,
float
,
float
,
int
)));
connect
(
this
,
SIGNAL
(
hilStateChanged
(
uint64_t
,
float
,
float
,
float
,
float
,
float
,
float
,
int32_t
,
int32_t
,
int32_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
)),
mav
,
SLOT
(
sendHilState
(
uint64_t
,
float
,
float
,
float
,
float
,
float
,
float
,
int32_t
,
int32_t
,
int32_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
,
int16_t
)));
connect
(
this
,
SIGNAL
(
sensorHilGpsChanged
(
quint64
,
double
,
double
,
double
,
int
,
float
,
float
,
float
,
float
,
int
)),
mav
,
SLOT
(
sendHilGps
(
quint64
,
double
,
double
,
double
,
int
,
float
,
float
,
float
,
float
,
int
)));
connect
(
this
,
SIGNAL
(
sensorHilRawImuChanged
(
quint64
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
quint16
)),
mav
,
SLOT
(
sendHilSensors
(
quint64
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
quint16
)));
UAS
*
uas
=
dynamic_cast
<
UAS
*>
(
mav
);
...
...
src/uas/UAS.cc
View file @
965cd4e6
...
...
@@ -1691,10 +1691,22 @@ QList<int> UAS::getComponentIds()
void
UAS
::
setMode
(
int
mode
)
{
//this->mode = mode; //no call assignament, update receive message from UAS
// Strip armed / disarmed call, this is not relevant for setting the mode
uint8_t
newMode
=
mode
;
newMode
&=
(
~
(
uint8_t
)
MAV_MODE_FLAG_SAFETY_ARMED
);
// Now set current state (request no change)
newMode
|=
(
uint8_t
)(
this
->
mode
)
&
(
uint8_t
)(
MAV_MODE_FLAG_SAFETY_ARMED
);
// Strip HIL part, replace it with current system state
newMode
&=
(
~
(
uint8_t
)
MAV_MODE_FLAG_HIL_ENABLED
);
// Now set current state (request no change)
newMode
|=
(
uint8_t
)(
this
->
mode
)
&
(
uint8_t
)(
MAV_MODE_FLAG_HIL_ENABLED
);
mavlink_message_t
msg
;
mavlink_msg_set_mode_pack
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
msg
,
(
uint8_t
)
uasId
,
(
uint8_t
)
m
ode
,
(
uint16_t
)
navMode
);
mavlink_msg_set_mode_pack
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
msg
,
(
uint8_t
)
uasId
,
newM
ode
,
(
uint16_t
)
navMode
);
sendMessage
(
msg
);
qDebug
()
<<
"SENDING REQUEST TO SET MODE TO SYSTEM"
<<
uasId
<<
", REQUEST TO SET MODE "
<<
(
uint8_t
)
m
ode
;
qDebug
()
<<
"SENDING REQUEST TO SET MODE TO SYSTEM"
<<
uasId
<<
", REQUEST TO SET MODE "
<<
newM
ode
;
}
/**
...
...
src/ui/uas/UASControlWidget.cc
View file @
965cd4e6
...
...
@@ -51,12 +51,12 @@ UASControlWidget::UASControlWidget(QWidget *parent) : QWidget(parent),
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
setUAS
(
UASInterface
*
)));
ui
.
modeComboBox
->
clear
();
ui
.
modeComboBox
->
insertItem
(
0
,
UAS
::
getShortModeTextFor
(
MAV_MODE_PREFLIGHT
),
MAV_MODE_PREFLIGHT
);
ui
.
modeComboBox
->
insertItem
(
1
,
UAS
::
getShortModeTextFor
((
MAV_MODE_FLAG_STABILIZE_ENABLED
|
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
)),
(
MAV_MODE_FLAG_STABILIZE_ENABLED
|
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
));
ui
.
modeComboBox
->
insertItem
(
2
,
UAS
::
getShortModeTextFor
(
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
),
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
);
ui
.
modeComboBox
->
insertItem
(
3
,
UAS
::
getShortModeTextFor
((
MAV_MODE_FLAG_STABILIZE_ENABLED
|
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
|
MAV_MODE_FLAG_GUIDED_ENABLED
)),
(
MAV_MODE_FLAG_STABILIZE_ENABLED
|
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
|
MAV_MODE_FLAG_GUIDED_ENABLED
));
ui
.
modeComboBox
->
insertItem
(
4
,
UAS
::
getShortModeTextFor
((
MAV_MODE_FLAG_STABILIZE_ENABLED
|
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
|
MAV_MODE_FLAG_GUIDED_ENABLED
|
MAV_MODE_FLAG_AUTO_ENABLED
)),
(
MAV_MODE_FLAG_STABILIZE_ENABLED
|
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
|
MAV_MODE_FLAG_GUIDED_ENABLED
|
MAV_MODE_FLAG_AUTO_ENABLED
));
ui
.
modeComboBox
->
insertItem
(
5
,
UAS
::
getShortModeTextFor
((
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
|
MAV_MODE_FLAG_TEST_ENABLED
)),
(
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
|
MAV_MODE_FLAG_TEST_ENABLED
));
ui
.
modeComboBox
->
insertItem
(
0
,
UAS
::
getShortModeTextFor
(
MAV_MODE_PREFLIGHT
)
.
remove
(
0
,
2
)
,
MAV_MODE_PREFLIGHT
);
ui
.
modeComboBox
->
insertItem
(
1
,
UAS
::
getShortModeTextFor
((
MAV_MODE_FLAG_STABILIZE_ENABLED
|
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
))
.
remove
(
0
,
2
)
,
(
MAV_MODE_FLAG_STABILIZE_ENABLED
|
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
));
ui
.
modeComboBox
->
insertItem
(
2
,
UAS
::
getShortModeTextFor
(
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
)
.
remove
(
0
,
2
)
,
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
);
ui
.
modeComboBox
->
insertItem
(
3
,
UAS
::
getShortModeTextFor
((
MAV_MODE_FLAG_STABILIZE_ENABLED
|
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
|
MAV_MODE_FLAG_GUIDED_ENABLED
))
.
remove
(
0
,
2
)
,
(
MAV_MODE_FLAG_STABILIZE_ENABLED
|
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
|
MAV_MODE_FLAG_GUIDED_ENABLED
));
ui
.
modeComboBox
->
insertItem
(
4
,
UAS
::
getShortModeTextFor
((
MAV_MODE_FLAG_STABILIZE_ENABLED
|
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
|
MAV_MODE_FLAG_GUIDED_ENABLED
|
MAV_MODE_FLAG_AUTO_ENABLED
))
.
remove
(
0
,
2
)
,
(
MAV_MODE_FLAG_STABILIZE_ENABLED
|
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
|
MAV_MODE_FLAG_GUIDED_ENABLED
|
MAV_MODE_FLAG_AUTO_ENABLED
));
ui
.
modeComboBox
->
insertItem
(
5
,
UAS
::
getShortModeTextFor
((
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
|
MAV_MODE_FLAG_TEST_ENABLED
))
.
remove
(
0
,
2
)
,
(
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
|
MAV_MODE_FLAG_TEST_ENABLED
));
connect
(
ui
.
modeComboBox
,
SIGNAL
(
activated
(
int
)),
this
,
SLOT
(
setMode
(
int
)));
connect
(
ui
.
setModeButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
transmitMode
()));
...
...
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