PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <tiltrotor.h>
Public Member Functions | |
Tiltrotor (VtolAttitudeControl *_att_controller) | |
~Tiltrotor () override=default | |
void | update_vtol_state () override |
Update vtol state. More... | |
void | update_transition_state () override |
Update transition state. More... | |
void | fill_actuator_outputs () override |
Write data to actuator output topic. More... | |
void | update_mc_state () override |
Update multicopter state. More... | |
void | update_fw_state () override |
Update fixed wing state. 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... | |
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_FRONT_P2, vtol_mode::TRANSITION_BACK, vtol_mode::FW_MODE } |
Private Member Functions | |
void | parameters_update () override |
Private Attributes | |
struct { | |
float tilt_mc | |
actuator value corresponding to mc tilt More... | |
float tilt_transition | |
actuator value corresponding to transition tilt (e.g 45 degrees) More... | |
float tilt_fw | |
actuator value corresponding to fw tilt More... | |
float front_trans_dur_p2 | |
} | _params_tiltrotor |
struct { | |
param_t tilt_mc | |
param_t tilt_transition | |
param_t tilt_fw | |
param_t front_trans_dur_p2 | |
} | _params_handles_tiltrotor |
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 |
Specific to tiltrotor with vertical aligned rear engine/s. More... | |
float | _tilt_control {0.0f} |
actuator value for the tilt servo More... | |
Definition at line 47 of file tiltrotor.h.
|
strongprivate |
Definition at line 78 of file tiltrotor.h.
Tiltrotor::Tiltrotor | ( | VtolAttitudeControl * | _att_controller | ) |
Definition at line 47 of file tiltrotor.cpp.
References VtolType::_flag_was_in_trans_mode, VtolType::_mc_pitch_weight, VtolType::_mc_roll_weight, VtolType::_mc_yaw_weight, _params_handles_tiltrotor, _vtol_schedule, MC_MODE, and param_find().
|
overridedefault |
|
overridevirtual |
Write data to actuator output topic.
Implements VtolType.
Definition at line 342 of file tiltrotor.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_throttle_weight, VtolType::_mc_yaw_weight, VtolType::_params, _tilt_control, _vtol_schedule, actuator_controls_s::control, Params::diff_thrust, Params::diff_thrust_scale, 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 66 of file tiltrotor.cpp.
References _params_handles_tiltrotor, _params_tiltrotor, and param_get().
|
overridevirtual |
Update fixed wing state.
Reimplemented from VtolType.
Definition at line 214 of file tiltrotor.cpp.
References _params_tiltrotor, _tilt_control, and VtolType::update_fw_state().
|
overridevirtual |
Update multicopter state.
Reimplemented from VtolType.
Definition at line 206 of file tiltrotor.cpp.
References _params_tiltrotor, _tilt_control, and VtolType::update_mc_state().
|
overridevirtual |
Update transition state.
Implements VtolType.
Definition at line 222 of file tiltrotor.cpp.
References VtolType::_airspeed_validated, VtolType::_flag_was_in_trans_mode, VtolType::_mc_pitch_weight, VtolType::_mc_roll_weight, VtolType::_mc_throttle_weight, VtolType::_mc_virtual_att_sp, VtolType::_mc_yaw_weight, VtolType::_motor_state, VtolType::_params, _params_tiltrotor, VtolType::_thrust_transition, _tilt_control, VtolType::_v_att_sp, _vtol_schedule, Params::airspeed_blend, Params::airspeed_disabled, ARSP_YAW_CTRL_DISABLE, math::constrain(), ENABLED, airspeed_validated_s::equivalent_airspeed_m_s, f(), VtolType::flag_idle_mc, Params::front_trans_duration, Params::front_trans_time_min, Params::front_trans_time_openloop, hrt_absolute_time(), PWM_DEFAULT_MAX, PWM_DEFAULT_MIN, VtolType::set_idle_mc(), VtolType::set_motor_state(), vehicle_attitude_setpoint_s::thrust_body, Params::transition_airspeed, TRANSITION_BACK, TRANSITION_FRONT_P1, TRANSITION_FRONT_P2, VtolType::update_transition_state(), and VALUE.
|
overridevirtual |
Update vtol state.
Implements VtolType.
Definition at line 87 of file tiltrotor.cpp.
References VtolType::_airspeed_validated, VtolType::_attc, VtolType::_params, _params_tiltrotor, _tilt_control, VtolType::_vtol_mode, _vtol_schedule, Params::airspeed_disabled, Params::back_trans_duration, VtolType::can_transition_on_ground(), airspeed_validated_s::equivalent_airspeed_m_s, f(), FIXED_WING, Params::front_trans_time_min, Params::front_trans_time_openloop, FW_MODE, hrt_absolute_time(), VtolAttitudeControl::is_fixed_wing_requested(), MC_MODE, ROTARY_WING, Params::transition_airspeed, TRANSITION_BACK, TRANSITION_FRONT_P1, TRANSITION_FRONT_P2, TRANSITION_TO_FW, and TRANSITION_TO_MC.
|
overridevirtual |
Special handling opportunity for the time right after transition to FW before TECS is running.
Reimplemented from VtolType.
Definition at line 333 of file tiltrotor.cpp.
References VtolType::_thrust_transition, VtolType::_v_att_sp, and vehicle_attitude_setpoint_s::thrust_body.
struct { ... } Tiltrotor::_params_handles_tiltrotor |
Referenced by parameters_update(), and Tiltrotor().
struct { ... } Tiltrotor::_params_tiltrotor |
Referenced by parameters_update(), update_fw_state(), update_mc_state(), update_transition_state(), and update_vtol_state().
|
private |
actuator value for the tilt servo
Definition at line 98 of file tiltrotor.h.
Referenced by fill_actuator_outputs(), update_fw_state(), update_mc_state(), update_transition_state(), and update_vtol_state().
struct { ... } Tiltrotor::_vtol_schedule |
Specific to tiltrotor with vertical aligned rear engine/s.
These engines need to be shut down in fw mode. During the back-transition they need to idle otherwise they need too much time to spin up for mc mode.
Referenced by fill_actuator_outputs(), Tiltrotor(), update_transition_state(), and update_vtol_state().
vtol_mode Tiltrotor::flight_mode |
vtol flight mode, defined by enum vtol_mode
Definition at line 94 of file tiltrotor.h.
float Tiltrotor::front_trans_dur_p2 |
Definition at line 68 of file tiltrotor.h.
param_t Tiltrotor::front_trans_dur_p2 |
Definition at line 75 of file tiltrotor.h.
float Tiltrotor::tilt_fw |
actuator value corresponding to fw tilt
Definition at line 67 of file tiltrotor.h.
param_t Tiltrotor::tilt_fw |
Definition at line 74 of file tiltrotor.h.
float Tiltrotor::tilt_mc |
actuator value corresponding to mc tilt
Definition at line 65 of file tiltrotor.h.
param_t Tiltrotor::tilt_mc |
Definition at line 72 of file tiltrotor.h.
float Tiltrotor::tilt_transition |
actuator value corresponding to transition tilt (e.g 45 degrees)
Definition at line 66 of file tiltrotor.h.
param_t Tiltrotor::tilt_transition |
Definition at line 73 of file tiltrotor.h.
hrt_abstime Tiltrotor::transition_start |
absoulte time at which front transition started
Definition at line 95 of file tiltrotor.h.