move attitude controllers to new wq:attitude_ctrl

This commit is contained in:
Daniel Agar
2020-04-23 12:00:01 -04:00
parent 97bdfd9cec
commit 326d8efc16
15 changed files with 28 additions and 27 deletions
@@ -65,22 +65,23 @@ static constexpr wq_config_t I2C3{"wq:I2C3", 1472, -11};
static constexpr wq_config_t I2C4{"wq:I2C4", 1472, -12}; static constexpr wq_config_t I2C4{"wq:I2C4", 1472, -12};
// PX4 att/pos controllers, highest priority after sensors. // PX4 att/pos controllers, highest priority after sensors.
static constexpr wq_config_t att_pos_ctrl{"wq:att_pos_ctrl", 7200, -13}; static constexpr wq_config_t attitude_ctrl{"wq:attitude_ctrl", 1500, -13};
static constexpr wq_config_t navigation_and_controllers{"wq:navigation_and_controllers", 7200, -14};
static constexpr wq_config_t hp_default{"wq:hp_default", 1900, -14}; static constexpr wq_config_t hp_default{"wq:hp_default", 1900, -15};
static constexpr wq_config_t uavcan{"wq:uavcan", 3000, -15}; static constexpr wq_config_t uavcan{"wq:uavcan", 3000, -16};
static constexpr wq_config_t UART0{"wq:UART0", 1400, -16}; static constexpr wq_config_t UART0{"wq:UART0", 1400, -17};
static constexpr wq_config_t UART1{"wq:UART1", 1400, -17}; static constexpr wq_config_t UART1{"wq:UART1", 1400, -18};
static constexpr wq_config_t UART2{"wq:UART2", 1400, -18}; static constexpr wq_config_t UART2{"wq:UART2", 1400, -19};
static constexpr wq_config_t UART3{"wq:UART3", 1400, -19}; static constexpr wq_config_t UART3{"wq:UART3", 1400, -20};
static constexpr wq_config_t UART4{"wq:UART4", 1400, -20}; static constexpr wq_config_t UART4{"wq:UART4", 1400, -21};
static constexpr wq_config_t UART5{"wq:UART5", 1400, -21}; static constexpr wq_config_t UART5{"wq:UART5", 1400, -22};
static constexpr wq_config_t UART6{"wq:UART6", 1400, -22}; static constexpr wq_config_t UART6{"wq:UART6", 1400, -23};
static constexpr wq_config_t UART7{"wq:UART7", 1400, -23}; static constexpr wq_config_t UART7{"wq:UART7", 1400, -24};
static constexpr wq_config_t UART8{"wq:UART8", 1400, -24}; static constexpr wq_config_t UART8{"wq:UART8", 1400, -25};
static constexpr wq_config_t UART_UNKNOWN{"wq:UART_UNKNOWN", 1400, -25}; static constexpr wq_config_t UART_UNKNOWN{"wq:UART_UNKNOWN", 1400, -26};
static constexpr wq_config_t lp_default{"wq:lp_default", 1700, -50}; static constexpr wq_config_t lp_default{"wq:lp_default", 1700, -50};
@@ -101,7 +101,7 @@ typedef struct {
#endif #endif
// PX4 work queue starting high priority // PX4 work queue starting high priority
#define PX4_WQ_HP_BASE (SCHED_PRIORITY_MAX - 12) #define PX4_WQ_HP_BASE (SCHED_PRIORITY_MAX - 15)
// Fast drivers - they need to run as quickly as possible to minimize control // Fast drivers - they need to run as quickly as possible to minimize control
// latency. // latency.
@@ -176,7 +176,7 @@ private:
AirspeedModule::AirspeedModule(): AirspeedModule::AirspeedModule():
ModuleParams(nullptr), ModuleParams(nullptr),
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::att_pos_ctrl) ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::navigation_and_controllers)
{ {
// initialise parameters // initialise parameters
update_params(); update_params();
@@ -166,7 +166,7 @@ private:
AttitudeEstimatorQ::AttitudeEstimatorQ() : AttitudeEstimatorQ::AttitudeEstimatorQ() :
ModuleParams(nullptr), ModuleParams(nullptr),
WorkItem(MODULE_NAME, px4::wq_configurations::att_pos_ctrl) WorkItem(MODULE_NAME, px4::wq_configurations::navigation_and_controllers)
{ {
_vel_prev.zero(); _vel_prev.zero();
_pos_acc.zero(); _pos_acc.zero();
+1 -1
View File
@@ -542,7 +542,7 @@ private:
Ekf2::Ekf2(bool replay_mode): Ekf2::Ekf2(bool replay_mode):
ModuleParams(nullptr), ModuleParams(nullptr),
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::att_pos_ctrl), ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::navigation_and_controllers),
_replay_mode(replay_mode), _replay_mode(replay_mode),
_ekf_update_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": update")), _ekf_update_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": update")),
_params(_ekf.getParamHandle()), _params(_ekf.getParamHandle()),
@@ -42,7 +42,7 @@ using math::radians;
FixedwingAttitudeControl::FixedwingAttitudeControl(bool vtol) : FixedwingAttitudeControl::FixedwingAttitudeControl(bool vtol) :
ModuleParams(nullptr), ModuleParams(nullptr),
WorkItem(MODULE_NAME, px4::wq_configurations::att_pos_ctrl), WorkItem(MODULE_NAME, px4::wq_configurations::attitude_ctrl),
_actuators_0_pub(vtol ? ORB_ID(actuator_controls_virtual_fw) : ORB_ID(actuator_controls_0)), _actuators_0_pub(vtol ? ORB_ID(actuator_controls_virtual_fw) : ORB_ID(actuator_controls_0)),
_attitude_sp_pub(vtol ? ORB_ID(fw_virtual_attitude_setpoint) : ORB_ID(vehicle_attitude_setpoint)), _attitude_sp_pub(vtol ? ORB_ID(fw_virtual_attitude_setpoint) : ORB_ID(vehicle_attitude_setpoint)),
_loop_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": cycle")) _loop_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": cycle"))
@@ -37,7 +37,7 @@
FixedwingPositionControl::FixedwingPositionControl(bool vtol) : FixedwingPositionControl::FixedwingPositionControl(bool vtol) :
ModuleParams(nullptr), ModuleParams(nullptr),
WorkItem(MODULE_NAME, px4::wq_configurations::att_pos_ctrl), WorkItem(MODULE_NAME, px4::wq_configurations::navigation_and_controllers),
_attitude_sp_pub(vtol ? ORB_ID(fw_virtual_attitude_setpoint) : ORB_ID(vehicle_attitude_setpoint)), _attitude_sp_pub(vtol ? ORB_ID(fw_virtual_attitude_setpoint) : ORB_ID(vehicle_attitude_setpoint)),
_loop_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": cycle")), _loop_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": cycle")),
_launchDetector(this), _launchDetector(this),
+1 -1
View File
@@ -47,7 +47,7 @@ namespace land_detector
LandDetector::LandDetector() : LandDetector::LandDetector() :
ModuleParams(nullptr), ModuleParams(nullptr),
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::att_pos_ctrl) ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::navigation_and_controllers)
{} {}
LandDetector::~LandDetector() LandDetector::~LandDetector()
@@ -19,7 +19,7 @@ static const char *msg_label = "[lpe] "; // rate of land detector correction
BlockLocalPositionEstimator::BlockLocalPositionEstimator() : BlockLocalPositionEstimator::BlockLocalPositionEstimator() :
ModuleParams(nullptr), ModuleParams(nullptr),
WorkItem(MODULE_NAME, px4::wq_configurations::att_pos_ctrl), WorkItem(MODULE_NAME, px4::wq_configurations::navigation_and_controllers),
// this block has no parent, and has name LPE // this block has no parent, and has name LPE
SuperBlock(nullptr, "LPE"), SuperBlock(nullptr, "LPE"),
@@ -53,7 +53,7 @@ using namespace matrix;
MulticopterAttitudeControl::MulticopterAttitudeControl(bool vtol) : MulticopterAttitudeControl::MulticopterAttitudeControl(bool vtol) :
ModuleParams(nullptr), ModuleParams(nullptr),
WorkItem(MODULE_NAME, px4::wq_configurations::att_pos_ctrl), WorkItem(MODULE_NAME, px4::wq_configurations::attitude_ctrl),
_vehicle_attitude_setpoint_pub(vtol ? ORB_ID(mc_virtual_attitude_setpoint) : ORB_ID(vehicle_attitude_setpoint)), _vehicle_attitude_setpoint_pub(vtol ? ORB_ID(mc_virtual_attitude_setpoint) : ORB_ID(vehicle_attitude_setpoint)),
_loop_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": cycle")) _loop_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": cycle"))
{ {
@@ -284,7 +284,7 @@ private:
MulticopterPositionControl::MulticopterPositionControl(bool vtol) : MulticopterPositionControl::MulticopterPositionControl(bool vtol) :
SuperBlock(nullptr, "MPC"), SuperBlock(nullptr, "MPC"),
ModuleParams(nullptr), ModuleParams(nullptr),
WorkItem(MODULE_NAME, px4::wq_configurations::att_pos_ctrl), WorkItem(MODULE_NAME, px4::wq_configurations::navigation_and_controllers),
_vehicle_attitude_setpoint_pub(vtol ? ORB_ID(mc_virtual_attitude_setpoint) : ORB_ID(vehicle_attitude_setpoint)), _vehicle_attitude_setpoint_pub(vtol ? ORB_ID(mc_virtual_attitude_setpoint) : ORB_ID(vehicle_attitude_setpoint)),
_vel_x_deriv(this, "VELD"), _vel_x_deriv(this, "VELD"),
_vel_y_deriv(this, "VELD"), _vel_y_deriv(this, "VELD"),
+1 -1
View File
@@ -199,7 +199,7 @@ private:
Sensors::Sensors(bool hil_enabled) : Sensors::Sensors(bool hil_enabled) :
ModuleParams(nullptr), ModuleParams(nullptr),
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::att_pos_ctrl), ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::navigation_and_controllers),
_hil_enabled(hil_enabled), _hil_enabled(hil_enabled),
_loop_perf(perf_alloc(PC_ELAPSED, "sensors")), _loop_perf(perf_alloc(PC_ELAPSED, "sensors")),
_voted_sensors_update(_parameters, hil_enabled) _voted_sensors_update(_parameters, hil_enabled)
@@ -43,7 +43,7 @@ namespace sensors
VehicleAcceleration::VehicleAcceleration() : VehicleAcceleration::VehicleAcceleration() :
ModuleParams(nullptr), ModuleParams(nullptr),
WorkItem(MODULE_NAME, px4::wq_configurations::att_pos_ctrl), WorkItem(MODULE_NAME, px4::wq_configurations::navigation_and_controllers),
_corrections(this, SensorCorrections::SensorType::Accelerometer) _corrections(this, SensorCorrections::SensorType::Accelerometer)
{ {
_lp_filter.set_cutoff_frequency(kInitialRateHz, _param_imu_accel_cutoff.get()); _lp_filter.set_cutoff_frequency(kInitialRateHz, _param_imu_accel_cutoff.get());
@@ -43,7 +43,7 @@ static constexpr uint32_t SENSOR_TIMEOUT{300_ms};
VehicleAirData::VehicleAirData() : VehicleAirData::VehicleAirData() :
ModuleParams(nullptr), ModuleParams(nullptr),
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::att_pos_ctrl) ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::navigation_and_controllers)
{ {
_voter.set_timeout(SENSOR_TIMEOUT); _voter.set_timeout(SENSOR_TIMEOUT);
} }
@@ -43,7 +43,7 @@ namespace sensors
VehicleIMU::VehicleIMU(uint8_t accel_index, uint8_t gyro_index) : VehicleIMU::VehicleIMU(uint8_t accel_index, uint8_t gyro_index) :
ModuleParams(nullptr), ModuleParams(nullptr),
WorkItem(MODULE_NAME, px4::wq_configurations::att_pos_ctrl), WorkItem(MODULE_NAME, px4::wq_configurations::navigation_and_controllers),
_sensor_accel_integrated_sub(this, ORB_ID(sensor_accel_integrated), accel_index), _sensor_accel_integrated_sub(this, ORB_ID(sensor_accel_integrated), accel_index),
_sensor_gyro_integrated_sub(this, ORB_ID(sensor_gyro_integrated), gyro_index), _sensor_gyro_integrated_sub(this, ORB_ID(sensor_gyro_integrated), gyro_index),
_accel_corrections(this, SensorCorrections::SensorType::Accelerometer), _accel_corrections(this, SensorCorrections::SensorType::Accelerometer),