39 #include <px4_platform_common/px4_config.h> 40 #include <px4_platform_common/defines.h> 41 #include <px4_platform_common/module.h> 42 #include <px4_platform_common/module_params.h> 43 #include <px4_platform_common/posix.h> 44 #include <px4_platform_common/px4_work_queue/WorkItem.hpp> 80 static int print_usage(
const char *reason =
nullptr);
149 (ParamFloat<px4::params::MC_ROLL_P>) _param_mc_roll_p,
150 (ParamFloat<px4::params::MC_PITCH_P>) _param_mc_pitch_p,
151 (ParamFloat<px4::params::MC_YAW_P>) _param_mc_yaw_p,
153 (ParamFloat<px4::params::MC_ROLLRATE_MAX>) _param_mc_rollrate_max,
154 (ParamFloat<px4::params::MC_PITCHRATE_MAX>) _param_mc_pitchrate_max,
155 (ParamFloat<px4::params::MC_YAWRATE_MAX>) _param_mc_yawrate_max,
157 (ParamFloat<px4::params::MPC_MAN_Y_MAX>) _param_mpc_man_y_max,
159 (ParamFloat<px4::params::MC_RATT_TH>) _param_mc_ratt_th,
162 (ParamFloat<px4::params::MPC_MAN_TILT_MAX>) _param_mpc_man_tilt_max,
163 (ParamFloat<px4::params::MPC_MANTHR_MIN>) _param_mpc_manthr_min,
164 (ParamFloat<px4::params::MPC_THR_MAX>) _param_mpc_thr_max,
165 (ParamFloat<px4::params::MPC_THR_HOVER>)
166 _param_mpc_thr_hover,
167 (ParamInt<px4::params::MPC_THR_CURVE>) _param_mpc_thr_curve,
169 (ParamInt<px4::params::MC_AIRMODE>) _param_mc_airmode
172 bool _is_tailsitter{
false};
DEFINE_PARAMETERS((ParamFloat< px4::params::MC_ROLL_P >) _param_mc_roll_p,(ParamFloat< px4::params::MC_PITCH_P >) _param_mc_pitch_p,(ParamFloat< px4::params::MC_YAW_P >) _param_mc_yaw_p,(ParamFloat< px4::params::MC_ROLLRATE_MAX >) _param_mc_rollrate_max,(ParamFloat< px4::params::MC_PITCHRATE_MAX >) _param_mc_pitchrate_max,(ParamFloat< px4::params::MC_YAWRATE_MAX >) _param_mc_yawrate_max,(ParamFloat< px4::params::MPC_MAN_Y_MAX >) _param_mpc_man_y_max,(ParamFloat< px4::params::MC_RATT_TH >) _param_mc_ratt_th,(ParamFloat< px4::params::MPC_MAN_TILT_MAX >) _param_mpc_man_tilt_max,(ParamFloat< px4::params::MPC_MANTHR_MIN >) _param_mpc_manthr_min,(ParamFloat< px4::params::MPC_THR_MAX >) _param_mpc_thr_max,(ParamFloat< px4::params::MPC_THR_HOVER >) _param_mpc_thr_hover,(ParamInt< px4::params::MPC_THR_CURVE >) _param_mpc_thr_curve,(ParamInt< px4::params::MC_AIRMODE >) _param_mc_airmode) bool _is_tailsitter
float _man_tilt_max
maximum tilt allowed for manual flight [rad]
uORB::Subscription _v_att_sp_sub
vehicle attitude setpoint subscription
void publish_rates_setpoint()
Generic, programmable, procedural control signal mixers.
orb_advert_t _vehicle_attitude_setpoint_pub
uORB::Subscription _vehicle_land_detected_sub
vehicle land detected subscription
uORB::Subscription _v_rates_sp_sub
vehicle rates setpoint subscription
uORB::SubscriptionCallbackWorkItem _vehicle_attitude_sub
matrix::Vector3f _rates_sp
angular rates setpoint
float throttle_curve(float throttle_stick_input)
int print_status() override
#define ORB_ID(_name)
Generates a pointer to the uORB metadata structure for a given topic.
uORB::Subscription _v_control_mode_sub
vehicle control mode subscription
A quaternion based attitude controller.
void parameters_updated()
initialize some vectors/matrices from parameters
orb_id_t _attitude_sp_id
pointer to correct attitude setpoint uORB metadata structure
void generate_attitude_setpoint(float dt, bool reset_yaw_sp)
Generate & publish an attitude setpoint from stick inputs.
__BEGIN_DECLS typedef uint64_t hrt_abstime
Absolute time, in microsecond units.
uORB::Subscription _params_sub
parameter updates subscription
__BEGIN_DECLS typedef void * orb_advert_t
ORB topic advertiser handle.
MulticopterAttitudeControl()
float _man_yaw_sp
current yaw setpoint in manual mode
perf_counter_t _loop_perf
loop duration performance counter
uORB::Publication< vehicle_rates_setpoint_s > _v_rates_sp_pub
rate setpoint publication
uORB::Subscription _vehicle_status_sub
vehicle status subscription
static int print_usage(const char *reason=nullptr)
static int task_spawn(int argc, char *argv[])
static int custom_command(int argc, char *argv[])
virtual ~MulticopterAttitudeControl()
AttitudeControl _attitude_control
class for attitude control calculations
uORB::Subscription _manual_control_sp_sub
manual control setpoint subscription
void control_attitude()
Attitude controller.
vehicle attitude setpoint
void vehicle_status_poll()
Performance measuring tools.
__EXPORT int mc_att_control_main(int argc, char *argv[])
Multicopter attitude control app start / stop handling function.