mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
INAV: Add braces to ensure statements are evaluated correctly
This commit is contained in:
parent
3f63b67eb6
commit
2cc5c6e84f
@ -788,21 +788,21 @@ int position_estimator_inav_thread_main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* check for timeout on GPS topic */
|
||||
if (gps_valid && t > gps.timestamp_position + gps_topic_timeout) {
|
||||
if (gps_valid && (t > (gps.timestamp_position + gps_topic_timeout))) {
|
||||
gps_valid = false;
|
||||
warnx("GPS timeout");
|
||||
mavlink_log_info(mavlink_fd, "[inav] GPS timeout");
|
||||
}
|
||||
|
||||
/* check for timeout on vision topic */
|
||||
if (vision_valid && t > vision.timestamp_boot + vision_topic_timeout) {
|
||||
if (vision_valid && (t > (vision.timestamp_boot + vision_topic_timeout))) {
|
||||
vision_valid = false;
|
||||
warnx("VISION timeout");
|
||||
mavlink_log_info(mavlink_fd, "[inav] VISION timeout");
|
||||
}
|
||||
|
||||
/* check for sonar measurement timeout */
|
||||
if (sonar_valid && t > sonar_time + sonar_timeout) {
|
||||
if (sonar_valid && (t > (sonar_time + sonar_timeout))) {
|
||||
corr_sonar = 0.0f;
|
||||
sonar_valid = false;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user