Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/ArduSub/Sub.cpp
Views: 1798
/*1This program is free software: you can redistribute it and/or modify2it under the terms of the GNU General Public License as published by3the Free Software Foundation, either version 3 of the License, or4(at your option) any later version.56This program is distributed in the hope that it will be useful,7but WITHOUT ANY WARRANTY; without even the implied warranty of8MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9GNU General Public License for more details.1011You should have received a copy of the GNU General Public License12along with this program. If not, see <http://www.gnu.org/licenses/>.13*/14#include "Sub.h"1516#define FORCE_VERSION_H_INCLUDE17#include "version.h"18#undef FORCE_VERSION_H_INCLUDE1920const AP_HAL::HAL& hal = AP_HAL::get_HAL();2122/*23constructor for main Sub class24*/25Sub::Sub()26:27control_mode(Mode::Number::MANUAL),28motors(MAIN_LOOP_RATE),29auto_yaw_mode(AUTO_YAW_LOOK_AT_NEXT_WP),30inertial_nav(ahrs),31ahrs_view(ahrs, ROTATION_NONE),32attitude_control(ahrs_view, aparm, motors),33pos_control(ahrs_view, inertial_nav, motors, attitude_control),34wp_nav(inertial_nav, ahrs_view, pos_control, attitude_control),35loiter_nav(inertial_nav, ahrs_view, pos_control, attitude_control),36circle_nav(inertial_nav, ahrs_view, pos_control),37param_loader(var_info),38flightmode(&mode_manual),39auto_mode(Auto_WP),40guided_mode(Guided_WP)41{42#if CONFIG_HAL_BOARD != HAL_BOARD_SITL43failsafe.pilot_input = true;44#endif45if (_singleton != nullptr) {46AP_HAL::panic("Can only be one Sub");47}48_singleton = this;49}5051Sub *Sub::_singleton = nullptr;5253Sub sub;54AP_Vehicle& vehicle = sub;555657