mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-06 15:08:53 +08:00
Implement forced VTOL landing
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
* @author Ban Siesta <bansiesta@gmail.com>
|
||||
* @author Simon Wilks <simon@uaventure.com>
|
||||
* @author Andreas Antener <andreas@uaventure.com>
|
||||
* @author Sander Smeets <sander@droneslab.com>
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -73,6 +74,7 @@ Mission::Mission(Navigator *navigator, const char *name) :
|
||||
_param_dist_1wp(this, "MIS_DIST_1WP", false),
|
||||
_param_altmode(this, "MIS_ALTMODE", false),
|
||||
_param_yawmode(this, "MIS_YAWMODE", false),
|
||||
_param_force_vtol(this, "VT_FORCE_VTOL", false),
|
||||
_onboard_mission{},
|
||||
_offboard_mission{},
|
||||
_current_onboard_mission_index(-1),
|
||||
@@ -684,7 +686,7 @@ Mission::do_need_takeoff()
|
||||
bool
|
||||
Mission::do_need_move_to_land()
|
||||
{
|
||||
if(_mission_item.nav_cmd == NAV_CMD_VTOL_LAND){
|
||||
if(_mission_item.nav_cmd == NAV_CMD_VTOL_LAND || (_mission_item.nav_cmd == NAV_CMD_LAND && _param_force_vtol.get())){
|
||||
struct vehicle_command_s cmd = {};
|
||||
cmd.command = NAV_CMD_DO_VTOL_TRANSITION;
|
||||
cmd.param1 = vehicle_status_s::VEHICLE_VTOL_STATE_MC;
|
||||
|
||||
@@ -218,6 +218,7 @@ private:
|
||||
control::BlockParamFloat _param_dist_1wp;
|
||||
control::BlockParamInt _param_altmode;
|
||||
control::BlockParamInt _param_yawmode;
|
||||
control::BlockParamInt _param_force_vtol;
|
||||
|
||||
struct mission_s _onboard_mission;
|
||||
struct mission_s _offboard_mission;
|
||||
|
||||
@@ -311,3 +311,12 @@ PARAM_DEFINE_FLOAT(VT_TRANS_TIMEOUT, 15.0f);
|
||||
* @group VTOL Attitude Control
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(VT_TRANS_MIN_TM, 2.0f);
|
||||
|
||||
/**
|
||||
* Force VTOL mode takeoff and land
|
||||
*
|
||||
* @min 0
|
||||
* @max 1
|
||||
* @group VTOL Attitude Control
|
||||
*/
|
||||
PARAM_DEFINE_INT32(VT_FORCE_VTOL, 0);
|
||||
|
||||
Reference in New Issue
Block a user