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
c7ca404b
Commit
c7ca404b
authored
Mar 31, 2011
by
James Goppert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some formatting.
parent
938a4320
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
31 deletions
+31
-31
MAVLinkProtocol.cc
src/comm/MAVLinkProtocol.cc
+8
-8
SerialLink.cc
src/comm/SerialLink.cc
+1
-1
UAS.cc
src/uas/UAS.cc
+22
-22
No files found.
src/comm/MAVLinkProtocol.cc
View file @
c7ca404b
...
...
@@ -390,14 +390,14 @@ void MAVLinkProtocol::sendHeartbeat()
mavlink_msg_heartbeat_pack
(
getSystemId
(),
getComponentId
(),
&
beat
,
OCU
,
MAV_AUTOPILOT_GENERIC
);
sendMessage
(
beat
);
}
//
if (m_authEnabled) {
//
mavlink_message_t msg;
//
mavlink_auth_key_t auth;
//
if (m_authKey.length() != MAVLINK_MSG_AUTH_KEY_FIELD_KEY_LEN) m_authKey.resize(MAVLINK_MSG_AUTH_KEY_FIELD_KEY_LEN);
//
strcpy(auth.key, m_authKey.toStdString().c_str());
//
mavlink_msg_auth_key_encode(getSystemId(), getComponentId(), &msg, &auth);
//
sendMessage(msg);
//
}
if
(
m_authEnabled
)
{
mavlink_message_t
msg
;
mavlink_auth_key_t
auth
;
if
(
m_authKey
.
length
()
!=
MAVLINK_MSG_AUTH_KEY_FIELD_KEY_LEN
)
m_authKey
.
resize
(
MAVLINK_MSG_AUTH_KEY_FIELD_KEY_LEN
);
strcpy
(
auth
.
key
,
m_authKey
.
toStdString
().
c_str
());
mavlink_msg_auth_key_encode
(
getSystemId
(),
getComponentId
(),
&
msg
,
&
auth
);
sendMessage
(
msg
);
}
}
/** @param enabled true to enable heartbeats emission at heartbeatRate, false to disable */
...
...
src/comm/SerialLink.cc
View file @
c7ca404b
src/uas/UAS.cc
View file @
c7ca404b
...
...
@@ -690,15 +690,15 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
}
break
;
//
case MAVLINK_MSG_ID_SCALED_PRESSURE: {
//
mavlink_scaled_pressure_t pressure;
//
mavlink_msg_scaled_pressure_decode(&message, &pressure);
//
quint64 time = this->getUnixTime(pressure.usec);
//
emit valueChanged(uasId, "abs pressure", "hPa", pressure.press_abs, time);
//
emit valueChanged(uasId, "diff pressure", "hPa", pressure.press_diff, time);
//
emit valueChanged(uasId, "temperature", "C", pressure.temperature/100.0, time);
//
}
//
break;
case
MAVLINK_MSG_ID_SCALED_PRESSURE
:
{
mavlink_scaled_pressure_t
pressure
;
mavlink_msg_scaled_pressure_decode
(
&
message
,
&
pressure
);
quint64
time
=
this
->
getUnixTime
(
pressure
.
usec
);
emit
valueChanged
(
uasId
,
"abs pressure"
,
"hPa"
,
pressure
.
press_abs
,
time
);
emit
valueChanged
(
uasId
,
"diff pressure"
,
"hPa"
,
pressure
.
press_diff
,
time
);
emit
valueChanged
(
uasId
,
"temperature"
,
"C"
,
pressure
.
temperature
/
100.0
,
time
);
}
break
;
case
MAVLINK_MSG_ID_RC_CHANNELS_RAW
:
{
mavlink_rc_channels_raw_t
channels
;
...
...
@@ -1975,24 +1975,24 @@ bool UAS::emergencyKILL()
void
UAS
::
startHil
()
{
//
mavlink_message_t msg;
//
//
TODO Replace MG System ID with static function call and allow to change ID in GUI
//
mavlink_msg_action_pack(MG::SYSTEM::ID, MG::SYSTEM::COMPID, &msg, this->getUASID(), MAV_COMP_ID_IMU,(int)MAV_ACTION_START_HILSIM);
//
//
Send message twice to increase chance of reception
//
sendMessage(msg);
//
sendMessage(msg);
mavlink_message_t
msg
;
// TODO Replace MG System ID with static function call and allow to change ID in GUI
mavlink_msg_action_pack
(
MG
::
SYSTEM
::
ID
,
MG
::
SYSTEM
::
COMPID
,
&
msg
,
this
->
getUASID
(),
MAV_COMP_ID_IMU
,(
int
)
MAV_ACTION_START_HILSIM
);
// Send message twice to increase chance of reception
sendMessage
(
msg
);
sendMessage
(
msg
);
}
void
UAS
::
stopHil
()
{
//
mavlink_message_t msg;
//
//
TODO Replace MG System ID with static function call and allow to change ID in GUI
//
mavlink_msg_action_pack(MG::SYSTEM::ID, MG::SYSTEM::COMPID, &msg, this->getUASID(), MAV_COMP_ID_IMU,(int)MAV_ACTION_STOP_HILSIM);
//
//
Send message twice to increase chance of reception
//
sendMessage(msg);
//
sendMessage(msg);
mavlink_message_t
msg
;
// TODO Replace MG System ID with static function call and allow to change ID in GUI
mavlink_msg_action_pack
(
MG
::
SYSTEM
::
ID
,
MG
::
SYSTEM
::
COMPID
,
&
msg
,
this
->
getUASID
(),
MAV_COMP_ID_IMU
,(
int
)
MAV_ACTION_STOP_HILSIM
);
// Send message twice to increase chance of reception
sendMessage
(
msg
);
sendMessage
(
msg
);
}
...
...
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