mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 04:23:33 +08:00
GPS driver: Obey non-publish flag in all modes
This commit is contained in:
@@ -361,11 +361,14 @@ GPS::task_main()
|
|||||||
_report_gps_pos.timestamp_variance = hrt_absolute_time();
|
_report_gps_pos.timestamp_variance = hrt_absolute_time();
|
||||||
_report_gps_pos.timestamp_velocity = hrt_absolute_time();
|
_report_gps_pos.timestamp_velocity = hrt_absolute_time();
|
||||||
_report_gps_pos.timestamp_time = hrt_absolute_time();
|
_report_gps_pos.timestamp_time = hrt_absolute_time();
|
||||||
if (_report_gps_pos_pub > 0) {
|
|
||||||
orb_publish(ORB_ID(vehicle_gps_position), _report_gps_pos_pub, &_report_gps_pos);
|
|
||||||
|
|
||||||
} else {
|
if (!(_pub_blocked)) {
|
||||||
_report_gps_pos_pub = orb_advertise(ORB_ID(vehicle_gps_position), &_report_gps_pos);
|
if (_report_gps_pos_pub > 0) {
|
||||||
|
orb_publish(ORB_ID(vehicle_gps_position), _report_gps_pos_pub, &_report_gps_pos);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
_report_gps_pos_pub = orb_advertise(ORB_ID(vehicle_gps_position), &_report_gps_pos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// GPS is obviously detected successfully, reset statistics
|
// GPS is obviously detected successfully, reset statistics
|
||||||
|
|||||||
Reference in New Issue
Block a user