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
a96cc2d2
Unverified
Commit
a96cc2d2
authored
Feb 03, 2018
by
Don Gagne
Committed by
GitHub
Feb 03, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6098 from DonLakeFlyer/Latency2
Support HIGH_LATENCY2.failure_flags
parents
52816235
45cfae38
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
11 deletions
+35
-11
Vehicle.cc
src/Vehicle/Vehicle.cc
+35
-11
No files found.
src/Vehicle/Vehicle.cc
View file @
a96cc2d2
...
...
@@ -814,17 +814,6 @@ void Vehicle::_handleHighLatency2(mavlink_message_t& message)
mavlink_high_latency2_t
highLatency2
;
mavlink_msg_high_latency2_decode
(
&
message
,
&
highLatency2
);
#if 0
typedef struct __mavlink_high_latency2_t {
uint16_t wp_num; /*< Current waypoint number*/
uint16_t failure_flags; /*< Indicates failures as defined in MAV_FAILURE_FLAG ENUM. */
uint8_t flight_mode; /*< Flight Mode of the vehicle as defined in the FLIGHT_MODE ENUM*/
uint8_t failsafe; /*< Indicates if a failsafe mode is triggered, defined in MAV_FAILSAFE_FLAG ENUM*/
}) mavlink_high_latency2_t;
#endif
// FIXME: flight mode not yet supported
_coordinate
.
setLatitude
(
highLatency2
.
latitude
/
(
double
)
1E7
);
_coordinate
.
setLongitude
(
highLatency2
.
longitude
/
(
double
)
1E7
);
_coordinate
.
setAltitude
(
highLatency2
.
altitude
);
...
...
@@ -849,6 +838,40 @@ void Vehicle::_handleHighLatency2(mavlink_message_t& message)
_gpsFactGroup
.
count
()
->
setRawValue
(
0
);
_gpsFactGroup
.
hdop
()
->
setRawValue
(
highLatency2
.
eph
==
UINT8_MAX
?
std
::
numeric_limits
<
double
>::
quiet_NaN
()
:
highLatency2
.
eph
/
10.0
);
_gpsFactGroup
.
vdop
()
->
setRawValue
(
highLatency2
.
epv
==
UINT8_MAX
?
std
::
numeric_limits
<
double
>::
quiet_NaN
()
:
highLatency2
.
epv
/
10.0
);
struct
failure2Sensor_s
{
MAV_FAILURE_FLAG
failureBit
;
MAV_SYS_STATUS_SENSOR
sensorBit
;
};
static
const
failure2Sensor_s
rgFailure2Sensor
[]
=
{
{
MAV_FAILURE_FLAG_GPS
,
MAV_SYS_STATUS_SENSOR_GPS
},
{
MAV_FAILURE_FLAG_AIRSPEED
,
MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE
},
{
MAV_FAILURE_FLAG_BAROMETER
,
MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE
},
{
MAV_FAILURE_FLAG_ACCELEROMETER
,
MAV_SYS_STATUS_SENSOR_3D_ACCEL
},
{
MAV_FAILURE_FLAG_GYROSCOPE
,
MAV_SYS_STATUS_SENSOR_3D_GYRO
},
{
MAV_FAILURE_FLAG_MAGNETOMETER
,
MAV_SYS_STATUS_SENSOR_3D_MAG
},
// { MAV_FAILURE_FLAG_MISSION, ???? },
// { MAV_FAILURE_FLAG_ESTIMATOR, ???? },
// { MAV_FAILURE_FLAG_LIDAR, ???? },
// { MAV_FAILURE_FLAG_OFFBOARD_LINK, ???? },
};
// Map from MAV_FAILURE bits to standard SYS_STATUS message handling
uint32_t
newOnboardControlSensorsEnabled
=
0
;
for
(
size_t
i
=
0
;
i
<
sizeof
(
rgFailure2Sensor
)
/
sizeof
(
failure2Sensor_s
);
i
++
)
{
const
failure2Sensor_s
*
pFailure2Sensor
=
&
rgFailure2Sensor
[
i
];
if
(
highLatency2
.
failure_flags
&
pFailure2Sensor
->
failureBit
)
{
// Assume if reporting as unhealthy that is it present and enabled
newOnboardControlSensorsEnabled
|=
pFailure2Sensor
->
sensorBit
;
}
}
if
(
newOnboardControlSensorsEnabled
!=
_onboardControlSensorsEnabled
)
{
_onboardControlSensorsEnabled
=
newOnboardControlSensorsEnabled
;
_onboardControlSensorsPresent
=
newOnboardControlSensorsEnabled
;
_onboardControlSensorsUnhealthy
=
0
;
emit
unhealthySensorsChanged
();
}
}
void
Vehicle
::
_handleAltitude
(
mavlink_message_t
&
message
)
...
...
@@ -2726,6 +2749,7 @@ QStringList Vehicle::unhealthySensors(void) const
{
MAV_SYS_STATUS_TERRAIN
,
"Terrain"
},
{
MAV_SYS_STATUS_REVERSE_MOTOR
,
"Motors reversed"
},
{
MAV_SYS_STATUS_LOGGING
,
"Logging"
},
{
MAV_SYS_STATUS_SENSOR_BATTERY
,
"Battery"
},
};
for
(
size_t
i
=
0
;
i
<
sizeof
(
rgSensorInfo
)
/
sizeof
(
sensorInfo_s
);
i
++
)
{
...
...
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