46 #include <px4_platform_common/defines.h> 51 _attc(att_controller),
86 PX4_ERR(
"can't open %s", dev);
94 PX4_ERR(
"failed getting max values");
102 PX4_ERR(
"failed getting min values");
110 PX4_ERR(
"failed getting disarmed values");
221 if (height_error && height_rate_error) {
252 pwm_values.
values[i] = pwm_value;
288 PX4_WARN(
"can't open %s", dev);
305 PX4_DEBUG(
"failed setting max values");
322 switch (next_state) {
348 pwm_values.
values[i] = value;
359 return current_state;
365 int channel_bitmap = 0;
368 int channels = target;
378 channel_bitmap |= 1 << (tmp - 1);
379 channels = channels / 10;
382 return (channel_bitmap >> channel) & 1;
#define PWM_DEFAULT_MAX
Default maximum PWM in us.
hrt_abstime _trans_finished_ts
struct vehicle_attitude_setpoint_s * get_mc_virtual_att_sp()
struct vehicle_local_position_setpoint_s * _local_pos_sp
bool is_channel_set(const int channel, const int target)
Determines if channel is set in target.
VtolType(VtolAttitudeControl *att_controller)
int32_t fw_motors_off
bitmask of all motors that should be off in fixed wing mode
bool set_idle_fw()
Sets mc motor minimum pwm to PWM_MIN which ensures that the motors stop spinning on zero throttle in ...
struct actuator_controls_s * _actuators_mc_in
#define PWM_SERVO_GET_DISARMED_PWM
get the PWM value when disarmed
struct tecs_status_s * _tecs_status
struct vehicle_attitude_s * _v_att
struct vehicle_attitude_setpoint_s * get_fw_virtual_att_sp()
struct vehicle_land_detected_s * get_land_detected()
VtolAttitudeControl * _attc
struct vehicle_local_position_s * get_local_pos()
struct actuator_controls_s * _actuators_out_0
hrt_abstime _tecs_running_ts
#define PWM_OUTPUT0_DEVICE_PATH
uint16_t values[PWM_OUTPUT_MAX_CHANNELS]
struct vehicle_local_position_setpoint_s * get_local_pos_sp()
struct vehicle_local_position_s * _local_pos
virtual void update_fw_state()
Update fixed wing state.
struct actuator_controls_s * _actuators_fw_in
float _mc_throttle_weight
struct vehicle_attitude_setpoint_s * _v_att_sp
constexpr T radians(T degrees)
Vector< float, 6 > f(float t, const Matrix< float, 6, 1 > &, const Matrix< float, 3, 1 > &)
pwm_limit_type
Used to specify if min or max pwm values should be altered.
bool apply_pwm_limits(struct pwm_output_values &pwm_values, pwm_limit_type type)
Adjust minimum/maximum pwm values for the output channels.
static constexpr const int num_outputs_max
struct vehicle_attitude_setpoint_s * get_att_sp()
struct vehicle_attitude_setpoint_s * _mc_virtual_att_sp
bool set_idle_mc()
Sets mc motor minimum pwm to VT_IDLE_PWM_MC which ensures that they are spinning in mc mode...
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.
struct vehicle_attitude_setpoint_s * _fw_virtual_att_sp
struct vtol_vehicle_status_s * get_vtol_vehicle_status()
#define PWM_SERVO_SET_MIN_PWM
set the minimum PWM value the output will send
struct actuator_controls_s * get_actuators_out1()
bool flag_control_altitude_enabled
struct actuator_controls_s * get_actuators_mc_in()
struct vehicle_control_mode_s * get_control_mode()
struct vehicle_control_mode_s * _v_control_mode
struct Params * get_params()
#define PWM_SERVO_SET_MAX_PWM
set the maximum PWM value the output will send
struct actuator_controls_s * get_actuators_out0()
struct actuator_controls_s * get_actuators_fw_in()
void check_quadchute_condition()
Checks for fixed-wing failsafe condition and issues abort request if needed.
Quaternion< float > Quatf
#define PWM_SERVO_GET_MIN_PWM
get the minimum PWM value the output will send
virtual void update_mc_state()
Update multicopter state.
float height_rate_setpoint
struct vehicle_attitude_s * get_att()
struct airspeed_validated_s * _airspeed_validated
virtual void update_transition_state()=0
Update transition state.
struct tecs_status_s * get_tecs_status()
#define PWM_MOTOR_OFF
Default value for a shutdown motor.
struct actuator_controls_s * _actuators_out_1
Stores the max pwm values given by the system.
struct vehicle_land_detected_s * _land_detected
void abort_front_transition(const char *reason)
struct vtol_vehicle_status_s * _vtol_vehicle_status
bool can_transition_on_ground()
Returns true if we're allowed to do a mode transition on the ground.
__EXPORT hrt_abstime hrt_absolute_time(void)
Get absolute time in [us] (does not wrap).
struct airspeed_validated_s * get_airspeed()
#define PWM_SERVO_GET_MAX_PWM
get the maximum PWM value the output will send
virtual void waiting_on_tecs()
Special handling opportunity for the time right after transition to FW before TECS is running...