AP_NavEKF: give a sensible error for no such file on replay

This commit is contained in:
Andrew Tridgell 2014-03-01 14:24:51 +11:00
parent 854f013146
commit 295cd9adba
1 changed files with 6 additions and 1 deletions

View File

@ -44,6 +44,7 @@
#include <AP_NavEKF.h> #include <AP_NavEKF.h>
#include <stdio.h> #include <stdio.h>
#include <getopt.h> #include <getopt.h>
#include <errno.h>
#include "LogReader.h" #include "LogReader.h"
@ -109,7 +110,11 @@ void setup()
if (update_rate != 0) { if (update_rate != 0) {
hal.console->printf("Using an update rate of %u Hz\n", update_rate); hal.console->printf("Using an update rate of %u Hz\n", update_rate);
} }
LogReader.open_log(filename);
if (!LogReader.open_log(filename)) {
perror(filename);
exit(1);
}
LogReader.wait_type(LOG_GPS_MSG); LogReader.wait_type(LOG_GPS_MSG);
LogReader.wait_type(LOG_IMU_MSG); LogReader.wait_type(LOG_IMU_MSG);