7 changed files with 108 additions and 0 deletions
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
./waf configure --board Pixhawk4 |
||||
./waf copter |
@ -0,0 +1,51 @@
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
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/>.
|
||||
*/ |
||||
#include "AC_ZR_App.h" |
||||
|
||||
|
||||
AC_ZR_App *AC_ZR_App::_singleton; |
||||
|
||||
// table of user settable parameters
|
||||
const AP_Param::GroupInfo AC_ZR_App::var_info[] = { |
||||
// @Param: _TYPE
|
||||
// @DisplayName: 1st GPS type
|
||||
// @Description: GPS type of 1st GPS
|
||||
// @Values: 0:None,1:AUTO,2:uBlox,3:MTK,4:MTK19,5:NMEA,6:SiRF,7:HIL,8:SwiftNav,9:UAVCAN,10:SBF,11:GSOF,13:ERB,14:MAV,15:NOVA,16:HemisphereNMEA,17:uBlox-MovingBaseline-Base,18:uBlox-MovingBaseline-Rover,19:MSP,20:AllyStar,21:ExternalAHRS
|
||||
// @RebootRequired: True
|
||||
// @User: Advanced
|
||||
AP_GROUPINFO("_TYPE", 0, AC_ZR_App, _type, 1), |
||||
|
||||
AP_GROUPINFO("_ID_TYPE", 1, AC_ZR_App, sysid_type, 0 ), |
||||
AP_GROUPINFO("_ID_BOARD_ID", 2, AC_ZR_App, sysid_board_id, 100), |
||||
AP_GROUPINFO("_ID_DL1", 3, AC_ZR_App, sysid_dl1, 0x8175), |
||||
AP_GROUPINFO("_ID_DL2", 4, AC_ZR_App, sysid_dl2, 0x6fda), |
||||
AP_GROUPINFO("_ID_DL3", 5, AC_ZR_App, sysid_dl3, 0xf38f), |
||||
AP_GROUPINFO("_ID_DL4", 6, AC_ZR_App, sysid_dl4, 0xbf48), |
||||
|
||||
|
||||
AP_GROUPEND |
||||
}; |
||||
|
||||
// constructor
|
||||
AC_ZR_App::AC_ZR_App() |
||||
{ |
||||
|
||||
AP_Param::setup_object_defaults(this, var_info); |
||||
|
||||
if (_singleton != nullptr) { |
||||
AP_HAL::panic("AC_ZR_App must be singleton"); |
||||
} |
||||
_singleton = this; |
||||
} |
@ -0,0 +1,48 @@
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
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> |
||||
|
||||
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; |
||||
} |
||||
|
||||
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; |
||||
|
||||
private: |
||||
static AC_ZR_App *_singleton; |
||||
|
||||
void get_deadline_params(int32_t &deadline); |
||||
}; |
Loading…
Reference in new issue