48 #ifndef FIXEDWINGPOSITIONCONTROL_HPP_ 49 #define FIXEDWINGPOSITIONCONTROL_HPP_ 63 #include <px4_platform_common/px4_config.h> 64 #include <px4_platform_common/defines.h> 65 #include <px4_platform_common/module.h> 66 #include <px4_platform_common/module_params.h> 67 #include <px4_platform_common/posix.h> 68 #include <px4_platform_common/px4_work_queue/WorkItem.hpp> 136 static int task_spawn(
int argc,
char *argv[]);
139 static int custom_command(
int argc,
char *argv[]);
142 static int print_usage(
const char *reason =
nullptr);
191 float _hold_alt{0.0f};
192 float _takeoff_ground_alt{0.0f};
193 float _hdg_hold_yaw{0.0f};
194 bool _hdg_hold_enabled{
false};
195 bool _yaw_lock_engaged{
false};
196 float _althold_epv{0.0f};
197 bool _was_in_deadband{
false};
205 bool _land_noreturn_horizontal{
false};
206 bool _land_noreturn_vertical{
false};
207 bool _land_stayonground{
false};
208 bool _land_motor_lim{
false};
209 bool _land_onslope{
false};
210 bool _land_abort{
false};
216 float _t_alt_prev_valid{0};
219 float _flare_height{0.0f};
220 float _flare_pitch_sp{0.0f};
221 float _flare_curve_alt_rel_last{0.0f};
222 float _target_bearing{0.0f};
224 bool _was_in_air{
false};
234 bool _last_manual{
false};
237 bool _airspeed_valid{
false};
239 float _airspeed{0.0f};
240 float _eas2tas{1.0f};
242 float _groundspeed_undershoot{0.0f};
249 bool _reinitialize_tecs{
true};
250 bool _is_tecs_running{
false};
253 float _asp_after_transition{0.0f};
254 bool _was_in_transition{
false};
257 uint8_t _pos_reset_counter{0};
258 uint8_t _alt_reset_counter{0};
267 FW_POSCTRL_MODE_OTHER
268 } _control_mode_current{FW_POSCTRL_MODE_OTHER};
378 (ParamFloat<px4::params::FW_GND_SPD_MIN>) _groundspeed_min
385 void airspeed_poll();
386 void control_update();
387 void vehicle_attitude_poll();
388 void vehicle_command_poll();
389 void vehicle_control_mode_poll();
390 void vehicle_status_poll();
392 void status_publish();
393 void landing_status_publish();
394 void tecs_status_publish();
396 void abort_landing(
bool abort);
417 bool in_takeoff_situation();
424 void do_takeoff_help(
float *hold_altitude,
float *pitch_limit_min);
432 bool update_desired_altitude(
float dt);
441 float get_tecs_pitch();
442 float get_tecs_thrust();
444 float get_demanded_airspeed();
445 float calculate_target_airspeed(
float airspeed_demand,
const Vector2f &ground_speed);
450 void handle_command();
452 void reset_takeoff_state(
bool force =
false);
453 void reset_landing_state();
458 void tecs_update_pitch_throttle(
float alt_sp,
float airspeed_sp,
459 float pitch_min_rad,
float pitch_max_rad,
460 float throttle_min,
float throttle_max,
float throttle_cruise,
461 bool climbout_mode,
float climbout_pitch_min_rad,
462 uint8_t
mode = tecs_status_s::TECS_MODE_NORMAL);
466 #endif // FIXEDWINGPOSITIONCONTROL_HPP_
int32_t land_early_config_change
constexpr _Tp constrain(_Tp val, _Tp min_val, _Tp max_val)
param_t airspeed_disabled
param_t land_airspeed_scale
struct uart_esc::@19 _parameter_handles
param_t land_throtTC_scale
API for the uORB lightweight object broker.
Definition of geo / math functions to perform geodesic calculations.
L1 Nonlinear Guidance Logic.
static constexpr float THROTTLE_THRESH
max throttle from user which will not lead to motors spinning up in altitude controlled modes ...
param_t land_heading_hold_horizontal_distance
No launch has been detected.
Dcmf _R_nb
current attitude
param_t land_flare_pitch_min_deg
param_t vertical_accel_limit
perf_counter_t _loop_perf
loop performance counter
static constexpr float HDG_HOLD_REACHED_DIST
param_t land_use_terrain_estimate
float land_heading_hold_horizontal_distance
static constexpr float MANUAL_THROTTLE_CLIMBOUT_THRESH
a throttle / pitch input above this value leads to the system switching to climbout mode ...
float land_flare_pitch_max_deg
static void print_usage()
static constexpr float HDG_HOLD_SET_BACK_DIST
param_t throttle_land_max
param_t land_early_config_change
High-resolution timer with callouts and timekeeping.
param_t height_comp_filter_omega
Implementation of L1 position control.
#define ORB_ID(_name)
Generates a pointer to the uORB metadata structure for a given topic.
int32_t land_use_terrain_estimate
param_t land_flare_alt_relative
static void parameters_update()
update all parameters
void init()
Activates/configures the hardware registers.
param_t roll_throttle_compensation
Runway takeoff handling for fixed-wing UAVs with steerable wheels.
static constexpr float ALTHOLD_EPV_RESET_THRESH
param_t throttle_slew_max
static constexpr float HDG_HOLD_YAWRATE_THRESH
Landingslope _landingslope
constexpr T radians(T degrees)
float land_flare_pitch_min_deg
Vector2< float > Vector2f
Auto Detection for different launch methods (e.g.
ECL_L1_Pos_Controller _l1_control
param_t land_thrust_lim_alt_relative
param_t speed_comp_filter_omega
__BEGIN_DECLS typedef uint64_t hrt_abstime
Absolute time, in microsecond units.
__BEGIN_DECLS typedef void * orb_advert_t
ORB topic advertiser handle.
constexpr _Tp min(_Tp a, _Tp b)
Type wrap_pi(Type x)
Wrap value in range [-π, π)
param_t pitchsp_offset_deg
Vector3< float > Vector3f
static constexpr float HDG_HOLD_DIST_NEXT
struct uart_esc::@18 _parameters
param_t throttle_alt_scale
constexpr _Tp max(_Tp a, _Tp b)
Quaternion< float > Quatf
static constexpr hrt_abstime T_ALT_TIMEOUT
static constexpr float HDG_HOLD_MAN_INPUT_THRESH
param_t roll_slew_deg_sec
param_t man_pitch_max_deg
LaunchDetector _launchDetector
float land_airspeed_scale
RunwayTakeoff _runway_takeoff
param_t land_flare_pitch_max_deg
uint32_t param_t
Parameter handle.
Performance measuring tools.
int32_t airspeed_disabled
param_t rollsp_offset_deg