mirror of https://github.com/ArduPilot/ardupilot
Tracker: add arming library to avoid segmentation fault
Places make assumptions that the AP_Arming singleton is non-null
This commit is contained in:
parent
075ef40d95
commit
d8f6089f64
|
@ -0,0 +1,14 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <AP_Arming/AP_Arming.h>
|
||||||
|
|
||||||
|
// this class isn't actually used by Tracker; it's really just here so
|
||||||
|
// the singleton doesn't come back as nullptr
|
||||||
|
class AP_Arming_Tracker : public AP_Arming
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
friend class Tracker;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
};
|
|
@ -52,6 +52,8 @@
|
||||||
#include "GCS_Mavlink.h"
|
#include "GCS_Mavlink.h"
|
||||||
#include "GCS_Tracker.h"
|
#include "GCS_Tracker.h"
|
||||||
|
|
||||||
|
#include "AP_Arming.h"
|
||||||
|
|
||||||
#ifdef ENABLE_SCRIPTING
|
#ifdef ENABLE_SCRIPTING
|
||||||
#include <AP_Scripting/AP_Scripting.h>
|
#include <AP_Scripting/AP_Scripting.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -230,6 +232,9 @@ private:
|
||||||
void tracking_manual_control(const mavlink_manual_control_t &msg);
|
void tracking_manual_control(const mavlink_manual_control_t &msg);
|
||||||
void update_armed_disarmed();
|
void update_armed_disarmed();
|
||||||
|
|
||||||
|
// Arming/Disarming management class
|
||||||
|
AP_Arming_Tracker arming;
|
||||||
|
|
||||||
// Mission library
|
// Mission library
|
||||||
AP_Mission mission{
|
AP_Mission mission{
|
||||||
FUNCTOR_BIND_MEMBER(&Tracker::start_command_callback, bool, const AP_Mission::Mission_Command &),
|
FUNCTOR_BIND_MEMBER(&Tracker::start_command_callback, bool, const AP_Mission::Mission_Command &),
|
||||||
|
|
Loading…
Reference in New Issue