mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 23:03:33 +08:00
FW auto launch: Add option to lock selected surfaces before/during launch (#25799)
* FWModeManager: add option to set flag for disabling actuators during launch Signed-off-by: Silvan <silvan@auterion.com> * Allocation: add option to each control surface to be locked for launch Signed-off-by: Silvan <silvan@auterion.com> * FW rate control: reset integral while control surfaces are locked Signed-off-by: Silvan <silvan@auterion.com> --------- Signed-off-by: Silvan <silvan@auterion.com> Co-authored-by: mahima-yoga <mahima@auterion.com>
This commit is contained in:
co-authored by
mahima-yoga
parent
fd4b958790
commit
11007dc893
@@ -287,8 +287,18 @@ void FixedwingRateControl::Run()
|
||||
_rate_control.resetIntegral();
|
||||
}
|
||||
|
||||
launch_detection_status_s launch_detection_status{};
|
||||
_launch_detection_status_sub.copy(&launch_detection_status);
|
||||
|
||||
bool control_surfaces_locked = false;
|
||||
|
||||
if (hrt_elapsed_time(&launch_detection_status.timestamp) < 100_ms
|
||||
&& launch_detection_status.selected_control_surface_disarmed) {
|
||||
control_surfaces_locked = true;
|
||||
}
|
||||
|
||||
// Reset integrators if the aircraft is on ground or not in a state where the fw attitude controller is run
|
||||
if (_landed || !_in_fw_or_transition_wo_tailsitter_transition) {
|
||||
if (_landed || !_in_fw_or_transition_wo_tailsitter_transition || control_surfaces_locked) {
|
||||
|
||||
_gain_compression.reset();
|
||||
_rate_control.resetIntegral();
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
#include <uORB/topics/vehicle_status.h>
|
||||
#include <uORB/topics/vehicle_thrust_setpoint.h>
|
||||
#include <uORB/topics/vehicle_torque_setpoint.h>
|
||||
#include <uORB/topics/launch_detection_status.h>
|
||||
|
||||
using matrix::Eulerf;
|
||||
using matrix::Quatf;
|
||||
@@ -110,6 +111,7 @@ private:
|
||||
uORB::Subscription _vehicle_land_detected_sub{ORB_ID(vehicle_land_detected)};
|
||||
uORB::Subscription _vehicle_status_sub{ORB_ID(vehicle_status)};
|
||||
uORB::Subscription _vehicle_rates_sub{ORB_ID(vehicle_angular_velocity)};
|
||||
uORB::Subscription _launch_detection_status_sub{ORB_ID(launch_detection_status)};
|
||||
|
||||
uORB::SubscriptionMultiArray<control_allocator_status_s, 2> _control_allocator_status_subs{ORB_ID::control_allocator_status};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user