mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-06 19:21:36 +08:00
Commander: Speed up airspeed calibration
This commit is contained in:
@@ -72,12 +72,12 @@ int do_airspeed_calibration(int mavlink_fd)
|
|||||||
{
|
{
|
||||||
int result = OK;
|
int result = OK;
|
||||||
unsigned calibration_counter = 0;
|
unsigned calibration_counter = 0;
|
||||||
const unsigned maxcount = 3000;
|
const unsigned maxcount = 2400;
|
||||||
|
|
||||||
/* give directions */
|
/* give directions */
|
||||||
mavlink_log_info(mavlink_fd, CAL_QGC_STARTED_MSG, sensor_name);
|
mavlink_log_info(mavlink_fd, CAL_QGC_STARTED_MSG, sensor_name);
|
||||||
|
|
||||||
const unsigned calibration_count = 2000;
|
const unsigned calibration_count = (maxcount * 2) / 3;
|
||||||
|
|
||||||
int diff_pres_sub = orb_subscribe(ORB_ID(differential_pressure));
|
int diff_pres_sub = orb_subscribe(ORB_ID(differential_pressure));
|
||||||
struct differential_pressure_s diff_pres;
|
struct differential_pressure_s diff_pres;
|
||||||
@@ -201,9 +201,9 @@ int do_airspeed_calibration(int mavlink_fd)
|
|||||||
/* just take a few samples and make sure pitot tubes are not reversed, timeout after ~30 seconds */
|
/* just take a few samples and make sure pitot tubes are not reversed, timeout after ~30 seconds */
|
||||||
while (calibration_counter < maxcount) {
|
while (calibration_counter < maxcount) {
|
||||||
|
|
||||||
if (calibrate_cancel_check(mavlink_fd, cancel_sub)) {
|
if (calibrate_cancel_check(mavlink_fd, cancel_sub)) {
|
||||||
goto error_return;
|
goto error_return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* wait blocking for new data */
|
/* wait blocking for new data */
|
||||||
struct pollfd fds[1];
|
struct pollfd fds[1];
|
||||||
|
|||||||
Reference in New Issue
Block a user