PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <MulticopterRateControl.hpp>
Public Member Functions | |
MulticopterRateControl () | |
virtual | ~MulticopterRateControl () |
int | print_status () override |
void | Run () override |
bool | init () |
Static Public Member Functions | |
static int | task_spawn (int argc, char *argv[]) |
static int | custom_command (int argc, char *argv[]) |
static int | print_usage (const char *reason=nullptr) |
Private Member Functions | |
void | parameters_updated () |
initialize some vectors/matrices from parameters More... | |
void | vehicle_status_poll () |
float | get_landing_gear_state () |
Get the landing gear state based on the manual control switch position. More... | |
Static Private Attributes | |
static constexpr const float | initial_update_rate_hz = 1000.f |
loop update rate used for initialization More... | |
Definition at line 63 of file MulticopterRateControl.hpp.
MulticopterRateControl::MulticopterRateControl | ( | ) |
Definition at line 45 of file MulticopterRateControl.cpp.
References _vehicle_status, parameters_updated(), and vehicle_status_s::vehicle_type.
Referenced by task_spawn().
|
virtual |
Definition at line 55 of file MulticopterRateControl.cpp.
References _loop_perf, and perf_free().
|
static |
Definition at line 376 of file MulticopterRateControl.cpp.
References print_usage().
|
private |
Get the landing gear state based on the manual control switch position.
Definition at line 118 of file MulticopterRateControl.cpp.
References _gear_state_initialized, _landed, _manual_control_sp, and manual_control_setpoint_s::gear_switch.
Referenced by Run().
bool MulticopterRateControl::init | ( | ) |
Definition at line 61 of file MulticopterRateControl.cpp.
References _vehicle_angular_velocity_sub, and uORB::SubscriptionCallback::registerCallback().
Referenced by task_spawn().
|
private |
initialize some vectors/matrices from parameters
Definition at line 72 of file MulticopterRateControl.cpp.
References _actuators_0_circuit_breaker_enabled, _loop_update_rate_hz, _rate_control, CBRK_RATE_CTRL_KEY, circuit_breaker_enabled_by_val(), matrix::Matrix< Type, M, N >::emult(), math::radians(), RateControl::setDTermCutoff(), RateControl::setFeedForwardGain(), RateControl::setGains(), and RateControl::setIntegratorLimit().
Referenced by MulticopterRateControl(), and Run().
|
override |
Definition at line 367 of file MulticopterRateControl.cpp.
References _loop_perf, and perf_print_counter().
|
static |
Definition at line 381 of file MulticopterRateControl.cpp.
References mc_rate_control_main().
Referenced by custom_command().
|
override |
Definition at line 142 of file MulticopterRateControl.cpp.
References _actuators_0_circuit_breaker_enabled, _actuators_0_pub, _actuators_id, _battery_status_scale, _battery_status_sub, _controller_status_pub, _dt_accumulator, _landed, _landing_gear, _landing_gear_pub, _landing_gear_sub, _last_run, _loop_counter, _loop_perf, _loop_update_rate_hz, _manual_control_sp, _manual_control_sp_sub, _maybe_landed, _motor_limits_sub, _parameter_update_sub, _rate_control, _rates_sp, _task_start, _thrust_sp, _v_control_mode, _v_control_mode_sub, _v_rates_sp_pub, _v_rates_sp_sub, _vehicle_angular_velocity_sub, _vehicle_land_detected_sub, _vehicle_status, math::constrain(), actuator_controls_s::control, uORB::Subscription::copy(), dt, matrix::Matrix< Type, M, N >::emult(), f(), vehicle_control_mode_s::flag_armed, vehicle_control_mode_s::flag_control_altitude_enabled, vehicle_control_mode_s::flag_control_attitude_enabled, vehicle_control_mode_s::flag_control_manual_enabled, vehicle_control_mode_s::flag_control_position_enabled, vehicle_control_mode_s::flag_control_rates_enabled, vehicle_control_mode_s::flag_control_rattitude_enabled, vehicle_control_mode_s::flag_control_termination_enabled, vehicle_control_mode_s::flag_control_velocity_enabled, get_landing_gear_state(), RateControl::getRateControlStatus(), hrt_absolute_time(), hrt_abstime, hrt_elapsed_time(), vehicle_status_s::is_vtol, vehicle_land_detected_s::landed, landing_gear_s::landing_gear, vehicle_land_detected_s::maybe_landed, ORB_PRIO_DEFAULT, orb_publish_auto(), parameters_updated(), perf_begin(), perf_end(), vehicle_rates_setpoint_s::pitch, uORB::Publication< T >::publish(), uORB::PublicationMulti< T >::publish(), manual_control_setpoint_s::r, RateControl::resetIntegral(), vehicle_rates_setpoint_s::roll, multirotor_motor_limits_s::saturation_status, battery_status_s::scale, RateControl::setDTermCutoff(), RateControl::setSaturationStatus(), math::superexpo(), vehicle_rates_setpoint_s::thrust_body, landing_gear_s::timestamp, actuator_controls_s::timestamp, vehicle_angular_velocity_s::timestamp_sample, uORB::SubscriptionCallback::unregisterCallback(), uORB::SubscriptionInterval::update(), RateControl::update(), uORB::Subscription::update(), uORB::Subscription::updated(), MultirotorMixer::saturation_status::value, vehicle_status_poll(), vehicle_status_s::vehicle_type, manual_control_setpoint_s::x, vehicle_angular_velocity_s::xyz, manual_control_setpoint_s::y, vehicle_rates_setpoint_s::yaw, and manual_control_setpoint_s::z.
|
static |
Definition at line 344 of file MulticopterRateControl.cpp.
References init(), ll40ls::instance, and MulticopterRateControl().
|
private |
Definition at line 101 of file MulticopterRateControl.cpp.
References _actuators_id, _vehicle_status, _vehicle_status_sub, vehicle_status_s::is_vtol, ORB_ID, and uORB::Subscription::update().
Referenced by Run().
|
private |
circuit breaker to suppress output
Definition at line 127 of file MulticopterRateControl.hpp.
Referenced by parameters_updated(), and Run().
|
private |
attitude actuator controls publication
Definition at line 119 of file MulticopterRateControl.hpp.
Referenced by Run().
|
private |
pointer to correct actuator controls0 uORB metadata structure
Definition at line 120 of file MulticopterRateControl.hpp.
Referenced by Run(), and vehicle_status_poll().
|
private |
Definition at line 131 of file MulticopterRateControl.hpp.
Referenced by Run().
|
private |
battery status subscription
Definition at line 109 of file MulticopterRateControl.hpp.
Referenced by Run().
|
private |
controller status publication
Definition at line 115 of file MulticopterRateControl.hpp.
Referenced by Run().
|
private |
Definition at line 146 of file MulticopterRateControl.hpp.
Referenced by Run().
|
private |
true if the gear state has been initialized
Definition at line 142 of file MulticopterRateControl.hpp.
Referenced by get_landing_gear_state().
|
private |
Definition at line 128 of file MulticopterRateControl.hpp.
Referenced by get_landing_gear_state(), and Run().
|
private |
Definition at line 122 of file MulticopterRateControl.hpp.
Referenced by Run().
|
private |
Definition at line 116 of file MulticopterRateControl.hpp.
Referenced by Run().
|
private |
Definition at line 111 of file MulticopterRateControl.hpp.
Referenced by Run().
|
private |
Definition at line 145 of file MulticopterRateControl.hpp.
Referenced by Run().
|
private |
Definition at line 147 of file MulticopterRateControl.hpp.
Referenced by Run().
|
private |
loop duration performance counter
Definition at line 133 of file MulticopterRateControl.hpp.
Referenced by print_status(), Run(), and ~MulticopterRateControl().
|
private |
current rate-controller loop update rate in [Hz]
Definition at line 136 of file MulticopterRateControl.hpp.
Referenced by parameters_updated(), and Run().
|
private |
Definition at line 123 of file MulticopterRateControl.hpp.
Referenced by get_landing_gear_state(), and Run().
|
private |
manual control setpoint subscription
Definition at line 106 of file MulticopterRateControl.hpp.
Referenced by Run().
|
private |
Definition at line 129 of file MulticopterRateControl.hpp.
Referenced by Run().
|
private |
motor limits subscription
Definition at line 108 of file MulticopterRateControl.hpp.
Referenced by Run().
|
private |
parameter updates subscription
Definition at line 105 of file MulticopterRateControl.hpp.
Referenced by Run().
|
private |
class for rate control calculations
Definition at line 101 of file MulticopterRateControl.hpp.
Referenced by parameters_updated(), and Run().
|
private |
angular rates setpoint
Definition at line 138 of file MulticopterRateControl.hpp.
Referenced by Run().
|
private |
Definition at line 144 of file MulticopterRateControl.hpp.
Referenced by Run().
|
private |
|
private |
Definition at line 124 of file MulticopterRateControl.hpp.
Referenced by Run().
|
private |
vehicle control mode subscription
Definition at line 104 of file MulticopterRateControl.hpp.
Referenced by Run().
|
private |
rate setpoint publication
Definition at line 117 of file MulticopterRateControl.hpp.
Referenced by Run().
|
private |
vehicle rates setpoint subscription
Definition at line 103 of file MulticopterRateControl.hpp.
Referenced by Run().
|
private |
Definition at line 113 of file MulticopterRateControl.hpp.
|
private |
vehicle land detected subscription
Definition at line 110 of file MulticopterRateControl.hpp.
Referenced by Run().
|
private |
Definition at line 125 of file MulticopterRateControl.hpp.
Referenced by MulticopterRateControl(), Run(), and vehicle_status_poll().
|
private |
vehicle status subscription
Definition at line 107 of file MulticopterRateControl.hpp.
Referenced by vehicle_status_poll().
|
staticprivate |
loop update rate used for initialization
Definition at line 135 of file MulticopterRateControl.hpp.