mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 16:43:34 +08:00
warn immediately if ekf2 instance allocation has failed
This commit is contained in:
@@ -902,17 +902,17 @@ int ekf2_main(int argc, char *argv[])
|
||||
|
||||
ekf2::instance = new Ekf2();
|
||||
|
||||
if (ekf2::instance == nullptr) {
|
||||
PX4_WARN("alloc failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (argc >= 3) {
|
||||
if (!strcmp(argv[2], "--replay")) {
|
||||
ekf2::instance->set_replay_mode(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (ekf2::instance == nullptr) {
|
||||
PX4_WARN("alloc failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (OK != ekf2::instance->start()) {
|
||||
delete ekf2::instance;
|
||||
ekf2::instance = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user