mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
Rover: AP_Arming: use callback in place of variable reference for home state
This commit is contained in:
parent
362c6e1b9e
commit
ddf172c75b
7
APMrover2/AP_Arming.cpp
Normal file
7
APMrover2/AP_Arming.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
#include "AP_Arming.h"
|
||||
#include "Rover.h"
|
||||
|
||||
enum HomeState AP_Arming_Rover::home_status() const
|
||||
{
|
||||
return rover.home_is_set;
|
||||
}
|
21
APMrover2/AP_Arming.h
Normal file
21
APMrover2/AP_Arming.h
Normal file
@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <AP_Arming/AP_Arming.h>
|
||||
|
||||
/*
|
||||
a rover-specific arming class
|
||||
*/
|
||||
class AP_Arming_Rover : public AP_Arming
|
||||
{
|
||||
public:
|
||||
|
||||
AP_Arming_Rover(const AP_AHRS &ahrs_ref, const AP_Baro &baro, Compass &compass,
|
||||
const AP_BattMonitor &battery) :
|
||||
AP_Arming(ahrs_ref, baro, compass, battery) {
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
enum HomeState home_status() const override;
|
||||
};
|
||||
|
@ -63,7 +63,7 @@
|
||||
#include <AP_BoardConfig/AP_BoardConfig.h>
|
||||
#include <AP_Frsky_Telem/AP_Frsky_Telem.h>
|
||||
|
||||
#include <AP_Arming/AP_Arming.h>
|
||||
#include "AP_Arming.h"
|
||||
#include "compat.h"
|
||||
|
||||
#include <AP_Notify/AP_Notify.h> // Notify library
|
||||
@ -93,7 +93,7 @@ public:
|
||||
friend class GCS_MAVLINK_Rover;
|
||||
friend class Parameters;
|
||||
friend class ParametersG2;
|
||||
friend class AP_Arming;
|
||||
friend class AP_Arming_Rover;
|
||||
|
||||
Rover(void);
|
||||
|
||||
@ -152,7 +152,7 @@ private:
|
||||
#endif
|
||||
|
||||
// Arming/Disarming management class
|
||||
AP_Arming arming {ahrs, barometer, compass, battery, home_is_set};
|
||||
AP_Arming_Rover arming {ahrs, barometer, compass, battery};
|
||||
|
||||
AP_L1_Control L1_controller;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user