mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 02:23:34 +08:00
implemented vtol weathervane yaw control for landing and loiter mission item
This commit is contained in:
@@ -70,7 +70,9 @@ MissionBlock::MissionBlock(Navigator *navigator, const char *name) :
|
||||
_action_start(0),
|
||||
_actuators{},
|
||||
_actuator_pub(nullptr),
|
||||
_cmd_pub(nullptr)
|
||||
_cmd_pub(nullptr),
|
||||
_param_vtol_wv_land(this, "VT_WV_LND_EN", false),
|
||||
_param_vtol_wv_loiter(this, "VT_WV_LTR_EN", false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -175,6 +177,7 @@ MissionBlock::is_mission_item_reached()
|
||||
}
|
||||
|
||||
/* Check if the waypoint and the requested yaw setpoint. */
|
||||
|
||||
if (_waypoint_position_reached && !_waypoint_yaw_reached) {
|
||||
|
||||
/* TODO: removed takeoff, why? */
|
||||
@@ -310,6 +313,7 @@ MissionBlock::mission_item_to_position_setpoint(const struct mission_item_s *ite
|
||||
sp->loiter_direction = item->loiter_direction;
|
||||
sp->pitch_min = item->pitch_min;
|
||||
sp->acceptance_radius = item->acceptance_radius;
|
||||
sp->disable_mc_yaw_control = false;
|
||||
|
||||
switch (item->nav_cmd) {
|
||||
case NAV_CMD_IDLE:
|
||||
@@ -322,12 +326,18 @@ MissionBlock::mission_item_to_position_setpoint(const struct mission_item_s *ite
|
||||
|
||||
case NAV_CMD_LAND:
|
||||
sp->type = position_setpoint_s::SETPOINT_TYPE_LAND;
|
||||
if(_navigator->get_vstatus()->is_vtol && _param_vtol_wv_land.get()){
|
||||
sp->disable_mc_yaw_control = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case NAV_CMD_LOITER_TIME_LIMIT:
|
||||
case NAV_CMD_LOITER_TURN_COUNT:
|
||||
case NAV_CMD_LOITER_UNLIMITED:
|
||||
sp->type = position_setpoint_s::SETPOINT_TYPE_LOITER;
|
||||
if(_navigator->get_vstatus()->is_vtol && _param_vtol_wv_loiter.get()){
|
||||
sp->disable_mc_yaw_control = true;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -45,6 +45,9 @@
|
||||
|
||||
#include <navigator/navigation.h>
|
||||
|
||||
#include <controllib/blocks.hpp>
|
||||
#include <controllib/block/BlockParam.hpp>
|
||||
|
||||
#include <uORB/topics/mission.h>
|
||||
#include <uORB/topics/vehicle_global_position.h>
|
||||
#include <uORB/topics/position_setpoint_triplet.h>
|
||||
@@ -129,6 +132,8 @@ protected:
|
||||
actuator_controls_s _actuators;
|
||||
orb_advert_t _actuator_pub;
|
||||
orb_advert_t _cmd_pub;
|
||||
control::BlockParamInt _param_vtol_wv_land;
|
||||
control::BlockParamInt _param_vtol_wv_loiter;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user