PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <tailsitter.h>
Public Member Functions | |
Tailsitter (VtolAttitudeControl *_att_controller) | |
~Tailsitter () override=default | |
void | update_vtol_state () override |
Update vtol state. More... | |
void | update_transition_state () override |
Update transition state. More... | |
void | update_fw_state () override |
Update fixed wing state. More... | |
void | fill_actuator_outputs () override |
Write data to actuator output topic. More... | |
void | waiting_on_tecs () override |
Special handling opportunity for the time right after transition to FW before TECS is running. More... | |
Public Member Functions inherited from VtolType | |
VtolType (VtolAttitudeControl *att_controller) | |
VtolType (const VtolType &)=delete | |
VtolType & | operator= (const VtolType &)=delete |
virtual | ~VtolType ()=default |
bool | init () |
Initialise. More... | |
virtual void | update_mc_state () |
Update multicopter state. More... | |
void | check_quadchute_condition () |
Checks for fixed-wing failsafe condition and issues abort request if needed. More... | |
bool | can_transition_on_ground () |
Returns true if we're allowed to do a mode transition on the ground. More... | |
mode | get_mode () |
Private Types | |
enum | vtol_mode { vtol_mode::MC_MODE = 0, vtol_mode::TRANSITION_FRONT_P1, vtol_mode::TRANSITION_BACK, vtol_mode::FW_MODE } |
Private Member Functions | |
void | parameters_update () override |
Private Attributes | |
struct { | |
float front_trans_dur_p2 | |
float fw_pitch_sp_offset | |
} | _params_tailsitter |
struct { | |
param_t front_trans_dur_p2 | |
param_t fw_pitch_sp_offset | |
} | _params_handles_tailsitter |
struct { | |
vtol_mode flight_mode | |
vtol flight mode, defined by enum vtol_mode More... | |
hrt_abstime transition_start | |
absoulte time at which front transition started More... | |
} | _vtol_schedule |
matrix::Quatf | _q_trans_start |
matrix::Quatf | _q_trans_sp |
matrix::Vector3f | _trans_rot_axis |
Definition at line 51 of file tailsitter.h.
|
strongprivate |
Enumerator | |
---|---|
MC_MODE | vtol is in multicopter mode |
TRANSITION_FRONT_P1 | vtol is in front transition part 1 mode |
TRANSITION_BACK | vtol is in back transition mode |
FW_MODE | vtol is in fixed wing mode |
Definition at line 76 of file tailsitter.h.
Tailsitter::Tailsitter | ( | VtolAttitudeControl * | _att_controller | ) |
Definition at line 52 of file tailsitter.cpp.
References VtolType::_flag_was_in_trans_mode, VtolType::_mc_pitch_weight, VtolType::_mc_roll_weight, VtolType::_mc_yaw_weight, _params_handles_tailsitter, _vtol_schedule, MC_MODE, and param_find().
|
overridedefault |
|
overridevirtual |
Write data to actuator output topic.
Implements VtolType.
Definition at line 287 of file tailsitter.cpp.
References VtolType::_actuators_fw_in, VtolType::_actuators_mc_in, VtolType::_actuators_out_0, VtolType::_actuators_out_1, VtolType::_mc_pitch_weight, VtolType::_mc_roll_weight, VtolType::_mc_yaw_weight, VtolType::_params, _vtol_schedule, actuator_controls_s::control, Params::elevons_mc_lock, FW_MODE, hrt_absolute_time(), MC_MODE, actuator_controls_s::timestamp, and actuator_controls_s::timestamp_sample.
|
overrideprivatevirtual |
Implements VtolType.
Definition at line 69 of file tailsitter.cpp.
References _params_handles_tailsitter, _params_tailsitter, param_get(), and math::radians().
|
overridevirtual |
Update fixed wing state.
Reimplemented from VtolType.
Definition at line 273 of file tailsitter.cpp.
References VtolType::_mc_roll_weight, VtolType::_params, Params::diff_thrust, and VtolType::update_fw_state().
|
overridevirtual |
Update transition state.
Implements VtolType.
Definition at line 189 of file tailsitter.cpp.
References VtolType::_flag_was_in_trans_mode, VtolType::_fw_virtual_att_sp, VtolType::_mc_pitch_weight, VtolType::_mc_roll_weight, VtolType::_mc_virtual_att_sp, VtolType::_mc_yaw_weight, VtolType::_params, _params_tailsitter, _q_trans_sp, _q_trans_start, _trans_rot_axis, VtolType::_v_att, VtolType::_v_att_sp, _vtol_schedule, Params::back_trans_duration, matrix::Matrix< Type, M, N >::copyTo(), matrix::Vector3< Type >::cross(), matrix::Quaternion< Type >::dcm_z(), f(), VtolType::flag_idle_mc, Params::front_trans_duration, hrt_absolute_time(), matrix::Euler< Type >::phi(), vehicle_attitude_setpoint_s::pitch_body, matrix::Euler< Type >::psi(), vehicle_attitude_s::q, vehicle_attitude_setpoint_s::q_d, vehicle_attitude_setpoint_s::q_d_valid, vehicle_attitude_setpoint_s::roll_body, VtolType::set_idle_mc(), matrix::Euler< Type >::theta(), vehicle_attitude_setpoint_s::thrust_body, vehicle_attitude_setpoint_s::timestamp, TRANSITION_BACK, TRANSITION_FRONT_P1, and vehicle_attitude_setpoint_s::yaw_body.
|
overridevirtual |
Update vtol state.
Implements VtolType.
Definition at line 81 of file tailsitter.cpp.
References VtolType::_airspeed_validated, VtolType::_attc, VtolType::_flag_was_in_trans_mode, VtolType::_params, VtolType::_v_att, VtolType::_vtol_mode, _vtol_schedule, VtolType::_vtol_vehicle_status, Params::airspeed_disabled, Params::back_trans_duration, VtolType::can_transition_on_ground(), airspeed_validated_s::equivalent_airspeed_m_s, f(), FIXED_WING, FW_MODE, hrt_absolute_time(), VtolAttitudeControl::is_fixed_wing_requested(), MC_MODE, PITCH_TRANSITION_BACK, PITCH_TRANSITION_FRONT_P1, vehicle_attitude_s::q, ROTARY_WING, Params::transition_airspeed, TRANSITION_BACK, TRANSITION_FRONT_P1, TRANSITION_TO_FW, TRANSITION_TO_MC, and vtol_vehicle_status_s::vtol_in_trans_mode.
|
overridevirtual |
Special handling opportunity for the time right after transition to FW before TECS is running.
Reimplemented from VtolType.
Definition at line 267 of file tailsitter.cpp.
References VtolType::_thrust_transition, VtolType::_v_att_sp, and vehicle_attitude_setpoint_s::thrust_body.
struct { ... } Tailsitter::_params_handles_tailsitter |
Referenced by parameters_update(), and Tailsitter().
struct { ... } Tailsitter::_params_tailsitter |
Referenced by parameters_update(), and update_transition_state().
|
private |
Definition at line 89 of file tailsitter.h.
Referenced by update_transition_state().
|
private |
Definition at line 88 of file tailsitter.h.
Referenced by update_transition_state().
|
private |
Definition at line 90 of file tailsitter.h.
Referenced by update_transition_state().
struct { ... } Tailsitter::_vtol_schedule |
Referenced by fill_actuator_outputs(), Tailsitter(), update_transition_state(), and update_vtol_state().
vtol_mode Tailsitter::flight_mode |
vtol flight mode, defined by enum vtol_mode
Definition at line 84 of file tailsitter.h.
float Tailsitter::front_trans_dur_p2 |
Definition at line 67 of file tailsitter.h.
param_t Tailsitter::front_trans_dur_p2 |
Definition at line 72 of file tailsitter.h.
float Tailsitter::fw_pitch_sp_offset |
Definition at line 68 of file tailsitter.h.
param_t Tailsitter::fw_pitch_sp_offset |
Definition at line 73 of file tailsitter.h.
hrt_abstime Tailsitter::transition_start |
absoulte time at which front transition started
Definition at line 85 of file tailsitter.h.