mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 21:03:35 +08:00
Remove more stuff
This commit is contained in:
@@ -16,6 +16,7 @@ control_allocator start
|
|||||||
fw_rate_control start
|
fw_rate_control start
|
||||||
fw_att_control start
|
fw_att_control start
|
||||||
fw_mode_manager start
|
fw_mode_manager start
|
||||||
|
fw_guidance_control start
|
||||||
fw_lat_lon_control start
|
fw_lat_lon_control start
|
||||||
airspeed_selector start
|
airspeed_selector start
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ fi
|
|||||||
fw_rate_control start vtol
|
fw_rate_control start vtol
|
||||||
fw_att_control start vtol
|
fw_att_control start vtol
|
||||||
fw_mode_manager start
|
fw_mode_manager start
|
||||||
|
fw_guidance_control start
|
||||||
fw_lat_lon_control start vtol
|
fw_lat_lon_control start vtol
|
||||||
fw_autotune_attitude_control start vtol
|
fw_autotune_attitude_control start vtol
|
||||||
|
|
||||||
|
|||||||
@@ -101,31 +101,6 @@ FixedWingGuidanceControl::vehicle_control_mode_poll()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
FixedWingGuidanceControl::vehicle_command_poll()
|
|
||||||
{
|
|
||||||
vehicle_command_s vehicle_command;
|
|
||||||
|
|
||||||
while (_vehicle_command_sub.update(&vehicle_command)) {
|
|
||||||
if (vehicle_command.command == vehicle_command_s::VEHICLE_CMD_DO_CHANGE_SPEED) {
|
|
||||||
|
|
||||||
if ((static_cast<uint8_t>(vehicle_command.param1 + .5f) == vehicle_command_s::SPEED_TYPE_AIRSPEED)) {
|
|
||||||
if (vehicle_command.param2 > FLT_EPSILON) { // param2 is an equivalent airspeed setpoint
|
|
||||||
if (_control_mode_current == FW_POSCTRL_MODE_AUTO) {
|
|
||||||
_pos_sp_triplet.current.cruising_speed = vehicle_command.param2;
|
|
||||||
|
|
||||||
} else if (_control_mode_current == FW_POSCTRL_MODE_MANUAL_ALTITUDE
|
|
||||||
|| _control_mode_current == FW_POSCTRL_MODE_MANUAL_POSITION) {
|
|
||||||
_commanded_manual_airspeed_setpoint = vehicle_command.param2;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
FixedWingGuidanceControl::airspeed_poll()
|
FixedWingGuidanceControl::airspeed_poll()
|
||||||
{
|
{
|
||||||
@@ -423,7 +398,6 @@ FixedWingGuidanceControl::Run()
|
|||||||
airspeed_poll();
|
airspeed_poll();
|
||||||
manual_control_setpoint_poll();
|
manual_control_setpoint_poll();
|
||||||
vehicle_attitude_poll();
|
vehicle_attitude_poll();
|
||||||
vehicle_command_poll();
|
|
||||||
vehicle_control_mode_poll();
|
vehicle_control_mode_poll();
|
||||||
wind_poll(now);
|
wind_poll(now);
|
||||||
|
|
||||||
|
|||||||
@@ -204,22 +204,6 @@ private:
|
|||||||
|
|
||||||
uint8_t _position_sp_type{0};
|
uint8_t _position_sp_type{0};
|
||||||
|
|
||||||
enum FW_POSCTRL_MODE {
|
|
||||||
FW_POSCTRL_MODE_AUTO,
|
|
||||||
FW_POSCTRL_MODE_AUTO_ALTITUDE,
|
|
||||||
FW_POSCTRL_MODE_AUTO_CLIMBRATE,
|
|
||||||
FW_POSCTRL_MODE_AUTO_TAKEOFF,
|
|
||||||
FW_POSCTRL_MODE_AUTO_TAKEOFF_NO_NAV,
|
|
||||||
FW_POSCTRL_MODE_AUTO_LANDING_STRAIGHT,
|
|
||||||
FW_POSCTRL_MODE_AUTO_LANDING_CIRCULAR,
|
|
||||||
FW_POSCTRL_MODE_AUTO_PATH,
|
|
||||||
FW_POSCTRL_MODE_MANUAL_POSITION,
|
|
||||||
FW_POSCTRL_MODE_MANUAL_ALTITUDE,
|
|
||||||
FW_POSCTRL_MODE_TRANSITION_TO_HOVER_LINE_FOLLOW,
|
|
||||||
FW_POSCTRL_MODE_TRANSITION_TO_HOVER_HEADING_HOLD,
|
|
||||||
FW_POSCTRL_MODE_OTHER
|
|
||||||
} _control_mode_current{FW_POSCTRL_MODE_OTHER}; // used to check if the mode has changed
|
|
||||||
|
|
||||||
enum StickConfig {
|
enum StickConfig {
|
||||||
STICK_CONFIG_SWAP_STICKS_BIT = (1 << 0),
|
STICK_CONFIG_SWAP_STICKS_BIT = (1 << 0),
|
||||||
STICK_CONFIG_ENABLE_AIRSPEED_SP_MANUAL_BIT = (1 << 1)
|
STICK_CONFIG_ENABLE_AIRSPEED_SP_MANUAL_BIT = (1 << 1)
|
||||||
@@ -338,7 +322,6 @@ private:
|
|||||||
|
|
||||||
void manual_control_setpoint_poll();
|
void manual_control_setpoint_poll();
|
||||||
void vehicle_attitude_poll();
|
void vehicle_attitude_poll();
|
||||||
void vehicle_command_poll();
|
|
||||||
void vehicle_control_mode_poll();
|
void vehicle_control_mode_poll();
|
||||||
|
|
||||||
void wind_poll(const hrt_abstime now);
|
void wind_poll(const hrt_abstime now);
|
||||||
|
|||||||
@@ -373,21 +373,7 @@ FixedWingModeManager::set_control_mode_current(const hrt_abstime &now)
|
|||||||
_skipping_takeoff_detection = false;
|
_skipping_takeoff_detection = false;
|
||||||
const bool doing_backtransition = _vehicle_status.in_transition_mode && !_vehicle_status.in_transition_to_fw;
|
const bool doing_backtransition = _vehicle_status.in_transition_mode && !_vehicle_status.in_transition_to_fw;
|
||||||
|
|
||||||
if (_control_mode.flag_control_offboard_enabled && _position_setpoint_current_valid
|
if ((_control_mode.flag_control_auto_enabled && _control_mode.flag_control_position_enabled)
|
||||||
&& _control_mode.flag_control_position_enabled) {
|
|
||||||
if (PX4_ISFINITE(_pos_sp_triplet.current.vx) && PX4_ISFINITE(_pos_sp_triplet.current.vy)
|
|
||||||
&& PX4_ISFINITE(_pos_sp_triplet.current.vz)) {
|
|
||||||
// Offboard position with velocity setpoints
|
|
||||||
_control_mode_current = FW_POSCTRL_MODE_AUTO_PATH;
|
|
||||||
return;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
// Offboard position setpoint only
|
|
||||||
_control_mode_current = FW_POSCTRL_MODE_AUTO;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if ((_control_mode.flag_control_auto_enabled && _control_mode.flag_control_position_enabled)
|
|
||||||
&& _position_setpoint_current_valid) {
|
&& _position_setpoint_current_valid) {
|
||||||
|
|
||||||
// Enter this mode only if the current waypoint has valid 3D position setpoints.
|
// Enter this mode only if the current waypoint has valid 3D position setpoints.
|
||||||
@@ -2111,10 +2097,6 @@ FixedWingModeManager::Run()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case FW_POSCTRL_MODE_AUTO_PATH: {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case FW_POSCTRL_MODE_AUTO_TAKEOFF: {
|
case FW_POSCTRL_MODE_AUTO_TAKEOFF: {
|
||||||
control_auto_takeoff(now, control_interval, curr_pos, ground_speed, _pos_sp_triplet.current);
|
control_auto_takeoff(now, control_interval, curr_pos, ground_speed, _pos_sp_triplet.current);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -226,7 +226,6 @@ private:
|
|||||||
FW_POSCTRL_MODE_AUTO_TAKEOFF_NO_NAV,
|
FW_POSCTRL_MODE_AUTO_TAKEOFF_NO_NAV,
|
||||||
FW_POSCTRL_MODE_AUTO_LANDING_STRAIGHT,
|
FW_POSCTRL_MODE_AUTO_LANDING_STRAIGHT,
|
||||||
FW_POSCTRL_MODE_AUTO_LANDING_CIRCULAR,
|
FW_POSCTRL_MODE_AUTO_LANDING_CIRCULAR,
|
||||||
FW_POSCTRL_MODE_AUTO_PATH,
|
|
||||||
FW_POSCTRL_MODE_MANUAL_POSITION,
|
FW_POSCTRL_MODE_MANUAL_POSITION,
|
||||||
FW_POSCTRL_MODE_MANUAL_ALTITUDE,
|
FW_POSCTRL_MODE_MANUAL_ALTITUDE,
|
||||||
FW_POSCTRL_MODE_TRANSITION_TO_HOVER_LINE_FOLLOW,
|
FW_POSCTRL_MODE_TRANSITION_TO_HOVER_LINE_FOLLOW,
|
||||||
|
|||||||
Reference in New Issue
Block a user