mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 08:31:35 +08:00
px4_tasks: reduce POSITION_CONTROL priority
* this is to prevent the loss of any sensor data or estimator time slip in the event of a position controller or flight task overrun
This commit is contained in:
+11
-11
@@ -101,28 +101,22 @@ typedef struct {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// PX4 work queue starting high priority
|
// PX4 work queue starting high priority
|
||||||
#define PX4_WQ_HP_BASE (SCHED_PRIORITY_MAX - 11)
|
#define PX4_WQ_HP_BASE (SCHED_PRIORITY_MAX - 12)
|
||||||
|
|
||||||
// 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.
|
||||||
#define SCHED_PRIORITY_FAST_DRIVER (SCHED_PRIORITY_MAX - 0)
|
#define SCHED_PRIORITY_FAST_DRIVER (SCHED_PRIORITY_MAX - 0)
|
||||||
|
|
||||||
|
// Actuator outputs should run as soon as the rate controller publishes
|
||||||
|
// the actuator controls topic
|
||||||
|
#define SCHED_PRIORITY_ACTUATOR_OUTPUTS (PX4_WQ_HP_BASE - 3)
|
||||||
|
|
||||||
// Attitude controllers typically are in a blocking wait on driver data
|
// Attitude controllers typically are in a blocking wait on driver data
|
||||||
// they should be the first to run on an update, using the current sensor
|
// they should be the first to run on an update, using the current sensor
|
||||||
// data and the *previous* attitude reference from the position controller
|
// data and the *previous* attitude reference from the position controller
|
||||||
// which typically runs at a slower rate
|
// which typically runs at a slower rate
|
||||||
#define SCHED_PRIORITY_ATTITUDE_CONTROL (PX4_WQ_HP_BASE - 4)
|
#define SCHED_PRIORITY_ATTITUDE_CONTROL (PX4_WQ_HP_BASE - 4)
|
||||||
|
|
||||||
// Actuator outputs should run as soon as the rate controller publishes
|
|
||||||
// the actuator controls topic
|
|
||||||
#define SCHED_PRIORITY_ACTUATOR_OUTPUTS (PX4_WQ_HP_BASE - 3)
|
|
||||||
|
|
||||||
// Position controllers typically are in a blocking wait on estimator data
|
|
||||||
// so when new sensor data is available they will run last. Keeping them
|
|
||||||
// on a high priority ensures that they are the first process to be run
|
|
||||||
// when the estimator updates.
|
|
||||||
#define SCHED_PRIORITY_POSITION_CONTROL (PX4_WQ_HP_BASE - 5)
|
|
||||||
|
|
||||||
// Estimators should run after the attitude controller but before anything
|
// Estimators should run after the attitude controller but before anything
|
||||||
// else in the system. They wait on sensor data which is either coming
|
// else in the system. They wait on sensor data which is either coming
|
||||||
// from the sensor hub or from a driver. Keeping this class at a higher
|
// from the sensor hub or from a driver. Keeping this class at a higher
|
||||||
@@ -135,6 +129,12 @@ typedef struct {
|
|||||||
// complex downstream consumers
|
// complex downstream consumers
|
||||||
#define SCHED_PRIORITY_SENSOR_HUB (PX4_WQ_HP_BASE - 6)
|
#define SCHED_PRIORITY_SENSOR_HUB (PX4_WQ_HP_BASE - 6)
|
||||||
|
|
||||||
|
// Position controllers typically are in a blocking wait on estimator data
|
||||||
|
// so when new sensor data is available they will run last. Keeping them
|
||||||
|
// on a high priority ensures that they are the first process to be run
|
||||||
|
// when the estimator updates.
|
||||||
|
#define SCHED_PRIORITY_POSITION_CONTROL (PX4_WQ_HP_BASE - 7)
|
||||||
|
|
||||||
// The log capture (which stores log data into RAM) should run faster
|
// The log capture (which stores log data into RAM) should run faster
|
||||||
// than other components, but should not run before the control pipeline
|
// than other components, but should not run before the control pipeline
|
||||||
#define SCHED_PRIORITY_LOG_CAPTURE (PX4_WQ_HP_BASE - 10)
|
#define SCHED_PRIORITY_LOG_CAPTURE (PX4_WQ_HP_BASE - 10)
|
||||||
|
|||||||
Reference in New Issue
Block a user