mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 01:43:35 +08:00
FlightTaskAutoLine: override _reset method
This commit is contained in:
committed by
Lorenz Meier
parent
e2347c30f6
commit
171c19c3ca
@@ -69,6 +69,8 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
virtual void _reset() = 0; /**< Method that gets called once WaypointType has changed. */
|
||||||
|
|
||||||
matrix::Vector3f _prev_prev_wp{}; /**< Triplet previous-previous triplet. This will be used for smoothing trajectories -> not used yet. */
|
matrix::Vector3f _prev_prev_wp{}; /**< Triplet previous-previous triplet. This will be used for smoothing trajectories -> not used yet. */
|
||||||
matrix::Vector3f _prev_wp{}; /**< Triplet previous setpoint in local frame. If not previous triplet is available, the prev_wp is set to current position. */
|
matrix::Vector3f _prev_wp{}; /**< Triplet previous setpoint in local frame. If not previous triplet is available, the prev_wp is set to current position. */
|
||||||
matrix::Vector3f _target{}; /**< Triplet target setpoint in local frame. */
|
matrix::Vector3f _target{}; /**< Triplet target setpoint in local frame. */
|
||||||
@@ -80,8 +82,6 @@ protected:
|
|||||||
0.0f; /**< Cruise speed with which multicopter flies and gets set by triplet. If no valid, default cruise speed is used. */
|
0.0f; /**< Cruise speed with which multicopter flies and gets set by triplet. If no valid, default cruise speed is used. */
|
||||||
WaypointType _type{WaypointType::idle}; /**< Type of current target triplet. */
|
WaypointType _type{WaypointType::idle}; /**< Type of current target triplet. */
|
||||||
|
|
||||||
virtual void _reset() = 0; /**< Method called one type has changed. */
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
control::BlockParamFloat _mc_cruise_default; /**< Default mc cruise speed*/
|
control::BlockParamFloat _mc_cruise_default; /**< Default mc cruise speed*/
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,6 @@ bool FlightTaskAutoLine::update()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void FlightTaskAutoLine::_reset()
|
void FlightTaskAutoLine::_reset()
|
||||||
{
|
{
|
||||||
/* Set setpoints equal current state. */
|
/* Set setpoints equal current state. */
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
void _reset() override;
|
||||||
|
|
||||||
matrix::Vector2f _vel_sp_xy{};
|
matrix::Vector2f _vel_sp_xy{};
|
||||||
matrix::Vector2f _pos_sp_xy{};
|
matrix::Vector2f _pos_sp_xy{};
|
||||||
float _vel_sp_z = 0.0f;
|
float _vel_sp_z = 0.0f;
|
||||||
@@ -96,5 +98,4 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
float _getVelocityFromAngle(const float angle); /** Computes the speed at target depending on angle. */
|
float _getVelocityFromAngle(const float angle); /** Computes the speed at target depending on angle. */
|
||||||
void _reset(); /** Resets setpoint. */
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user