mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 00:53:34 +08:00
FlightTaskManualAltitude: add an optional stick tilt input filter
This commit is contained in:
@@ -341,6 +341,10 @@ void FlightTaskManualAltitude::_updateSetpoints()
|
|||||||
// setpoint along z-direction, which is computed in PositionControl.cpp.
|
// setpoint along z-direction, which is computed in PositionControl.cpp.
|
||||||
|
|
||||||
Vector2f sp(&_sticks(0));
|
Vector2f sp(&_sticks(0));
|
||||||
|
|
||||||
|
_man_input_filter.setParameters(_deltatime, _param_mc_man_tilt_tau.get());
|
||||||
|
_man_input_filter.update(sp);
|
||||||
|
sp = _man_input_filter.getState();
|
||||||
_rotateIntoHeadingFrame(sp);
|
_rotateIntoHeadingFrame(sp);
|
||||||
|
|
||||||
if (sp.length() > 1.0f) {
|
if (sp.length() > 1.0f) {
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "FlightTaskManual.hpp"
|
#include "FlightTaskManual.hpp"
|
||||||
|
#include <lib/ecl/EKF/AlphaFilter.hpp>
|
||||||
|
|
||||||
class FlightTaskManualAltitude : public FlightTaskManual
|
class FlightTaskManualAltitude : public FlightTaskManual
|
||||||
{
|
{
|
||||||
@@ -83,7 +84,8 @@ protected:
|
|||||||
(ParamFloat<px4::params::MPC_LAND_SPEED>)
|
(ParamFloat<px4::params::MPC_LAND_SPEED>)
|
||||||
_param_mpc_land_speed, /**< desired downwards speed when approaching the ground */
|
_param_mpc_land_speed, /**< desired downwards speed when approaching the ground */
|
||||||
(ParamFloat<px4::params::MPC_TKO_SPEED>)
|
(ParamFloat<px4::params::MPC_TKO_SPEED>)
|
||||||
_param_mpc_tko_speed /**< desired upwards speed when still close to the ground */
|
_param_mpc_tko_speed, /**< desired upwards speed when still close to the ground */
|
||||||
|
(ParamFloat<px4::params::MC_MAN_TILT_TAU>) _param_mc_man_tilt_tau
|
||||||
)
|
)
|
||||||
private:
|
private:
|
||||||
bool _isYawInput();
|
bool _isYawInput();
|
||||||
@@ -137,4 +139,6 @@ private:
|
|||||||
* _dist_to_ground_lock.
|
* _dist_to_ground_lock.
|
||||||
*/
|
*/
|
||||||
float _dist_to_ground_lock = NAN;
|
float _dist_to_ground_lock = NAN;
|
||||||
|
|
||||||
|
AlphaFilter<matrix::Vector2f> _man_input_filter;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user