mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Enables 20Hz backup scheduling for ControlAllocator
This commit is contained in:
parent
b0352135bb
commit
aecfbef128
@ -51,7 +51,7 @@ using namespace time_literals;
|
||||
|
||||
ControlAllocator::ControlAllocator() :
|
||||
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"))
|
||||
{
|
||||
for (int i = 0; i < MAX_NUM_MOTORS; ++i) {
|
||||
@ -285,6 +285,9 @@ ControlAllocator::Run()
|
||||
|
||||
perf_begin(_loop_perf);
|
||||
|
||||
// Push backup schedule
|
||||
ScheduleDelayed(50_ms);
|
||||
|
||||
// Check if parameters have changed
|
||||
if (_parameter_update_sub.updated() && !_armed) {
|
||||
// clear update
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
#include <uORB/topics/vehicle_thrust_setpoint.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:
|
||||
static constexpr int NUM_ACTUATORS = ControlAllocation::NUM_ACTUATORS;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user