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

#include <standard.h>

Inheritance diagram for Standard:
Collaboration diagram for Standard:

Public Member Functions

 Standard (VtolAttitudeControl *_att_controller)
 
 ~Standard () 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 update_mc_state () override
 Update multicopter state. More...
 
void fill_actuator_outputs () override
 Prepare message to acutators with data from mc and fw attitude controllers. 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_TO_FW, vtol_mode::TRANSITION_TO_MC, vtol_mode::FW_MODE }
 

Private Member Functions

void parameters_update () override
 

Private Attributes

struct {
   float   pusher_ramp_dt
 
   float   back_trans_ramp
 
   float   down_pitch_max
 
   float   forward_thrust_scale
 
   float   pitch_setpoint_offset
 
   float   reverse_output
 
   float   reverse_delay
 
_params_standard
 
struct {
   param_t   pusher_ramp_dt
 
   param_t   back_trans_ramp
 
   param_t   down_pitch_max
 
   param_t   forward_thrust_scale
 
   param_t   pitch_setpoint_offset
 
   param_t   reverse_output
 
   param_t   reverse_delay
 
_params_handles_standard
 
struct {
   vtol_mode   flight_mode
 
   hrt_abstime   transition_start
 
_vtol_schedule
 
float _pusher_throttle {0.0f}
 
float _reverse_output {0.0f}
 
float _airspeed_trans_blend_margin {0.0f}
 

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 52 of file standard.h.

Member Enumeration Documentation

◆ vtol_mode

enum Standard::vtol_mode
strongprivate
Enumerator
MC_MODE 
TRANSITION_TO_FW 
TRANSITION_TO_MC 
FW_MODE 

Definition at line 89 of file standard.h.

Constructor & Destructor Documentation

◆ Standard()

Standard::Standard ( VtolAttitudeControl _att_controller)

Definition at line 51 of file standard.cpp.

References VtolType::_mc_pitch_weight, VtolType::_mc_roll_weight, VtolType::_mc_throttle_weight, VtolType::_mc_yaw_weight, _params_handles_standard, VtolType::_pusher_active, _vtol_schedule, MC_MODE, and param_find().

Here is the call graph for this function:

◆ ~Standard()

Standard::~Standard ( )
overridedefault

Member Function Documentation

◆ fill_actuator_outputs()

void Standard::fill_actuator_outputs ( )
overridevirtual

Prepare message to acutators with data from mc and fw attitude controllers.

An mc attitude weighting will determine what proportion of control should be applied to each of the control groups (mc and fw).

Implements VtolType.

Definition at line 409 of file standard.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, _pusher_throttle, _reverse_output, _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.

Here is the call graph for this function:

◆ parameters_update()

void Standard::parameters_update ( )
overrideprivatevirtual

Implements VtolType.

Definition at line 73 of file standard.cpp.

References _airspeed_trans_blend_margin, VtolType::_params, _params_handles_standard, _params_standard, Params::airspeed_blend, Params::back_trans_duration, math::constrain(), f(), param_get(), math::radians(), and Params::transition_airspeed.

Here is the call graph for this function:

◆ update_fw_state()

void Standard::update_fw_state ( )
overridevirtual

Update fixed wing state.

Reimplemented from VtolType.

Definition at line 400 of file standard.cpp.

References VtolType::update_fw_state().

Here is the call graph for this function:

◆ update_mc_state()

◆ update_transition_state()

◆ update_vtol_state()

◆ waiting_on_tecs()

void Standard::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 486 of file standard.cpp.

References _pusher_throttle, VtolType::_v_att_sp, and vehicle_attitude_setpoint_s::thrust_body.

Member Data Documentation

◆ _airspeed_trans_blend_margin

float Standard::_airspeed_trans_blend_margin {0.0f}
private

Definition at line 103 of file standard.h.

Referenced by parameters_update(), and update_transition_state().

◆ _params_handles_standard

struct { ... } Standard::_params_handles_standard

Referenced by parameters_update(), and Standard().

◆ _params_standard

struct { ... } Standard::_params_standard

◆ _pusher_throttle

float Standard::_pusher_throttle {0.0f}
private

◆ _reverse_output

float Standard::_reverse_output {0.0f}
private

Definition at line 102 of file standard.h.

Referenced by fill_actuator_outputs(), and update_vtol_state().

◆ _vtol_schedule

struct { ... } Standard::_vtol_schedule

◆ back_trans_ramp [1/2]

float Standard::back_trans_ramp

Definition at line 71 of file standard.h.

◆ back_trans_ramp [2/2]

param_t Standard::back_trans_ramp

Definition at line 81 of file standard.h.

◆ down_pitch_max [1/2]

float Standard::down_pitch_max

Definition at line 72 of file standard.h.

◆ down_pitch_max [2/2]

param_t Standard::down_pitch_max

Definition at line 82 of file standard.h.

◆ flight_mode

vtol_mode Standard::flight_mode

Definition at line 97 of file standard.h.

◆ forward_thrust_scale [1/2]

float Standard::forward_thrust_scale

Definition at line 73 of file standard.h.

◆ forward_thrust_scale [2/2]

param_t Standard::forward_thrust_scale

Definition at line 83 of file standard.h.

◆ pitch_setpoint_offset [1/2]

float Standard::pitch_setpoint_offset

Definition at line 74 of file standard.h.

◆ pitch_setpoint_offset [2/2]

param_t Standard::pitch_setpoint_offset

Definition at line 84 of file standard.h.

◆ pusher_ramp_dt [1/2]

float Standard::pusher_ramp_dt

Definition at line 70 of file standard.h.

◆ pusher_ramp_dt [2/2]

param_t Standard::pusher_ramp_dt

Definition at line 80 of file standard.h.

◆ reverse_delay [1/2]

float Standard::reverse_delay

Definition at line 76 of file standard.h.

◆ reverse_delay [2/2]

param_t Standard::reverse_delay

Definition at line 86 of file standard.h.

◆ reverse_output [1/2]

float Standard::reverse_output

Definition at line 75 of file standard.h.

◆ reverse_output [2/2]

param_t Standard::reverse_output

Definition at line 85 of file standard.h.

◆ transition_start

hrt_abstime Standard::transition_start

Definition at line 98 of file standard.h.


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