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
9077cdb3
Commit
9077cdb3
authored
May 17, 2010
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added NAV MODE field
parent
7eb46a2e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
SerialLink.cc
src/comm/SerialLink.cc
+6
-4
UAS.cc
src/uas/UAS.cc
+7
-3
No files found.
src/comm/SerialLink.cc
View file @
9077cdb3
...
...
@@ -152,16 +152,18 @@ void SerialLink::checkForBytes() {
void
SerialLink
::
writeBytes
(
const
char
*
data
,
qint64
size
)
{
if
(
port
->
isOpen
())
{
if
(
port
->
isOpen
())
{
int
b
=
port
->
write
(
data
,
size
);
qDebug
()
<<
"Transmitted "
<<
b
<<
"bytes:"
;
/
* Increase write counter */
/
/ Increase write counter
bitsSentTotal
+=
size
*
8
;
int
i
;
for
(
i
=
0
;
i
<
size
;
i
++
){
unsigned
int
v
=
data
[
i
];
for
(
i
=
0
;
i
<
size
;
i
++
)
{
unsigned
char
v
=
data
[
i
];
fprintf
(
stderr
,
"%02x "
,
v
);
}
...
...
src/uas/UAS.cc
View file @
9077cdb3
...
...
@@ -122,6 +122,9 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
mavlink_sys_status_t
state
;
mavlink_msg_sys_status_decode
(
&
message
,
&
state
);
// FIXME
qDebug
()
<<
"SYSTEM NAV MODE:"
<<
state
.
nav_mode
;
QString
audiostring
=
"System "
+
QString
::
number
(
this
->
getUASID
());
QString
stateAudio
=
""
;
QString
modeAudio
=
""
;
...
...
@@ -137,13 +140,13 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
stateAudio
=
" changed status to "
+
uasState
;
}
if
(
static_cast
<
int
>
(
this
->
mode
)
!=
static_cast
<
int
>
(
state
.
mode
))
if
(
static_cast
<
unsigned
int
>
(
this
->
mode
)
!=
static_cast
<
unsigned
int
>
(
state
.
mode
))
{
modechanged
=
true
;
this
->
mode
=
state
.
mode
;
QString
mode
;
switch
(
state
.
mode
)
switch
(
(
unsigned
int
)(
state
.
mode
)
)
{
case
MAV_MODE_LOCKED
:
mode
=
"LOCKED MODE"
;
...
...
@@ -424,8 +427,9 @@ void UAS::setMode(int mode)
{
this
->
mode
=
mode
;
mavlink_message_t
msg
;
mavlink_msg_set_mode_pack
(
MG
::
SYSTEM
::
ID
,
MG
::
SYSTEM
::
COMPID
,
&
msg
,
getUASID
()
,
(
unsigned
char
)
mode
);
mavlink_msg_set_mode_pack
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
msg
,
uasId
,
(
unsigned
char
)
mode
);
sendMessage
(
msg
);
qDebug
()
<<
"SENDING REQUEST TO SET MODE TO SYSTEM"
<<
uasId
<<
", REQUEST TO SET MODE "
<<
mode
;
}
}
...
...
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