mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-27 18:20:36 +08:00
FlightTasks: construct all tasks in constructor
This commit is contained in:
committed by
Lorenz Meier
parent
b1530d1a81
commit
29fb5089bd
@@ -3,6 +3,18 @@
|
||||
#include <uORB/topics/vehicle_command.h>
|
||||
#include <uORB/topics/vehicle_command_ack.h>
|
||||
|
||||
FlightTasks::FlightTasks()
|
||||
{
|
||||
// initialize all flight-tasks
|
||||
// currently this is required to get all parameters read
|
||||
for (int i = 0; i < static_cast<int>(FlightTaskIndex::Count); i++) {
|
||||
_initTask(static_cast<FlightTaskIndex>(i));
|
||||
}
|
||||
|
||||
// disable all tasks
|
||||
_initTask(FlightTaskIndex::None);
|
||||
}
|
||||
|
||||
bool FlightTasks::update()
|
||||
{
|
||||
_updateCommand();
|
||||
|
||||
@@ -76,7 +76,7 @@ enum class FlightTaskIndex : int {
|
||||
class FlightTasks
|
||||
{
|
||||
public:
|
||||
FlightTasks() = default;
|
||||
FlightTasks();
|
||||
|
||||
~FlightTasks()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user