56 WorkItem(MODULE_NAME,
px4::wq_configurations::rate_ctrl),
115 PX4_ERR(
"MC actuator controls callback registration failed!");
120 PX4_ERR(
"FW actuator controls callback registration failed!");
156 command_ack.result = (uint8_t)vehicle_command_ack_s::VEHICLE_RESULT_ACCEPTED;
161 command_ack_pub.publish(command_ack);
314 bool should_run =
false;
319 should_run = updated_fw_in || updated_mc_in;
323 should_run = updated_mc_in;
327 should_run = updated_fw_in;
358 if (mc_att_sp_updated || fw_att_sp_updated) {
391 if (mc_att_sp_updated || fw_att_sp_updated) {
415 if (fw_att_sp_updated) {
441 _object.store(instance);
442 _task_id = task_id_is_work_queue;
444 if (instance->
init()) {
449 PX4_ERR(
"alloc failed");
453 _object.store(
nullptr);
477 PX4_WARN(
"%s\n", reason);
480 PRINT_MODULE_DESCRIPTION(
483 fw_att_control is the fixed wing attitude controller. 486 PRINT_MODULE_USAGE_COMMAND("start");
487 PRINT_MODULE_USAGE_NAME(
"vtol_att_control",
"controller");
488 PRINT_MODULE_USAGE_DEFAULT_COMMANDS();
constexpr _Tp constrain(_Tp val, _Tp min_val, _Tp max_val)
float front_trans_timeout
#define mavlink_log_critical(_pub, _text,...)
Send a mavlink critical message and print to console.
uORB::Publication< actuator_controls_s > _actuators_1_pub
vehicle_land_detected_s _land_detected
measure the time elapsed performing an event
uORB::Subscription _parameter_update_sub
vehicle_attitude_s _v_att
bool update(void *dst)
Copy the struct if updated.
uORB::Subscription _mc_virtual_att_sp_sub
__EXPORT int param_get(param_t param, void *val)
Copy the value of a parameter.
uORB::SubscriptionCallbackWorkItem _actuator_inputs_fw
actuator_controls_s _actuators_out_1
uORB::Subscription _pos_sp_triplet_sub
int main(int argc, char **argv)
int32_t fw_motors_off
bitmask of all motors that should be off in fixed wing mode
uORB::Publication< vtol_vehicle_status_s > _vtol_vehicle_status_pub
vehicle_attitude_setpoint_s _fw_virtual_att_sp
uint8_t transition_switch
perf_counter_t _loop_perf
loop performance counter
virtual void update_vtol_state()=0
Update vtol state.
actuator_controls_s _actuators_fw_in
vehicle_attitude_setpoint_s _mc_virtual_att_sp
#define ORB_ID(_name)
Generates a pointer to the uORB metadata structure for a given topic.
uORB::Subscription _land_detected_sub
bool vtol_transition_failsafe
static int custom_command(int argc, char *argv[])
vehicle_attitude_setpoint_s _v_att_sp
bool publish(const T &data)
Publish the struct.
bool flag_control_manual_enabled
vtol_vehicle_status_s _vtol_vehicle_status
void perf_free(perf_counter_t handle)
Free a counter.
uORB::Subscription _local_pos_sub
int print_status() override
uORB::Subscription _tecs_status_sub
uORB::Publication< actuator_controls_s > _actuators_0_pub
airspeed_validated_s _airspeed_validated
virtual void update_fw_state()
Update fixed wing state.
uORB::Subscription _airspeed_validated_sub
virtual void parameters_update()=0
actuator_controls_s _actuators_mc_in
struct VtolAttitudeControl::@145 _params_handles
Vector< float, 6 > f(float t, const Matrix< float, 6, 1 > &, const Matrix< float, 3, 1 > &)
vehicle_command_s _vehicle_cmd
int vtol_att_control_main(int argc, char *argv[])
void perf_end(perf_counter_t handle)
End a performance event.
bool updated()
Check if there is a new update.
manual_control_setpoint_s _manual_control_sp
constexpr _Tp min(_Tp a, _Tp b)
static int task_spawn(int argc, char *argv[])
__EXPORT param_t param_find(const char *name)
Look up a parameter by name.
bool _abort_front_transition
float back_trans_duration
vehicle_local_position_setpoint_s _local_pos_sp
uORB::Subscription _fw_virtual_att_sp_sub
void vehicle_cmd_poll()
Check for command updates.
float transition_airspeed
uORB::Subscription _vehicle_cmd_sub
vehicle_local_position_s _local_pos
float front_trans_time_openloop
uORB::Subscription _manual_control_sp_sub
void perf_print_counter(perf_counter_t handle)
Print one performance counter to stdout.
virtual void update_mc_state()
Update multicopter state.
vehicle_control_mode_s _v_control_mode
void unregisterCallback()
float back_trans_throttle
virtual void update_transition_state()=0
Update transition state.
uORB::SubscriptionCallbackWorkItem _actuator_inputs_mc
orb_advert_t _mavlink_log_pub
bool update(void *dst)
Update the struct.
uORB::Subscription _local_pos_sp_sub
position_setpoint_triplet_s _pos_sp_triplet
uORB::Subscription _v_att_sub
float front_trans_time_min
void handle_command()
Check received command.
actuator_controls_s _actuators_out_0
void abort_front_transition(const char *reason)
uORB::Subscription _v_control_mode_sub
bool is_fixed_wing_requested()
#define PWM_DEFAULT_MIN
Default minimum PWM in us.
float front_trans_duration
bool copy(void *dst)
Copy the struct.
tecs_status_s _tecs_status
void perf_begin(perf_counter_t handle)
Begin a performance event.
__EXPORT hrt_abstime hrt_absolute_time(void)
Get absolute time in [us] (does not wrap).
float front_trans_throttle
static int print_usage(const char *reason=nullptr)
virtual void fill_actuator_outputs()=0
Write control values to actuator output topics.
uORB::Publication< vehicle_attitude_setpoint_s > _v_att_sp_pub