46 #include "FlightTasks_generated.hpp" 58 if (_current_task.task) {
59 _current_task.task->~FlightTask();
110 int switchTask(FlightTaskIndex new_task_index);
145 void updateVelocityControllerIO(
const matrix::Vector3f &vel_sp,
const matrix::Vector3f &thrust_sp) {_current_task.task->updateVelocityControllerIO(vel_sp, thrust_sp); }
153 TaskUnion _task_union;
155 struct flight_task_t {
157 FlightTaskIndex index;
159 flight_task_t _current_task = {
nullptr, FlightTaskIndex::None};
163 struct task_error_t {
168 static const int _numError = 4;
172 task_error_t _taskError[_numError] = {
174 {-1,
"Invalid Task "},
175 {-2,
"Subscription Failed"},
176 {-3,
"Activation Failed"}
181 void _updateCommand();
182 FlightTaskIndex switchVehicleCommand(
const int command);
183 int _sub_vehicle_command = -1;
186 int _initTask(FlightTaskIndex task_index);
Definition: WeatherVane.hpp:48
const landing_gear_s getGear()
Get landing gear position.
Definition: FlightTasks.cpp:50
const vehicle_local_position_setpoint_s getPositionSetpoint()
Get the output data from the current task.
Definition: FlightTasks.cpp:30
const vehicle_constraints_s getConstraints()
Get task dependent constraints.
Definition: FlightTasks.cpp:40
void reActivate()
This method will re-activate current task.
Definition: FlightTasks.cpp:128
bool update()
Call regularly in the control loop cycle to execute the task.
Definition: FlightTasks.cpp:18
Definition: FlightTask.hpp:58
const char * errorToString(const int error)
Call this method to get the description of a task error.
Definition: FlightTasks.cpp:117
int getActiveTask() const
Get the number of the active task.
Definition: FlightTasks.hpp:117
__BEGIN_DECLS typedef void * orb_advert_t
ORB topic advertiser handle.
Definition: uORB.h:134
Simple array that contains a dynamic amount of Subscription<T> instances.
bool isAnyTaskActive() const
Check if any task is active.
Definition: FlightTasks.hpp:123
const vehicle_trajectory_waypoint_s getAvoidanceWaypoint()
Get task avoidance desired waypoints.
Abstract base class for different advanced flight tasks like orbit, follow me, ...
const vehicle_trajectory_waypoint_s & getEmptyAvoidanceWaypoint()
Get empty avoidance desired waypoints.
void setYawHandler(WeatherVane *ext_yaw_handler)
Sets an external yaw handler.
Definition: FlightTasks.hpp:138
Definition: SubscriptionArray.hpp:46
Definition: FlightTasks.hpp:51
void handleParameterUpdate()
Call this whenever a parameter update notification is received (parameter_update uORB message) ...
Definition: FlightTasks.cpp:110
int switchTask()
Switch to the next task in the available list (for testing)
Definition: FlightTasks.hpp:103