You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
2.0 KiB
70 lines
2.0 KiB
/* |
|
This program is free software: you can redistribute it and/or modify |
|
it under the terms of the GNU General Public License as published by |
|
the Free Software Foundation, either version 3 of the License, or |
|
(at your option) any later version. |
|
|
|
This program is distributed in the hope that it will be useful, |
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
GNU General Public License for more details. |
|
|
|
You should have received a copy of the GNU General Public License |
|
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
*/ |
|
#pragma once |
|
|
|
#include <AP_HAL/AP_HAL.h> |
|
#include <AP_Param/AP_Param.h> |
|
#include <GCS_MAVLink/GCS.h> |
|
#include <GCS_MAVLink/GCS_MAVLink.h> |
|
|
|
#include <sys/time.h> |
|
#include <time.h> |
|
#include "Des.h" |
|
#ifndef ZR_FRAME_TYPE |
|
#define ZR_FRAME_TYPE 0 |
|
#endif |
|
class AC_ZR_App |
|
{ |
|
public: |
|
AC_ZR_App(); |
|
/* Do not allow copies */ |
|
AC_ZR_App(const AC_ZR_App &other) = delete; |
|
AC_ZR_App &operator=(const AC_ZR_App&) = delete; |
|
|
|
static AC_ZR_App *get_singleton() { |
|
return _singleton; |
|
} |
|
|
|
void get_deadline_params(uint32_t &deadline); |
|
bool check_deadline(uint32_t &date); |
|
uint32_t get_zr_sysid(); |
|
|
|
uint16_t get_land_deceleration(int32_t alt_cm,int16_t sys_speed_dn); |
|
uint8_t get_battery_capacity(uint8_t type,float volt); |
|
|
|
static const struct AP_Param::GroupInfo var_info[]; |
|
|
|
protected: |
|
|
|
AP_Int8 _type; |
|
AP_Int8 sysid_type; // modify by @Brown |
|
AP_Int32 sysid_board_id; |
|
AP_Int32 sysid_dl1; |
|
AP_Int32 sysid_dl2; |
|
AP_Int32 sysid_dl3; |
|
AP_Int32 sysid_dl4; |
|
|
|
AP_Int16 land_slow_alt_high; |
|
AP_Int16 land_slow_alt_mid; |
|
AP_Int16 land_slow_alt_low; |
|
AP_Int16 land_slow_speed_dn_high; |
|
AP_Int16 land_slow_speed_dn_mid; |
|
AP_Int16 land_slow_speed_dn_low; |
|
|
|
private: |
|
uint8_t BinarySearch2f(float a[], float value, int low, int high); |
|
static AC_ZR_App *_singleton; |
|
|
|
};
|
|
|