46 #include <matrix/matrix/math.hpp> 48 #include <uORB/topics/landing_gear.h> 49 #include <uORB/topics/vehicle_local_position.h> 50 #include <uORB/topics/vehicle_local_position_setpoint.h> 51 #include <uORB/topics/vehicle_command.h> 52 #include <uORB/topics/vehicle_constraints.h> 53 #include <uORB/topics/vehicle_attitude.h> 54 #include <uORB/topics/vehicle_trajectory_waypoint.h> 106 virtual bool update() = 0;
134 const landing_gear_s &
getGear() {
return _gear; }
179 void updateVelocityControllerIO(
const matrix::Vector3f &vel_sp,
180 const matrix::Vector3f &thrust_sp) {_velocity_setpoint_feedback = vel_sp; _thrust_setpoint_feedback = thrust_sp; }
226 matrix::Vector3f _velocity_setpoint;
227 matrix::Vector3f _acceleration_setpoint;
228 matrix::Vector3f _jerk_setpoint;
229 matrix::Vector3f _thrust_setpoint;
231 float _yawspeed_setpoint;
233 matrix::Vector3f _velocity_setpoint_feedback;
234 matrix::Vector3f _thrust_setpoint_feedback;
242 landing_gear_s _gear{};
virtual bool update()=0
To be called regularly in the control loop cycle to execute the task.
Definition: WeatherVane.hpp:48
virtual void _setDefaultConstraints()
Set constraints to default values.
Definition: FlightTask.cpp:138
const vehicle_constraints_s & getConstraints()
Get vehicle constraints.
Definition: FlightTask.hpp:127
Definition: FlightTask.hpp:58
static constexpr uint64_t _timeout
maximal time in us before a loop or data times out
Definition: FlightTask.hpp:204
void handleParameterUpdate()
Call this whenever a parameter update notification is received (parameter_update uORB message) ...
Definition: FlightTask.hpp:168
const vehicle_trajectory_waypoint_s & getAvoidanceWaypoint()
Get avoidance desired waypoint.
Definition: FlightTask.hpp:140
virtual bool applyCommandParameters(const vehicle_command_s &command)
To be called to adopt parameters from an arrived vehicle command.
Definition: FlightTask.hpp:93
void _evaluateVehicleLocalPosition()
Check and update local position.
Definition: FlightTask.cpp:89
High-resolution timer with callouts and timekeeping.
virtual bool updateFinalize()
Call after update() to constrain the generated setpoints in order to comply with the constraints of t...
Definition: FlightTask.hpp:114
virtual void setYawHandler(WeatherVane *ext_yaw_handler)
Sets an external yaw handler which can be used by any flight task to implement a different yaw contro...
Definition: FlightTask.hpp:177
float _yaw
current vehicle yaw heading
Definition: FlightTask.hpp:214
static const vehicle_local_position_setpoint_s empty_setpoint
Empty setpoint.
Definition: FlightTask.hpp:146
Simple array that contains a dynamic amount of Subscription<T> instances.
vehicle_trajectory_waypoint_s _desired_waypoint
Desired waypoints.
Definition: FlightTask.hpp:248
static const landing_gear_s empty_landing_gear_default_keep
default landing gear state
Definition: FlightTask.hpp:157
static const vehicle_trajectory_waypoint_s empty_trajectory_waypoint
Empty desired waypoints.
Definition: FlightTask.hpp:163
void _resetSetpoints()
Reset all setpoints to NAN.
Definition: FlightTask.cpp:79
matrix::Vector3f _velocity
current vehicle velocity
Definition: FlightTask.hpp:213
Definition: px4_param.h:318
hrt_abstime _time_stamp_activate
time stamp when task was activated
Definition: FlightTask.hpp:207
float _time
passed time in seconds since the task was activated
Definition: FlightTask.hpp:205
C++ base class for modules/classes using configuration parameters.
Definition: px4_module_params.h:46
float _dist_to_bottom
current height above ground level
Definition: FlightTask.hpp:215
const vehicle_local_position_setpoint_s getPositionSetpoint()
Get the output data.
Definition: FlightTask.cpp:50
vehicle_constraints_s _constraints
Vehicle constraints.
Definition: FlightTask.hpp:240
matrix::Vector3f _position
current vehicle position
Definition: FlightTask.hpp:212
uint8_t _heading_reset_counter
estimator heading reset
Definition: FlightTask.hpp:186
const landing_gear_s & getGear()
Get landing gear position.
Definition: FlightTask.hpp:134
__BEGIN_DECLS typedef uint64_t hrt_abstime
Absolute time, in microsecond units.
Definition: drv_hrt.h:58
float _deltatime
passed time in seconds since the task was last updated
Definition: FlightTask.hpp:206
hrt_abstime _time_stamp_last
time stamp when task was last updated
Definition: FlightTask.hpp:209
virtual bool updateInitialize()
Call before activate() or update() to initialize time and input data.
Definition: FlightTask.cpp:40
virtual bool activate()
Call once on the event where you switch to the task.
Definition: FlightTask.cpp:25
static const vehicle_constraints_s empty_constraints
Empty constraints.
Definition: FlightTask.hpp:152
virtual bool initializeSubscriptions(SubscriptionArray &subscription_array)
Initialize the uORB subscriptions using an array.
Definition: FlightTask.cpp:12
Definition: SubscriptionArray.hpp:46
virtual void reActivate()
Call this to reset an active Flight Task.
Definition: FlightTask.cpp:35
virtual void updateParams()
Call this method whenever the module gets a parameter change notification.
Definition: px4_module_params.h:79
hrt_abstime _time_stamp_current
time stamp at the beginning of the current task update
Definition: FlightTask.hpp:208
matrix::Vector3f _position_setpoint
Setpoints which the position controller has to execute.
Definition: FlightTask.hpp:225