mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-06 00:30:35 +08:00
FlightTask: getConstraints method and member
This commit is contained in:
committed by
Lorenz Meier
parent
9f11f1afcf
commit
edb2e3256f
@@ -2,9 +2,9 @@
|
||||
#include <mathlib/mathlib.h>
|
||||
|
||||
constexpr uint64_t FlightTask::_timeout;
|
||||
/* First index of empty_setpoint corresponds to time-stamp and requires a finite number. */
|
||||
// First index of empty_setpoint corresponds to time-stamp and requires a finite number.
|
||||
const vehicle_local_position_setpoint_s FlightTask::empty_setpoint = {0, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, {NAN, NAN, NAN}};
|
||||
|
||||
const vehicle_constraints_s FlightTask::empty_constraints = {0, NAN, NAN, NAN};
|
||||
bool FlightTask::initializeSubscriptions(SubscriptionArray &subscription_array)
|
||||
{
|
||||
if (!subscription_array.get(ORB_ID(vehicle_local_position), _sub_vehicle_local_position)) {
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include <uORB/topics/vehicle_local_position.h>
|
||||
#include <uORB/topics/vehicle_local_position_setpoint.h>
|
||||
#include <uORB/topics/vehicle_command.h>
|
||||
#include <uORB/topics/vehicle_constraints.h>
|
||||
#include "../SubscriptionArray.hpp"
|
||||
|
||||
class FlightTask : public ModuleParams
|
||||
@@ -94,8 +95,25 @@ public:
|
||||
*/
|
||||
const vehicle_local_position_setpoint_s getPositionSetpoint();
|
||||
|
||||
/**
|
||||
* Get vehicle constraints.
|
||||
* The constraints can vary with task.
|
||||
* @return constraints
|
||||
*/
|
||||
const vehicle_constraints_s getConstraints() {return _constraints;};
|
||||
|
||||
/**
|
||||
* Empty setpoint.
|
||||
* All setpoints are set to NAN.
|
||||
*/
|
||||
static const vehicle_local_position_setpoint_s empty_setpoint;
|
||||
|
||||
/**
|
||||
* Empty constraints.
|
||||
* All constraints are set to NAN.
|
||||
*/
|
||||
static const vehicle_constraints_s empty_constraints;
|
||||
|
||||
/**
|
||||
* Call this whenever a parameter update notification is received (parameter_update uORB message)
|
||||
*/
|
||||
@@ -163,6 +181,12 @@ protected:
|
||||
float _yawspeed_setpoint;
|
||||
float _dist_to_bottom;
|
||||
|
||||
/**
|
||||
* Vehicle constraints.
|
||||
* The constraints can vary with tasks.
|
||||
*/
|
||||
vehicle_constraints_s _constraints;
|
||||
|
||||
DEFINE_PARAMETERS_CUSTOM_PARENT(ModuleParams,
|
||||
(ParamFloat<px4::params::MPC_XY_VEL_MAX>) MPC_XY_VEL_MAX,
|
||||
(ParamFloat<px4::params::MPC_Z_VEL_MAX_DN>) MPC_Z_VEL_MAX_DN,
|
||||
|
||||
Reference in New Issue
Block a user