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
0d2f136a
Commit
0d2f136a
authored
Apr 12, 2011
by
lm
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of github.com:pixhawk/qgroundcontrol into opmapcontrol
parents
52b20293
a7383a1a
Changes
3
Hide 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 @
0d2f136a
...
@@ -390,14 +390,14 @@ void MAVLinkProtocol::sendHeartbeat()
...
@@ -390,14 +390,14 @@ void MAVLinkProtocol::sendHeartbeat()
mavlink_msg_heartbeat_pack
(
getSystemId
(),
getComponentId
(),
&
beat
,
OCU
,
MAV_AUTOPILOT_GENERIC
);
mavlink_msg_heartbeat_pack
(
getSystemId
(),
getComponentId
(),
&
beat
,
OCU
,
MAV_AUTOPILOT_GENERIC
);
sendMessage
(
beat
);
sendMessage
(
beat
);
}
}
//
if (m_authEnabled) {
if
(
m_authEnabled
)
{
//
mavlink_message_t msg;
mavlink_message_t
msg
;
//
mavlink_auth_key_t auth;
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);
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());
strcpy
(
auth
.
key
,
m_authKey
.
toStdString
().
c_str
());
//
mavlink_msg_auth_key_encode(getSystemId(), getComponentId(), &msg, &auth);
mavlink_msg_auth_key_encode
(
getSystemId
(),
getComponentId
(),
&
msg
,
&
auth
);
//
sendMessage(msg);
sendMessage
(
msg
);
//
}
}
}
}
/** @param enabled true to enable heartbeats emission at heartbeatRate, false to disable */
/** @param enabled true to enable heartbeats emission at heartbeatRate, false to disable */
...
...
src/comm/SerialLink.cc
View file @
0d2f136a
...
@@ -173,7 +173,7 @@ void SerialLink::readBytes()
...
@@ -173,7 +173,7 @@ void SerialLink::readBytes()
const
qint64
maxLength
=
2048
;
const
qint64
maxLength
=
2048
;
char
data
[
maxLength
];
char
data
[
maxLength
];
qint64
numBytes
=
port
->
bytesAvailable
();
qint64
numBytes
=
port
->
bytesAvailable
();
//qDebug() << "numBytes: " << numBytes;
//qDebug() << "numBytes: " << numBytes;
if
(
numBytes
>
0
)
{
if
(
numBytes
>
0
)
{
/* Read as much data in buffer as possible without overflow */
/* Read as much data in buffer as possible without overflow */
...
...
src/uas/UAS.cc
View file @
0d2f136a
...
@@ -690,15 +690,15 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
...
@@ -690,15 +690,15 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
}
}
break
;
break
;
//
case MAVLINK_MSG_ID_SCALED_PRESSURE: {
case
MAVLINK_MSG_ID_SCALED_PRESSURE
:
{
//
mavlink_scaled_pressure_t pressure;
mavlink_scaled_pressure_t
pressure
;
//
mavlink_msg_scaled_pressure_decode(&message, &pressure);
mavlink_msg_scaled_pressure_decode
(
&
message
,
&
pressure
);
//
quint64 time = this->getUnixTime(pressure.usec);
quint64
time
=
this
->
getUnixTime
(
pressure
.
usec
);
//
emit valueChanged(uasId, "abs pressure", "hPa", pressure.press_abs, time);
emit
valueChanged
(
uasId
,
"abs pressure"
,
"hPa"
,
pressure
.
press_abs
,
time
);
//
emit valueChanged(uasId, "diff pressure", "hPa", pressure.press_diff, time);
emit
valueChanged
(
uasId
,
"diff pressure"
,
"hPa"
,
pressure
.
press_diff
,
time
);
//
emit valueChanged(uasId, "temperature", "C", pressure.temperature/100.0, time);
emit
valueChanged
(
uasId
,
"temperature"
,
"C"
,
pressure
.
temperature
/
100.0
,
time
);
//
}
}
//
break;
break
;
case
MAVLINK_MSG_ID_RC_CHANNELS_RAW
:
{
case
MAVLINK_MSG_ID_RC_CHANNELS_RAW
:
{
mavlink_rc_channels_raw_t
channels
;
mavlink_rc_channels_raw_t
channels
;
...
@@ -1304,7 +1304,7 @@ void UAS::getStatusForCode(int statusCode, QString& uasState, QString& stateDesc
...
@@ -1304,7 +1304,7 @@ void UAS::getStatusForCode(int statusCode, QString& uasState, QString& stateDesc
uasState
=
tr
(
"EMERGENCY"
);
uasState
=
tr
(
"EMERGENCY"
);
stateDescription
=
tr
(
"EMERGENCY: Land Immediately!"
);
stateDescription
=
tr
(
"EMERGENCY: Land Immediately!"
);
break
;
break
;
//case MAV_STATE_HILSIM:
//case MAV_STATE_HILSIM:
//uasState = tr("HIL SIM");
//uasState = tr("HIL SIM");
//stateDescription = tr("HIL Simulation, Sensors read from SIM");
//stateDescription = tr("HIL Simulation, Sensors read from SIM");
//break;
//break;
...
@@ -1975,24 +1975,24 @@ bool UAS::emergencyKILL()
...
@@ -1975,24 +1975,24 @@ bool UAS::emergencyKILL()
void
UAS
::
startHil
()
void
UAS
::
startHil
()
{
{
//
mavlink_message_t msg;
mavlink_message_t
msg
;
//
//
TODO Replace MG System ID with static function call and allow to change ID in GUI
// 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);
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
// Send message twice to increase chance of reception
//
sendMessage(msg);
sendMessage
(
msg
);
//
sendMessage(msg);
sendMessage
(
msg
);
}
}
void
UAS
::
stopHil
()
void
UAS
::
stopHil
()
{
{
//
mavlink_message_t msg;
mavlink_message_t
msg
;
//
//
TODO Replace MG System ID with static function call and allow to change ID in GUI
// 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);
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
// Send message twice to increase chance of reception
//
sendMessage(msg);
sendMessage
(
msg
);
//
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