mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
Enables 20Hz backup scheduling for ControlAllocator
This commit is contained in:
@@ -51,7 +51,7 @@ using namespace time_literals;
|
|||||||
|
|
||||||
ControlAllocator::ControlAllocator() :
|
ControlAllocator::ControlAllocator() :
|
||||||
ModuleParams(nullptr),
|
ModuleParams(nullptr),
|
||||||
WorkItem(MODULE_NAME, px4::wq_configurations::rate_ctrl),
|
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::rate_ctrl),
|
||||||
_loop_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": cycle"))
|
_loop_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": cycle"))
|
||||||
{
|
{
|
||||||
for (int i = 0; i < MAX_NUM_MOTORS; ++i) {
|
for (int i = 0; i < MAX_NUM_MOTORS; ++i) {
|
||||||
@@ -285,6 +285,9 @@ ControlAllocator::Run()
|
|||||||
|
|
||||||
perf_begin(_loop_perf);
|
perf_begin(_loop_perf);
|
||||||
|
|
||||||
|
// Push backup schedule
|
||||||
|
ScheduleDelayed(50_ms);
|
||||||
|
|
||||||
// Check if parameters have changed
|
// Check if parameters have changed
|
||||||
if (_parameter_update_sub.updated() && !_armed) {
|
if (_parameter_update_sub.updated() && !_armed) {
|
||||||
// clear update
|
// clear update
|
||||||
|
|||||||
@@ -74,7 +74,7 @@
|
|||||||
#include <uORB/topics/vehicle_thrust_setpoint.h>
|
#include <uORB/topics/vehicle_thrust_setpoint.h>
|
||||||
#include <uORB/topics/vehicle_status.h>
|
#include <uORB/topics/vehicle_status.h>
|
||||||
|
|
||||||
class ControlAllocator : public ModuleBase<ControlAllocator>, public ModuleParams, public px4::WorkItem
|
class ControlAllocator : public ModuleBase<ControlAllocator>, public ModuleParams, public px4::ScheduledWorkItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static constexpr int NUM_ACTUATORS = ControlAllocation::NUM_ACTUATORS;
|
static constexpr int NUM_ACTUATORS = ControlAllocation::NUM_ACTUATORS;
|
||||||
|
|||||||
Reference in New Issue
Block a user