PX4 Firmware
PX4 Autopilot Software http://px4.io
Tiltrotor Class Reference

#include <tiltrotor.h>

Inheritance diagram for Tiltrotor:
Collaboration diagram for Tiltrotor:

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
 
VtolTypeoperator= (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...
 

Additional Inherited Members

- Protected Member Functions inherited from VtolType
bool set_idle_mc ()
 Sets mc motor minimum pwm to VT_IDLE_PWM_MC which ensures that they are spinning in mc mode. More...
 
bool set_idle_fw ()
 Sets mc motor minimum pwm to PWM_MIN which ensures that the motors stop spinning on zero throttle in fw mode. More...
 
motor_state set_motor_state (const motor_state current_state, const motor_state next_state, const int value=0)
 Sets state of a selection of motors, see struct motor_state. More...
 
- Protected Attributes inherited from VtolType
VtolAttitudeControl_attc
 
mode _vtol_mode
 
struct vehicle_attitude_s_v_att
 
struct vehicle_attitude_setpoint_s_v_att_sp
 
struct vehicle_attitude_setpoint_s_mc_virtual_att_sp
 
struct vehicle_attitude_setpoint_s_fw_virtual_att_sp
 
struct vehicle_control_mode_s_v_control_mode
 
struct vtol_vehicle_status_s_vtol_vehicle_status
 
struct actuator_controls_s_actuators_out_0
 
struct actuator_controls_s_actuators_out_1
 
struct actuator_controls_s_actuators_mc_in
 
struct actuator_controls_s_actuators_fw_in
 
struct vehicle_local_position_s_local_pos
 
struct vehicle_local_position_setpoint_s_local_pos_sp
 
struct airspeed_validated_s_airspeed_validated
 
struct tecs_status_s_tecs_status
 
struct vehicle_land_detected_s_land_detected
 
struct Params_params
 
bool flag_idle_mc = false
 
bool _pusher_active = false
 
float _mc_roll_weight = 1.0f
 
float _mc_pitch_weight = 1.0f
 
float _mc_yaw_weight = 1.0f
 
float _mc_throttle_weight = 1.0f
 
float _thrust_transition = 0.0f
 
float _ra_hrate = 0.0f
 
float _ra_hrate_sp = 0.0f
 
bool _flag_was_in_trans_mode = false
 
hrt_abstime _trans_finished_ts = 0
 
bool _tecs_running = false
 
hrt_abstime _tecs_running_ts = 0
 
motor_state _motor_state = motor_state::DISABLED
 
- Static Protected Attributes inherited from VtolType
static constexpr const int num_outputs_max = 8
 

Detailed Description

Definition at line 47 of file tiltrotor.h.

Member Enumeration Documentation

◆ vtol_mode

enum Tiltrotor::vtol_mode
strongprivate
Enumerator
MC_MODE 

vtol is in multicopter mode

TRANSITION_FRONT_P1 

vtol is in front transition part 1 mode

TRANSITION_FRONT_P2 

vtol is in front transition part 2 mode

TRANSITION_BACK 

vtol is in back transition mode

FW_MODE 

vtol is in fixed wing mode

Definition at line 78 of file tiltrotor.h.

Constructor & Destructor Documentation

◆ Tiltrotor()

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().

Here is the call graph for this function:

◆ ~Tiltrotor()

Tiltrotor::~Tiltrotor ( )
overridedefault

Member Function Documentation

◆ fill_actuator_outputs()

void Tiltrotor::fill_actuator_outputs ( )
overridevirtual

◆ parameters_update()

void Tiltrotor::parameters_update ( )
overrideprivatevirtual

Implements VtolType.

Definition at line 66 of file tiltrotor.cpp.

References _params_handles_tiltrotor, _params_tiltrotor, and param_get().

Here is the call graph for this function:

◆ update_fw_state()

void Tiltrotor::update_fw_state ( )
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().

Here is the call graph for this function:

◆ update_mc_state()

void Tiltrotor::update_mc_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().

Here is the call graph for this function:

◆ update_transition_state()

◆ update_vtol_state()

◆ waiting_on_tecs()

void Tiltrotor::waiting_on_tecs ( )
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.

Member Data Documentation

◆ _params_handles_tiltrotor

struct { ... } Tiltrotor::_params_handles_tiltrotor

Referenced by parameters_update(), and Tiltrotor().

◆ _params_tiltrotor

struct { ... } Tiltrotor::_params_tiltrotor

◆ _tilt_control

float Tiltrotor::_tilt_control {0.0f}
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().

◆ _vtol_schedule

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().

◆ flight_mode

vtol_mode Tiltrotor::flight_mode

vtol flight mode, defined by enum vtol_mode

Definition at line 94 of file tiltrotor.h.

◆ front_trans_dur_p2 [1/2]

float Tiltrotor::front_trans_dur_p2

Definition at line 68 of file tiltrotor.h.

◆ front_trans_dur_p2 [2/2]

param_t Tiltrotor::front_trans_dur_p2

Definition at line 75 of file tiltrotor.h.

◆ tilt_fw [1/2]

float Tiltrotor::tilt_fw

actuator value corresponding to fw tilt

Definition at line 67 of file tiltrotor.h.

◆ tilt_fw [2/2]

param_t Tiltrotor::tilt_fw

Definition at line 74 of file tiltrotor.h.

◆ tilt_mc [1/2]

float Tiltrotor::tilt_mc

actuator value corresponding to mc tilt

Definition at line 65 of file tiltrotor.h.

◆ tilt_mc [2/2]

param_t Tiltrotor::tilt_mc

Definition at line 72 of file tiltrotor.h.

◆ tilt_transition [1/2]

float Tiltrotor::tilt_transition

actuator value corresponding to transition tilt (e.g 45 degrees)

Definition at line 66 of file tiltrotor.h.

◆ tilt_transition [2/2]

param_t Tiltrotor::tilt_transition

Definition at line 73 of file tiltrotor.h.

◆ transition_start

hrt_abstime Tiltrotor::transition_start

absoulte time at which front transition started

Definition at line 95 of file tiltrotor.h.


The documentation for this class was generated from the following files: